dw.extensions.payments
Class SalesforcePaymentRequest
Object
dw.extensions.payments.SalesforcePaymentRequest
Salesforce Payments payment request. Create a request to use the Salesforce Payments checkout drop-in component.
Constants
ELEMENT_CARD_CVC  :  String = "cardCvc"
Element for the Stripe credit card CVC field "cardCvc".
ELEMENT_CARD_EXPIRY  :  String = "cardExpiry"
Element for the Stripe credit card expiration date field "cardExpiry".
ELEMENT_CARD_NUMBER  :  String = "cardNumber"
Element for the Stripe credit card number field "cardNumber".
ELEMENT_IBAN  :  String = "iban"
Element for the Stripe IBAN field "iban".
ELEMENT_IDEAL_BANK  :  String = "idealBank"
Element for the Stripe iDEAL bank selection field "idealBank".
ELEMENT_PAYMENT_REQUEST_BUTTON  :  String = "paymentRequestButton"
Element for the Stripe payment request button "paymentRequestButton".
ELEMENT_TYPE_APPLEPAY  :  String = "applepay"
Element type name for Apple Pay payment request buttons.
ELEMENT_TYPE_BANCONTACT  :  String = "bancontact"
Element type name for Bancontact.
ELEMENT_TYPE_CARD  :  String = "card"
Element type name for credit cards.
ELEMENT_TYPE_IDEAL  :  String = "ideal"
Element type name for iDEAL.
ELEMENT_TYPE_PAYMENTREQUEST  :  String = "paymentrequest"
Element type name for other payment request buttons besides Apple Pay, like Google Pay.
ELEMENT_TYPE_SEPA_DEBIT  :  String = "sepa_debit"
Element type name for SEPA debit.
Properties
basketData  :  Object
The data to include in the call to prepare the basket when a Buy Now button is tapped.
exclude  :  Set  (Read Only)
A set containing the element types to exclude from Salesforce Payments components.
ID  :  String  (Read Only)
The identifier of this payment request.
include  :  Set  (Read Only)
A set containing the specific element types to include from Salesforce Payments components. If the set is empty then all applicable and enabled element types will be included by default.
selector  :  String  (Read Only)
The DOM element selector where to mount Salesforce Payments components.
Constructor Summary
SalesforcePaymentRequest(id : String, selector : String)
Constructs a payment request using the given identifiers.
Method Summary
addExclude(elementType : String) : void
Adds the given element type to exclude from Salesforce Payments components.
addInclude(elementType : String) : void
Adds the given element type to include in Salesforce Payments components.
static format(options : Object) : Object
Returns a JS object for the given options to use when a Buy Now button is tapped, in the Salesforce Payments format.
getBasketData() : Object
Returns the data to include in the call to prepare the basket when a Buy Now button is tapped.
getExclude() : Set
Returns a set containing the element types to exclude from Salesforce Payments components.
getID() : String
Returns the identifier of this payment request.
getInclude() : Set
Returns a set containing the specific element types to include from Salesforce Payments components.
getSelector() : String
Returns the DOM element selector where to mount Salesforce Payments components.
setBasketData(basketData : Object) : void
Sets the data to include in the call to prepare the basket when a Buy Now button is tapped.
setOptions(options : Object) : void
Sets the options to use when a Buy Now button is tapped.
setReturnController(returnController : String) : void
Sets the controller to which to redirect when the shopper returns from a 3rd party payment website.
setSavePaymentMethodEnabled(savePaymentMethodEnabled : boolean) : void
Sets if Salesforce Payments components may provide a control for the shopper to save the payment method for later use.
setStripeCreateElementOptions(element : String, options : Object) : void
Sets the the options to pass into the Stripe elements.create call for the given element type.
setStripeElementsOptions(options : Object) : void
Sets the the options to pass into the stripe.elements call.
Methods inherited from class Object
Constructor Detail
SalesforcePaymentRequest
public SalesforcePaymentRequest(id : String, selector : String)
Constructs a payment request using the given identifiers.
Parameters:
id - identifier for payment request
selector - DOM element selector where to mount Salesforce Payments components
Throws:
Exception - if id or selector is null

Method Detail
addExclude
addExclude(elementType : String) : void
Adds the given element type to exclude from Salesforce Payments components.
Parameters:
elementType - element type

addInclude
addInclude(elementType : String) : void
Adds the given element type to include in Salesforce Payments components.
Parameters:
elementType - element type

format
static format(options : Object) : Object
Returns a JS object for the given options to use when a Buy Now button is tapped, in the Salesforce Payments format.
Parameters:
options - JS object containing the payment request options

getBasketData
getBasketData() : Object
Returns the data to include in the call to prepare the basket when a Buy Now button is tapped.
Returns:
JS object containing the basket data

getExclude
getExclude() : Set
Returns a set containing the element types to exclude from Salesforce Payments components.
Returns:
set of element types

getID
getID() : String
Returns the identifier of this payment request.
Returns:
payment request identifier

getInclude
getInclude() : Set
Returns a set containing the specific element types to include from Salesforce Payments components. If the set is empty then all applicable and enabled element types will be included by default.
Returns:
set of element types

getSelector
getSelector() : String
Returns the DOM element selector where to mount Salesforce Payments components.
Returns:
DOM element selector

setBasketData
setBasketData(basketData : Object) : void
Sets the data to include in the call to prepare the basket when a Buy Now button is tapped.
Parameters:
basketData - JS object containing the basket data

setOptions
setOptions(options : Object) : void
Sets the options to use when a Buy Now button is tapped.
Parameters:
options - JS object containing the payment request options

setReturnController
setReturnController(returnController : String) : void
Sets the controller to which to redirect when the shopper returns from a 3rd party payment website. Default is the controller for the current page.
Parameters:
returnController - return controller, such as "Cart-Show"

setSavePaymentMethodEnabled
setSavePaymentMethodEnabled(savePaymentMethodEnabled : boolean) : void
Sets if Salesforce Payments components may provide a control for the shopper to save the payment method for later use.
Parameters:
savePaymentMethodEnabled - if Salesforce Payments components may provide a control for the shopper to save the payment method

setStripeCreateElementOptions
setStripeCreateElementOptions(element : String, options : Object) : void
Sets the the options to pass into the Stripe elements.create call for the given element type. For more information see the Stripe Elements API documentation.
Parameters:
element - name of the Stripe element whose creation to configure
options - JS object containing the options

setStripeElementsOptions
setStripeElementsOptions(options : Object) : void
Sets the the options to pass into the stripe.elements call. For more information see the Stripe Elements API documentation.
Parameters:
options - JS object containing the options

X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.