Builds the payment provider registration for an app, so the app can take payments for shopping cart checkouts. Obtained from paymentProviderDetails on the controller mappings. Set at least the process function, then call build to install the registration on the app. Building without a process function logs a warning and produces a registration that cannot take payments.
Group: Builders
Methods
processFn(String s)
Returns: PaymentProviderDetailsBuilder
Sets the name of the function called to take a single one off payment. This is the minimum a payment provider must supply.
| Parameter | Description |
|---|---|
s | name of the global JavaScript function that takes the payment |
recurring(String initFn, String makeTokenPaymentFn)
Returns: PaymentProviderDetailsBuilder
Sets the two functions needed to support recurring payments, which is what lets the provider be used for subscriptions.
| Parameter | Description |
|---|---|
initFn | name of the function called after the first payment, which should set up the recurring transaction |
makeTokenPaymentFn | name of the function called on each subsequent timed payment |
paymentForm(String s)
Returns: PaymentProviderDetailsBuilder
Sets the repository path of the template that renders this provider's payment form at checkout.
| Parameter | Description |
|---|---|
s | template path for the payment form |
addPaymentOptions(String id, String title, String logoHref)
Returns: PaymentProviderDetailsBuilder
Adds a branded payment option shown to the purchaser at checkout, such as a particular card scheme or wallet.
| Parameter | Description |
|---|---|
id | identifier of the option, passed back to the payment functions |
title | label shown for the option at checkout |
logoHref | URL of the logo image shown beside the option |
build()
Returns: void
Installs the configured payment provider registration on this app, replacing any previous one. Logs a warning if no process function was set, because the provider would then be unable to take payments.