dw.extensions.payments
Class SalesforcePaymentsMgr
Object
dw.extensions.payments.SalesforcePaymentsMgr
Contains functionality for use with Commerce Cloud Payments. See Commerce Cloud Payments documentation for how to gain access and configure it for use on your sites.
Properties
paymentsSiteConfig  :  SalesforcePaymentsSiteConfiguration  (Read Only)
A payments site configuration object for the current site.
Constructor Summary
This class does not have a constructor, so you cannot create it directly.
Method Summary
static attachPaymentMethod(paymentMethod : SalesforcePaymentMethod, customer : Customer) : void
Attaches the given payment method to the given customer.
static detachPaymentMethod(paymentMethod : SalesforcePaymentMethod) : void
Detaches the given payment method from its associated customer.
static getAttachedPaymentMethods(customer : Customer) : Collection
Returns a collection containing the payment methods attached to the given customer.
static getPaymentIntent(basket : Basket) : SalesforcePaymentIntent
Returns the payment intent for the given basket, or null if the given basket has none.
static getPaymentIntent(order : Order) : SalesforcePaymentIntent
Returns the payment intent for the given order, or null if the given order has none.
static getPaymentsSiteConfig() : SalesforcePaymentsSiteConfiguration
Returns a payments site configuration object for the current site.
Methods inherited from class Object
Method Detail
attachPaymentMethod
static attachPaymentMethod(paymentMethod : SalesforcePaymentMethod, customer : Customer) : void
Attaches the given payment method to the given customer. Use this method to attach a payment method of type SalesforcePaymentMethod.TYPE_CARD to a shopper who registers as a customer after placing an order, and has affirmatively elected to save their card as part of the registration process. This method will throw an error if passed incompatible payment method and/or customer objects.
Parameters:
paymentMethod - payment method to attach to customer
customer - customer whose payment method to attach
Throws:
Exception - if there was an error attaching the payment method to the customer

detachPaymentMethod
static detachPaymentMethod(paymentMethod : SalesforcePaymentMethod) : void
Detaches the given payment method from its associated customer. Once detached the payment method remains associated with payment intents in the payment account, but is no longer saved for use by the customer in future orders.
Parameters:
paymentMethod - payment method to detach from customer
Throws:
Exception - if there was an error detaching the payment method from its customer

getAttachedPaymentMethods
static getAttachedPaymentMethods(customer : Customer) : Collection
Returns a collection containing the payment methods attached to the given customer. The collection will be empty if there are no payment methods attached to the customer, or there was an error retrieving the attached payment methods.
Parameters:
customer - customer whose payment methods to get
Returns:
collection of attached payment methods
Throws:
Exception - if the given customer is null or undefined

getPaymentIntent
static getPaymentIntent(basket : Basket) : SalesforcePaymentIntent
Returns the payment intent for the given basket, or null if the given basket has none.
Parameters:
basket - basket to checkout and pay using Commerce Cloud Payments
Returns:
The payment intent
Throws:
Exception - if there was an error retrieving the payment intent for the basket

getPaymentIntent
static getPaymentIntent(order : Order) : SalesforcePaymentIntent
Returns the payment intent for the given order, or null if the given order has none.
Parameters:
order - order paid using Commerce Cloud Payments
Returns:
The payment intent
Throws:
Exception - if there was an error retrieving the payment intent for the order

getPaymentsSiteConfig
static getPaymentsSiteConfig() : SalesforcePaymentsSiteConfiguration
Returns a payments site configuration object for the current site.
Returns:
a payments site configuration or null if no payments site configuration found
Throws:
Exception - if there is no current site

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.