Skip to content

Latest commit

 

History

History
147 lines (95 loc) · 1.91 KB

PaymentResponse.md

File metadata and controls

147 lines (95 loc) · 1.91 KB

PaymentResponse

constructor(paymentResponse)

Initializes the payment response.

Arguments

  • paymentResponse - Array<PaymentMethodData>
Example
const PAYMENT_RESPONSE = {
    requestId: 'demo',
    methodName: 'apple-pay',
    details: {
        transactionIdentifier: 'some-id',
        paymentData: {}
    }
};

const paymentResponse = new PaymentResponse(PAYMENT_RESPONSE);

complete()

Displays a success/failure animation and dismisses the payment request based on the payment status provided.

Arguments

  • paymentStatus - PaymentComplete
Example
paymentResponse.complete('success');

methodName

Example
console.log(paymentResponse.methodName); // apple-pay

details

Example
console.log(paymentResponse.details); // {}

shippingAddress

Example
console.log(paymentResponse.shippingAddress); // null

shippingOption

Example
console.log(paymentResponse.shippingOption); // null

payerName

Example
console.log(paymentResponse.payerName); // null

payerEmail

Example
console.log(paymentResponse.payerEmail); // null

payerPhone

Example
console.log(paymentResponse.payerPhone); // null

demo

Example
console.log(paymentResponse.requestId); // demo