addCustomerCreditSourceToCheckout
Learn how to add a Customer Credit source to checkout.
Use this global method to create a customer credit payment source and attach it to checkout.
The payment session identifier and currency code will be derived from the cart if multicurrency is enabled in org. Otherwise, the currency code will be derived from the user’s default currency.
Before creating a payment source, use this method to verify that the amount
specified by the shopper is less than or equal to the amountRemainingToBeContributed
. If the amount passed into the method is greater than amountRemainingToBeContributed
, it will throw an error.
This global method will set the amountContributed
and amountRemainingToBeContributed
values in the Cart
object.
Sending a request
This method accepts parameters in JSON string format and can be called outside the managed package. You need to pass the cartId
and the amount
applied to this method.
Receiving a response
You'll see the following parameters in the response.
Calling the global method from a custom component
Import the addCustomerChreditSourceToCheckout
method into your custom component javascript file with digialriverv3
as the namespace as shown below.
Call the global method from a custom JavaScript file by passing the cartId
, amount
, and (optionally) paymentName
arguments as shown below.
Last updated