@exodus/react-native-payments
Version:
[](http://facebook.github.io/react-native/releases/0.40) [](https://www.np
55 lines (54 loc) • 1.51 kB
JavaScript
import NativePayments from './NativePayments';
export default class PaymentResponse {
_requestId;
_methodName;
_details;
_shippingAddress;
_shippingOption;
_payerName;
_payerPhone;
_payerEmail;
_completeCalled;
constructor(paymentResponse) {
this._requestId = paymentResponse.requestId;
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;
this._completeCalled = false;
}
get requestId() {
return this._requestId;
}
get methodName() {
return this._methodName;
}
get details() {
return this._details;
}
get shippingAddress() {
return this._shippingAddress;
}
get shippingOption() {
return this._shippingOption;
}
get payerName() {
return this._payerName;
}
get payerPhone() {
return this._payerPhone;
}
get payerEmail() {
return this._payerEmail;
}
complete(paymentStatus) {
if (this._completeCalled === true) {
throw new Error('InvalidStateError');
}
this._completeCalled = true;
return NativePayments.complete(paymentStatus);
}
}