UNPKG

react-native-moyasar-sdk

Version:

Official React Native Moyasar SDK - Integrate Credit Cards, Apple Pay, Samsung Pay, and STC Pay with simple interfaces for a seamless payment experience in your React Native app

69 lines (58 loc) 1.87 kB
"use strict"; // Types // Modules import NativePayments from "../NativeBridge/index.js"; export default class PaymentResponse { constructor(paymentResponse) { this._methodName = paymentResponse.methodName; this._details = paymentResponse.details; this._shippingAddress = paymentResponse.shippingAddress; this._shippingOption = paymentResponse.shippingOption; this._payerName = paymentResponse.payerName; this._payerPhone = paymentResponse.payerPhone; this._payerEmail = paymentResponse.payerEmail; // Internal Slots this._completeCalled = false; } // https://www.w3.org/TR/payment-request/#methodname-attribute get methodName() { return this._methodName; } // https://www.w3.org/TR/payment-request/#details-attribute get details() { return this._details; } // https://www.w3.org/TR/payment-request/#shippingaddress-attribute-1 get shippingAddress() { return this._shippingAddress; } // https://www.w3.org/TR/payment-request/#shippingoption-attribute-1 get shippingOption() { return this._shippingOption; } // https://www.w3.org/TR/payment-request/#payername-attribute get payerName() { return this._payerName; } // https://www.w3.org/TR/payment-request/#payerphone-attribute get payerPhone() { return this._payerPhone; } // https://www.w3.org/TR/payment-request/#payeremail-attribute get payerEmail() { return this._payerEmail; } // https://www.w3.org/TR/payment-request/#complete-method complete(paymentStatus) { if (this._completeCalled === true) { throw new Error('InvalidStateError'); } this._completeCalled = true; return new Promise((resolve, reject) => { return NativePayments.complete(paymentStatus, () => { return resolve(undefined); }); }); } } //# sourceMappingURL=PaymentResponse.js.map