@payrails/web-sdk 5.25.0-RC.1 → 5.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/index.js +4 -4
- package/package.json +1 -1
- package/payrails.d.ts +39 -0
- package/payrails.js +4 -4
package/package.json
CHANGED
package/payrails.d.ts
CHANGED
|
@@ -204,6 +204,7 @@ interface PayPalConfig {
|
|
|
204
204
|
clientId: string;
|
|
205
205
|
merchantId: string;
|
|
206
206
|
captureMode: 'Delayed' | 'Instant' | 'Manual';
|
|
207
|
+
integrationMode: 'express' | 'normal';
|
|
207
208
|
}
|
|
208
209
|
interface ApplePayConfig {
|
|
209
210
|
parameters: {
|
|
@@ -1085,6 +1086,7 @@ interface GooglePayDropinOptions extends GooglePayButtonOptions {
|
|
|
1085
1086
|
interface PaypalButtonOptions extends StoreInstrumentElementOptions {
|
|
1086
1087
|
events?: PaymentEvents & UIEvents & {
|
|
1087
1088
|
onPaypalAvailable?: () => void;
|
|
1089
|
+
onDeliveryAddressChanged?: (data: onPaypalShippingAddressChangedResponse) => Promise<boolean>;
|
|
1088
1090
|
};
|
|
1089
1091
|
styles?: {
|
|
1090
1092
|
color?: 'gold' | 'blue' | 'silver' | 'white' | 'black';
|
|
@@ -1094,6 +1096,17 @@ interface PaypalButtonOptions extends StoreInstrumentElementOptions {
|
|
|
1094
1096
|
tagline?: boolean;
|
|
1095
1097
|
} & StoreInstrumentElementOptions['styles'];
|
|
1096
1098
|
}
|
|
1099
|
+
interface onPaypalShippingAddressChangedResponse {
|
|
1100
|
+
orderID?: string;
|
|
1101
|
+
paymentID?: string;
|
|
1102
|
+
paymentToken?: string;
|
|
1103
|
+
shippingAddress?: {
|
|
1104
|
+
city: string;
|
|
1105
|
+
countryCode: string;
|
|
1106
|
+
postalCode: string;
|
|
1107
|
+
state: string;
|
|
1108
|
+
};
|
|
1109
|
+
}
|
|
1097
1110
|
declare class PaypalButton extends PayrailsElementWithStoreInstrumentCheckbox {
|
|
1098
1111
|
protected options?: PaypalButtonOptions | undefined;
|
|
1099
1112
|
private static instance;
|
|
@@ -1322,6 +1335,7 @@ interface UIEvents {
|
|
|
1322
1335
|
isValid: boolean;
|
|
1323
1336
|
billingAddress?: IAddress;
|
|
1324
1337
|
}) => void;
|
|
1338
|
+
onDeliveryAddressChanged?: (data?: onDeliveryAddressChangedResponse) => Promise<boolean>;
|
|
1325
1339
|
}
|
|
1326
1340
|
type onPaymentMethodSelectedParams = {
|
|
1327
1341
|
paymentMethod?: StorablePaymentCompositionOption;
|
|
@@ -1331,6 +1345,31 @@ interface DropinEvents {
|
|
|
1331
1345
|
onPaymentOptionSelected?: (e: onPaymentMethodSelectedParams) => void;
|
|
1332
1346
|
}
|
|
1333
1347
|
type PayrailsSDKEvents = PaymentEvents & UIEvents & DropinEvents;
|
|
1348
|
+
type onDeliveryAddressChangedResponse = {
|
|
1349
|
+
deliveryAddress?: {
|
|
1350
|
+
street?: string;
|
|
1351
|
+
doorNumber?: string;
|
|
1352
|
+
complement?: string;
|
|
1353
|
+
area?: string;
|
|
1354
|
+
city?: string;
|
|
1355
|
+
postalCode?: string;
|
|
1356
|
+
state?: string;
|
|
1357
|
+
country?: {
|
|
1358
|
+
code?: string;
|
|
1359
|
+
iso3?: string;
|
|
1360
|
+
name?: string;
|
|
1361
|
+
};
|
|
1362
|
+
latitude?: number;
|
|
1363
|
+
longitude?: number;
|
|
1364
|
+
phone?: {
|
|
1365
|
+
countryCode?: string;
|
|
1366
|
+
number?: string;
|
|
1367
|
+
};
|
|
1368
|
+
name?: string;
|
|
1369
|
+
lastName?: string;
|
|
1370
|
+
email?: string;
|
|
1371
|
+
};
|
|
1372
|
+
};
|
|
1334
1373
|
declare enum PayrailsEnvironment {
|
|
1335
1374
|
TEST = "TEST",
|
|
1336
1375
|
PRODUCTION = "PRODUCTION"
|