@exodus/react-native-payments
Version:
[](http://facebook.github.io/react-native/releases/0.40) [](https://www.np
57 lines (56 loc) • 2.63 kB
TypeScript
import { EmitterSubscription } from 'react-native';
import PaymentResponse from './PaymentResponse';
import PaymentRequestUpdateEvent from './PaymentRequestUpdateEvent';
import type PaymentResponseType from './PaymentResponse';
import type { PaymentMethodData, PaymentDetailsInit, PaymentOptions, PaymentAddress, PaymentShippingType, PaymentDetailsIOSRaw, PaymentDetailsIOS } from './types';
export default class PaymentRequest {
_id: string;
_shippingAddress: null | PaymentAddress;
_shippingOption: null | string;
_shippingType: null | PaymentShippingType;
_acceptPromiseResolver?: (value: PaymentResponse) => void;
_acceptPromiseRejecter?: (reason: any) => void;
_serializedMethodData: string;
_details: PaymentDetailsInit;
_options: Partial<PaymentOptions>;
_state: 'created' | 'interactive' | 'closed';
_updating: boolean;
_shippingAddressChangesCount: number;
_shippingAddressChangeFn?: (event: PaymentRequestUpdateEvent) => void;
_shippingOptionChangeFn?: (event: PaymentRequestUpdateEvent) => void;
_shippingAddressChangeSubscription?: EmitterSubscription;
_shippingOptionChangeSubscription?: EmitterSubscription;
_userDismissSubscription?: EmitterSubscription;
_userAcceptSubscription?: EmitterSubscription;
static canMakePaymentsUsingNetworks: (usingNetworks: []) => Promise<boolean>;
static MerchantCapabilities: {
debit: string;
credit: string;
emv: string;
};
constructor(methodData: PaymentMethodData[] | undefined, details: PaymentDetailsInit, options?: Partial<PaymentOptions>);
_setupEventListeners(): void;
_handleShippingAddressChange(postalAddress: PaymentAddress): Promise<void> | undefined;
_handleShippingOptionChange(value: {
selectedShippingOptionId: string;
}): void;
_getPlatformDetails(details: PaymentDetailsIOSRaw): PaymentDetailsIOS;
_handleUserAccept(details: {
transactionIdentifier: string;
paymentData: string;
shippingAddress: PaymentAddress | null;
payerEmail: string;
paymentToken?: string;
paymentMethod: PaymentDetailsIOSRaw['paymentMethod'];
}): void | undefined;
_closePaymentRequest(reject?: boolean): void;
_removeEventListeners(): void;
stopRequest(): void;
addEventListener(eventName: 'shippingaddresschange' | 'shippingoptionchange', fn: any): any;
get id(): string;
get shippingAddress(): null | PaymentAddress;
get shippingOption(): null | string;
show(): Promise<PaymentResponseType>;
abort(): Promise<void>;
canMakePayments(): Promise<boolean>;
}