Home > @vsf-enterprise/sap-commerce-webservices-sdk > CartsApi > createCartPaymentDetails

CartsApi.createCartPaymentDetails() method

Defines the details of a new credit card, and assigns this payment option to the cart. Defines and assigns details of a new credit card payment to the cart.

Signature:

createCartPaymentDetails(baseSiteId: string, cartId: string, userId: string, paymentDetails: PaymentDetails, fields?: 'BASIC' | 'DEFAULT' | 'FULL', options?: any): Promise<import("axios").AxiosResponse<PaymentDetails>>;

Parameters

Parameter Type Description
baseSiteId string Base site identifier
cartId string Cart identifier: cart code for logged in user, cart guid for anonymous user, &#39;current&#39; for the last modified cart
userId string User identifier or one of the literals : &#39;current&#39; for currently authenticated user, &#39;anonymous&#39; for anonymous user
paymentDetails PaymentDetails Request body parameter that contains details such as the name on the card (accountHolderName), the card number (cardNumber), the card type (cardType.code), the month of the expiry date (expiryMonth), the year of the expiry date (expiryYear), whether the payment details should be saved (saved), whether the payment details should be set as default (defaultPaymentInfo), and the billing address (billingAddress.firstName, billingAddress.lastName, billingAddress.titleCode, billingAddress.country.isocode, billingAddress.line1, billingAddress.line2, billingAddress.town, billingAddress.postalCode, billingAddress.region.isocode) The DTO is in XML or .json format.
fields 'BASIC' | 'DEFAULT' | 'FULL' Response configuration. This is the list of fields that should be returned in the response body.
options any Override http request option.

Returns:

Promise<import("axios").AxiosResponse<PaymentDetails>>

Exceptions

{RequiredError} CartsApi