@exodus/react-native-payments
Version:
[](http://facebook.github.io/react-native/releases/0.40) [](https://www.np
116 lines (115 loc) • 3.15 kB
TypeScript
export type PaymentMethodIOSData = {
merchantIdentifier: string;
supportedNetworks: Array<string>;
countryCode: string;
currencyCode: string;
};
export type PaymentMethodData = {
supportedMethods: Array<string>;
data: PaymentMethodIOSData;
};
export type PaymentCurrencyAmount = {
currency: string;
value: string;
};
export type PaymentDetailsBase = {
displayItems: PaymentItem[];
shippingOptions: PaymentShippingOption[];
modifiers: PaymentDetailsModifier[];
};
export type PaymentDetailsInit = PaymentDetailsBase & {
id?: string;
total: PaymentItem;
};
export type PaymentDetailsUpdate = PaymentDetailsBase & {
error: string;
total: PaymentItem;
};
export type PaymentDetailsModifier = {
supportedMethods: Array<string>;
total: PaymentItem;
additionalDisplayItems: Array<PaymentItem>;
data: Object;
};
export type PaymentShippingType = 'shipping' | 'delivery' | 'pickup';
export type PaymentMerchantCapability = 'emv' | 'debit' | 'credit';
export type MerchantCapabilities = PaymentMerchantCapability[] | Record<PaymentMerchantCapability, true>;
export type PaymentOptions = {
requestPayerName: boolean;
requestPayerEmail: boolean;
requestPayerPhone: boolean;
requestShipping: boolean;
requestBilling: boolean;
shippingType: PaymentShippingType;
merchantCapabilities?: MerchantCapabilities;
};
export type PaymentItem = {
label: string;
amount: PaymentCurrencyAmount;
pending: boolean;
};
export type PaymentAddress = {
recipient: null | string;
organization: null | string;
addressLine: null | string;
city: string;
region: string;
country: string;
postalCode: string;
phone: null | string;
languageCode: null | string;
sortingCode: null | string;
dependentLocality: null | string;
};
export type PaymentShippingOption = {
id: string;
label: string;
amount: PaymentCurrencyAmount;
selected: boolean;
};
export type PaymentComplete = 'fail' | 'success' | 'unknown';
type IOSContact = {
phoneNumber: string;
emailAddress: string;
givenName: string;
familyName: string;
phoneticGivenName: string;
phoneticFamilyName: string;
addressLines: string[];
subLocality: string;
locality: string;
postalCode: string;
subAdministrativeArea: string;
administrativeArea: string;
country: string;
countryCode: string;
};
export type PaymentDetailsIOS = {
paymentData?: Object;
billingContact?: IOSContact;
shippingContact?: IOSContact;
paymentToken?: string;
transactionIdentifier: string;
paymentMethod: {
displayName: string;
network: string;
};
};
export type PaymentDetailsIOSRaw = {
paymentData: string;
billingContact?: string;
shippingContact?: string;
paymentToken?: string;
transactionIdentifier: string;
paymentMethod: {
displayName: string;
network: string;
};
};
export type PaymentDetailsAndroid = {
googleTransactionId: string;
payerEmail: string;
paymentDescription: string;
shippingAddress: Object;
};
export {};