@internetarchive/donation-form 1.0.2 → 1.0.3-alpha-webdev7960.1
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/LICENSE +661 -661
- package/README.md +115 -115
- package/dist/demo/braintree-endpoint-manager.js.map +1 -1
- package/dist/demo/demo-analytics-handler.js.map +1 -1
- package/dist/demo/submit-form-with.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/braintree-manager/braintree-interfaces.js.map +1 -1
- package/dist/src/braintree-manager/braintree-manager.js.map +1 -1
- package/dist/src/braintree-manager/payment-clients.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/apple-pay/apple-pay-interface.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/apple-pay/apple-pay-session-datasource-delegate.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/apple-pay/apple-pay-session-datasource-interface.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/apple-pay/apple-pay-session-datasource.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/apple-pay/apple-pay-session-manager.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/apple-pay/apple-pay.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/credit-card/credit-card-interface.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/credit-card/credit-card.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/credit-card/hosted-field-configuration.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/credit-card/hosted-field-container.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/google-pay-interface.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/google-pay.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/paypal/paypal-button-datasource.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/paypal/paypal-interface.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/paypal/paypal.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/venmo-interface.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/venmo.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers-interface.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers.js.map +1 -1
- package/dist/src/donation-form-controller.js +123 -123
- package/dist/src/donation-form-controller.js.map +1 -1
- package/dist/src/donation-form-error.js.map +1 -1
- package/dist/src/donation-form.js +107 -107
- package/dist/src/donation-form.js.map +1 -1
- package/dist/src/form-elements/badged-input.js +47 -47
- package/dist/src/form-elements/badged-input.js.map +1 -1
- package/dist/src/form-elements/contact-form/autocomplete-field-options.js.map +1 -1
- package/dist/src/form-elements/contact-form/contact-form.js +157 -157
- package/dist/src/form-elements/contact-form/contact-form.js.map +1 -1
- package/dist/src/form-elements/contact-form/countries.js.map +1 -1
- package/dist/src/form-elements/header/donation-form-header.js +14 -14
- package/dist/src/form-elements/header/donation-form-header.js.map +1 -1
- package/dist/src/form-elements/header/donation-summary.js +15 -15
- package/dist/src/form-elements/header/donation-summary.js.map +1 -1
- package/dist/src/form-elements/payment-selector.js +164 -164
- package/dist/src/form-elements/payment-selector.js.map +1 -1
- package/dist/src/form-elements/total-amount.js +16 -16
- package/dist/src/form-elements/total-amount.js.map +1 -1
- package/dist/src/modals/confirm-donation-modal-content.js +51 -51
- package/dist/src/modals/confirm-donation-modal-content.js.map +1 -1
- package/dist/src/modals/error-modal-content.js +22 -22
- package/dist/src/modals/error-modal-content.js.map +1 -1
- package/dist/src/modals/upsell-modal-content.js +182 -182
- package/dist/src/modals/upsell-modal-content.js.map +1 -1
- package/dist/src/payment-flow-handlers/donation-flow-modal-manager.js +20 -20
- package/dist/src/payment-flow-handlers/donation-flow-modal-manager.js.map +1 -1
- package/dist/src/payment-flow-handlers/handlers/applepay-flow-handler.js.map +1 -1
- package/dist/src/payment-flow-handlers/handlers/creditcard-flow-handler.js.map +1 -1
- package/dist/src/payment-flow-handlers/handlers/googlepay-flow-handler.js.map +1 -1
- package/dist/src/payment-flow-handlers/handlers/paypal-flow-handler.js.map +1 -1
- package/dist/src/payment-flow-handlers/handlers/venmo-flow-handler.js.map +1 -1
- package/dist/src/payment-flow-handlers/handlers/venmo-restoration-state-handler.js.map +1 -1
- package/dist/src/payment-flow-handlers/payment-flow-handlers.js.map +1 -1
- package/dist/src/recaptcha-manager/recaptcha-manager.js.map +1 -1
- package/dist/src/util/promisedSleep.js.map +1 -1
- package/dist/test/helpers/fillInContactForm.js.map +1 -1
- package/dist/test/mocks/flow-handlers/individual-handlers/mock-applepay-flow-handler.js.map +1 -1
- package/dist/test/mocks/flow-handlers/individual-handlers/mock-creditcard-flow-handler.js.map +1 -1
- package/dist/test/mocks/flow-handlers/individual-handlers/mock-googlepay-flow-handler.js.map +1 -1
- package/dist/test/mocks/flow-handlers/individual-handlers/mock-paypal-flow-handler.js.map +1 -1
- package/dist/test/mocks/flow-handlers/individual-handlers/mock-venmo-flow-handler.js.map +1 -1
- package/dist/test/mocks/flow-handlers/mock-payment-flow-handlers.js.map +1 -1
- package/dist/test/mocks/mock-braintree-manager.js.map +1 -1
- package/dist/test/mocks/mock-donation-info.js.map +1 -1
- package/dist/test/mocks/mock-endpoint-manager.js.map +1 -1
- package/dist/test/mocks/mock-hosted-fields-config.js.map +1 -1
- package/dist/test/mocks/mock-hosted-fields-container.js.map +1 -1
- package/dist/test/mocks/mock-lazy-loader.js.map +1 -1
- package/dist/test/mocks/mock-modal-manager.js.map +1 -1
- package/dist/test/mocks/mock-payment-clients.js.map +1 -1
- package/dist/test/mocks/mock-paypal-button-renderer.js.map +1 -1
- package/dist/test/mocks/mock-recaptcha-manager.js.map +1 -1
- package/dist/test/mocks/models/mock-billing-info.js.map +1 -1
- package/dist/test/mocks/models/mock-custom-fields.js.map +1 -1
- package/dist/test/mocks/models/mock-customer-info.js.map +1 -1
- package/dist/test/mocks/models/mock-donation-request.js.map +1 -1
- package/dist/test/mocks/models/mock-success-response.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-applepay-client.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-applepay-payment.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-applepay-paymentauthorizedevent.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-applepay-session.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-applepay-sessionmanager.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-applepay-validatemerchantevent.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-braintree-client.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-data-collector.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-googlepay-client.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-googlepay-library.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-grecaptcha.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-hostedfields-client.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-hostedfieldstateobject-generator.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-hostedfieldtokenizepayload.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-paypal-client.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-paypal-library.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-venmo-client.js.map +1 -1
- package/dist/test/mocks/payment-providers/individual-providers/mock-applepay-datasource-delegate.js.map +1 -1
- package/dist/test/mocks/payment-providers/individual-providers/mock-applepay-handler.js.map +1 -1
- package/dist/test/mocks/payment-providers/individual-providers/mock-creditcard-handler.js.map +1 -1
- package/dist/test/mocks/payment-providers/individual-providers/mock-googlepay-handler.js.map +1 -1
- package/dist/test/mocks/payment-providers/individual-providers/mock-paypal-button-datasource-delegate.js.map +1 -1
- package/dist/test/mocks/payment-providers/individual-providers/mock-paypal-button-datasource.js.map +1 -1
- package/dist/test/mocks/payment-providers/individual-providers/mock-paypal-handler.js.map +1 -1
- package/dist/test/mocks/payment-providers/individual-providers/mock-venmo-handler.js.map +1 -1
- package/dist/test/mocks/payment-providers/mock-payment-providers.js.map +1 -1
- package/dist/test/tests/braintree-manager.test.js.map +1 -1
- package/dist/test/tests/donation-form-controller.test.js +39 -39
- package/dist/test/tests/donation-form-controller.test.js.map +1 -1
- package/dist/test/tests/donation-form.test.js +4 -4
- package/dist/test/tests/donation-form.test.js.map +1 -1
- package/dist/test/tests/flow-handlers/donation-flow-modal-manager.test.js +14 -14
- package/dist/test/tests/flow-handlers/donation-flow-modal-manager.test.js.map +1 -1
- package/dist/test/tests/form-elements/donation-summary.test.js.map +1 -1
- package/dist/test/tests/form-elements/payment-selector.test.js.map +1 -1
- package/dist/test/tests/modals/error-modal-content.test.js +2 -2
- package/dist/test/tests/modals/error-modal-content.test.js.map +1 -1
- package/dist/test/tests/modals/upsell-modal-content.test.js +31 -31
- package/dist/test/tests/modals/upsell-modal-content.test.js.map +1 -1
- package/dist/test/tests/models/donation-payment-info.test.js.map +1 -1
- package/dist/test/tests/payment-clients.test.js.map +1 -1
- package/dist/test/tests/payment-providers/applepay-sessiondatasource.test.js.map +1 -1
- package/dist/test/tests/payment-providers/applepay-sessionmanager.test.js.map +1 -1
- package/dist/test/tests/payment-providers/applepay.test.js.map +1 -1
- package/dist/test/tests/payment-providers/creditcard.test.js.map +1 -1
- package/dist/test/tests/payment-providers/googlepay.test.js.map +1 -1
- package/dist/test/tests/payment-providers/payment-providers.test.js.map +1 -1
- package/dist/test/tests/payment-providers/paypal-button-datasource.test.js.map +1 -1
- package/dist/test/tests/payment-providers/paypal.test.js.map +1 -1
- package/dist/test/tests/payment-providers/venmo.test.js.map +1 -1
- package/dist/test/tests/recaptcha-manager.test.js.map +1 -1
- package/package.json +107 -107
- package/src/@types/analytics-handler/index.d.ts +8 -8
- package/src/@types/braintree-web/LICENSE +21 -21
- package/src/@types/braintree-web/index.d.ts +93 -93
- package/src/@types/braintree-web/modules/american-express.d.ts +50 -50
- package/src/@types/braintree-web/modules/apple-pay.d.ts +213 -213
- package/src/@types/braintree-web/modules/client.d.ts +103 -103
- package/src/@types/braintree-web/modules/core.d.ts +34 -34
- package/src/@types/braintree-web/modules/data-collector.d.ts +13 -13
- package/src/@types/braintree-web/modules/google-payment.d.ts +269 -269
- package/src/@types/braintree-web/modules/hosted-fields.d.ts +366 -366
- package/src/@types/braintree-web/modules/paypal-checkout.d.ts +262 -262
- package/src/@types/braintree-web/modules/paypal.d.ts +177 -177
- package/src/@types/braintree-web/modules/three-d-secure.d.ts +141 -141
- package/src/@types/braintree-web/modules/unionpay.d.ts +224 -224
- package/src/@types/braintree-web/modules/us-bank-account.d.ts +81 -81
- package/src/@types/braintree-web/modules/venmo.d.ts +110 -110
- package/src/@types/braintree-web/package.json +64 -64
- package/src/@types/paypal-checkout-components/LICENSE +21 -21
- package/src/@types/paypal-checkout-components/index.d.ts +67 -67
- package/src/@types/paypal-checkout-components/modules/button.d.ts +50 -50
- package/src/@types/paypal-checkout-components/modules/callback-data.d.ts +244 -244
- package/src/@types/paypal-checkout-components/modules/configuration.d.ts +114 -114
- package/src/@types/paypal-checkout-components/package.json +58 -58
- package/src/braintree-manager/braintree-interfaces.ts +172 -172
- package/src/braintree-manager/braintree-manager.ts +281 -281
- package/src/braintree-manager/payment-clients.ts +146 -146
- package/src/braintree-manager/payment-providers/apple-pay/apple-pay-interface.ts +13 -13
- package/src/braintree-manager/payment-providers/apple-pay/apple-pay-session-datasource-delegate.ts +8 -8
- package/src/braintree-manager/payment-providers/apple-pay/apple-pay-session-datasource-interface.ts +10 -10
- package/src/braintree-manager/payment-providers/apple-pay/apple-pay-session-datasource.ts +119 -119
- package/src/braintree-manager/payment-providers/apple-pay/apple-pay-session-manager.ts +21 -21
- package/src/braintree-manager/payment-providers/apple-pay/apple-pay.ts +97 -97
- package/src/braintree-manager/payment-providers/credit-card/credit-card-interface.ts +21 -21
- package/src/braintree-manager/payment-providers/credit-card/credit-card.ts +130 -130
- package/src/braintree-manager/payment-providers/credit-card/hosted-field-configuration.ts +19 -19
- package/src/braintree-manager/payment-providers/credit-card/hosted-field-container.ts +85 -85
- package/src/braintree-manager/payment-providers/google-pay-interface.ts +8 -8
- package/src/braintree-manager/payment-providers/google-pay.ts +59 -59
- package/src/braintree-manager/payment-providers/paypal/paypal-button-datasource.ts +218 -218
- package/src/braintree-manager/payment-providers/paypal/paypal-interface.ts +13 -13
- package/src/braintree-manager/payment-providers/paypal/paypal.ts +78 -78
- package/src/braintree-manager/payment-providers/venmo-interface.ts +8 -8
- package/src/braintree-manager/payment-providers/venmo.ts +67 -67
- package/src/braintree-manager/payment-providers-interface.ts +25 -25
- package/src/braintree-manager/payment-providers.ts +147 -147
- package/src/donation-form-controller.ts +623 -623
- package/src/donation-form-error.ts +6 -6
- package/src/donation-form.ts +576 -576
- package/src/form-elements/badged-input.ts +109 -109
- package/src/form-elements/contact-form/autocomplete-field-options.ts +63 -63
- package/src/form-elements/contact-form/contact-form.ts +434 -434
- package/src/form-elements/contact-form/countries.ts +252 -252
- package/src/form-elements/header/donation-form-header.ts +98 -98
- package/src/form-elements/header/donation-summary.ts +61 -61
- package/src/form-elements/payment-selector.ts +365 -365
- package/src/form-elements/total-amount.ts +46 -46
- package/src/modals/confirm-donation-modal-content.ts +168 -168
- package/src/modals/error-modal-content.ts +48 -48
- package/src/modals/upsell-modal-content.ts +284 -284
- package/src/payment-flow-handlers/donation-flow-modal-manager.ts +439 -439
- package/src/payment-flow-handlers/handlers/applepay-flow-handler.ts +109 -109
- package/src/payment-flow-handlers/handlers/creditcard-flow-handler.ts +232 -232
- package/src/payment-flow-handlers/handlers/googlepay-flow-handler.ts +111 -111
- package/src/payment-flow-handlers/handlers/paypal-flow-handler.ts +331 -331
- package/src/payment-flow-handlers/handlers/venmo-flow-handler.ts +119 -119
- package/src/payment-flow-handlers/handlers/venmo-restoration-state-handler.ts +127 -127
- package/src/payment-flow-handlers/payment-flow-handlers.ts +218 -218
- package/src/recaptcha-manager/recaptcha-manager.ts +123 -123
- package/src/util/promisedSleep.ts +3 -3
- package/dist/demo/app-root.d.ts +0 -0
- package/dist/demo/app-root.js +0 -2
- package/dist/demo/app-root.js.map +0 -1
|
@@ -1,244 +1,244 @@
|
|
|
1
|
-
export type LineItemKind = 'debit' | 'credit';
|
|
2
|
-
|
|
3
|
-
export interface LineItem {
|
|
4
|
-
/**
|
|
5
|
-
* Number of units of the item purchased. This value must be a whole number and can't be negative or zero.
|
|
6
|
-
*/
|
|
7
|
-
quantity: string;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Per-unit price of the item. Can include up to 2 decimal places. This value can't be negative or zero.
|
|
11
|
-
*/
|
|
12
|
-
unitAmount: string;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Item name. Maximum 127 characters.
|
|
16
|
-
*/
|
|
17
|
-
name: string;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Indicates whether the line item is a debit (sale) or credit (refund) to the customer. Accepted values: `debit` and `credit`.
|
|
21
|
-
*/
|
|
22
|
-
kind: LineItemKind;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Per-unit tax price of the item. Can include up to 2 decimal places. This value can't be negative or zero.
|
|
26
|
-
*/
|
|
27
|
-
unitTaxAmount: string | undefined;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Item description. Maximum 127 characters.
|
|
31
|
-
*/
|
|
32
|
-
description: string | undefined;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Product or UPC code for the item. Maximum 127 characters.
|
|
36
|
-
*/
|
|
37
|
-
productCode: string | undefined;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* The URL to product information.
|
|
41
|
-
*/
|
|
42
|
-
url: string | undefined;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export type ShippingOptionType = 'SHIPPING' | 'PICKUP';
|
|
46
|
-
|
|
47
|
-
export interface CurrencyAmount {
|
|
48
|
-
/**
|
|
49
|
-
* The three-character ISO-4217 currency code. PayPal does not support all currencies.
|
|
50
|
-
*/
|
|
51
|
-
currency: string;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* The amount the shipping option will cost. Includes the specified number of digits after
|
|
55
|
-
* decimal separator for the ISO-4217 currency code.
|
|
56
|
-
*/
|
|
57
|
-
value: string;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface ShippingOption {
|
|
61
|
-
/**
|
|
62
|
-
* A unique ID that identifies a payer-selected shipping option.
|
|
63
|
-
*/
|
|
64
|
-
id: string;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* A description that the payer sees, which helps them choose an appropriate shipping option.
|
|
68
|
-
* For example, `Free Shipping`, `USPS Priority Shipping`, `Expédition prioritaire USPS`,
|
|
69
|
-
* or `USPS yōuxiān fā huò`. Localize this description to the payer's locale.
|
|
70
|
-
*/
|
|
71
|
-
label: string;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* If `selected = true` is specified as part of the API request it represents the shipping
|
|
75
|
-
* option that the payee/merchant expects to be pre-selected for the payer when they first view
|
|
76
|
-
* the shipping options within the PayPal checkout experience. As part of the response if a
|
|
77
|
-
* shipping option has `selected = true` it represents the shipping option that the payer
|
|
78
|
-
* selected during the course of checkout with PayPal. Only 1 `shippingOption` can be set
|
|
79
|
-
* to `selected = true`.
|
|
80
|
-
*/
|
|
81
|
-
selected: boolean;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* The method by which the payer wants to get their items.
|
|
85
|
-
*/
|
|
86
|
-
type: ShippingOptionType;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* The shipping cost for the selected option.
|
|
90
|
-
*/
|
|
91
|
-
amount: CurrencyAmount;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export interface Address {
|
|
95
|
-
/**
|
|
96
|
-
* Street number and name.
|
|
97
|
-
*/
|
|
98
|
-
line1: string;
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Extended address.
|
|
102
|
-
*/
|
|
103
|
-
line2?: string;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* City or locality.
|
|
107
|
-
*/
|
|
108
|
-
city: string;
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* State or region.
|
|
112
|
-
*/
|
|
113
|
-
state: string;
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Postal code.
|
|
117
|
-
*/
|
|
118
|
-
postalCode: string;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* 2 character country code (e.g. US).
|
|
122
|
-
*/
|
|
123
|
-
countryCode: string;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Phone number.
|
|
127
|
-
*/
|
|
128
|
-
phone?: string;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Recipient of postage.
|
|
132
|
-
*/
|
|
133
|
-
recipientName?: string;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export interface CreditFinancingOptions {
|
|
137
|
-
/**
|
|
138
|
-
* This is the estimated total payment amount including interest and fees the user will pay during the lifetime of the loan.
|
|
139
|
-
*/
|
|
140
|
-
totalCost: CurrencyAmount;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Length of financing terms in months.
|
|
144
|
-
*/
|
|
145
|
-
term: number;
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* This is the estimated amount per month that the customer will need to pay including fees and interest.
|
|
149
|
-
*/
|
|
150
|
-
monthlyPayment: CurrencyAmount;
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Estimated interest or fees amount the payer will have to pay during the lifetime of the loan.
|
|
154
|
-
*/
|
|
155
|
-
totalInterest: CurrencyAmount;
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Status of whether the customer ultimately was approved for and chose to make the payment using the approved installment credit.
|
|
159
|
-
*/
|
|
160
|
-
payerAcceptance: boolean;
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Indicates whether the cart amount is editable after payer's acceptance on PayPal side.
|
|
164
|
-
*/
|
|
165
|
-
cartAmountImmutable: boolean;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export interface TokenizePayloadDetails {
|
|
169
|
-
email: string;
|
|
170
|
-
payerId: string;
|
|
171
|
-
firstName: string;
|
|
172
|
-
lastName: string;
|
|
173
|
-
countryCode?: string;
|
|
174
|
-
phone?: string;
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* User's shipping address details, only available if shipping address is enabled.
|
|
178
|
-
*/
|
|
179
|
-
shippingAddress?: Address;
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* User's billing address details.
|
|
183
|
-
*/
|
|
184
|
-
billingAddress?: Address;
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* This property will only be present when the customer pays with PayPal Credit.
|
|
188
|
-
*/
|
|
189
|
-
creditFinancingOffered?: CreditFinancingOptions;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
export interface TokenizePayload {
|
|
193
|
-
/**
|
|
194
|
-
* The payment method nonce.
|
|
195
|
-
*/
|
|
196
|
-
nonce: string;
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* The payment method type, always `PayPalAccount`.
|
|
200
|
-
*/
|
|
201
|
-
type: string;
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Additional PayPal account details.
|
|
205
|
-
*/
|
|
206
|
-
details: TokenizePayloadDetails;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
export type FlowType = 'checkout' | 'vault';
|
|
210
|
-
|
|
211
|
-
export type Intent = 'authorize' | 'order' | 'capture';
|
|
212
|
-
|
|
213
|
-
export interface AuthorizationData {
|
|
214
|
-
payerId: string;
|
|
215
|
-
paymentId?: string;
|
|
216
|
-
billingToken?: string;
|
|
217
|
-
vault?: boolean;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
export interface CancellationData {
|
|
221
|
-
billingID: string;
|
|
222
|
-
button_version: string;
|
|
223
|
-
cancelUrl: string;
|
|
224
|
-
intent: string;
|
|
225
|
-
paymentID: string;
|
|
226
|
-
paymentToken: string;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
export interface AuthorizationTokenizePayload {
|
|
230
|
-
/**
|
|
231
|
-
* The payment method nonce.
|
|
232
|
-
*/
|
|
233
|
-
nonce: string;
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* The payment method type, always `PayPalAccount`.
|
|
237
|
-
*/
|
|
238
|
-
type: string;
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* Additional PayPal account details.
|
|
242
|
-
*/
|
|
243
|
-
details: TokenizePayloadDetails;
|
|
244
|
-
}
|
|
1
|
+
export type LineItemKind = 'debit' | 'credit';
|
|
2
|
+
|
|
3
|
+
export interface LineItem {
|
|
4
|
+
/**
|
|
5
|
+
* Number of units of the item purchased. This value must be a whole number and can't be negative or zero.
|
|
6
|
+
*/
|
|
7
|
+
quantity: string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Per-unit price of the item. Can include up to 2 decimal places. This value can't be negative or zero.
|
|
11
|
+
*/
|
|
12
|
+
unitAmount: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Item name. Maximum 127 characters.
|
|
16
|
+
*/
|
|
17
|
+
name: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Indicates whether the line item is a debit (sale) or credit (refund) to the customer. Accepted values: `debit` and `credit`.
|
|
21
|
+
*/
|
|
22
|
+
kind: LineItemKind;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Per-unit tax price of the item. Can include up to 2 decimal places. This value can't be negative or zero.
|
|
26
|
+
*/
|
|
27
|
+
unitTaxAmount: string | undefined;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Item description. Maximum 127 characters.
|
|
31
|
+
*/
|
|
32
|
+
description: string | undefined;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Product or UPC code for the item. Maximum 127 characters.
|
|
36
|
+
*/
|
|
37
|
+
productCode: string | undefined;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The URL to product information.
|
|
41
|
+
*/
|
|
42
|
+
url: string | undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type ShippingOptionType = 'SHIPPING' | 'PICKUP';
|
|
46
|
+
|
|
47
|
+
export interface CurrencyAmount {
|
|
48
|
+
/**
|
|
49
|
+
* The three-character ISO-4217 currency code. PayPal does not support all currencies.
|
|
50
|
+
*/
|
|
51
|
+
currency: string;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The amount the shipping option will cost. Includes the specified number of digits after
|
|
55
|
+
* decimal separator for the ISO-4217 currency code.
|
|
56
|
+
*/
|
|
57
|
+
value: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface ShippingOption {
|
|
61
|
+
/**
|
|
62
|
+
* A unique ID that identifies a payer-selected shipping option.
|
|
63
|
+
*/
|
|
64
|
+
id: string;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* A description that the payer sees, which helps them choose an appropriate shipping option.
|
|
68
|
+
* For example, `Free Shipping`, `USPS Priority Shipping`, `Expédition prioritaire USPS`,
|
|
69
|
+
* or `USPS yōuxiān fā huò`. Localize this description to the payer's locale.
|
|
70
|
+
*/
|
|
71
|
+
label: string;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* If `selected = true` is specified as part of the API request it represents the shipping
|
|
75
|
+
* option that the payee/merchant expects to be pre-selected for the payer when they first view
|
|
76
|
+
* the shipping options within the PayPal checkout experience. As part of the response if a
|
|
77
|
+
* shipping option has `selected = true` it represents the shipping option that the payer
|
|
78
|
+
* selected during the course of checkout with PayPal. Only 1 `shippingOption` can be set
|
|
79
|
+
* to `selected = true`.
|
|
80
|
+
*/
|
|
81
|
+
selected: boolean;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The method by which the payer wants to get their items.
|
|
85
|
+
*/
|
|
86
|
+
type: ShippingOptionType;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The shipping cost for the selected option.
|
|
90
|
+
*/
|
|
91
|
+
amount: CurrencyAmount;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface Address {
|
|
95
|
+
/**
|
|
96
|
+
* Street number and name.
|
|
97
|
+
*/
|
|
98
|
+
line1: string;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Extended address.
|
|
102
|
+
*/
|
|
103
|
+
line2?: string;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* City or locality.
|
|
107
|
+
*/
|
|
108
|
+
city: string;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* State or region.
|
|
112
|
+
*/
|
|
113
|
+
state: string;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Postal code.
|
|
117
|
+
*/
|
|
118
|
+
postalCode: string;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* 2 character country code (e.g. US).
|
|
122
|
+
*/
|
|
123
|
+
countryCode: string;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Phone number.
|
|
127
|
+
*/
|
|
128
|
+
phone?: string;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Recipient of postage.
|
|
132
|
+
*/
|
|
133
|
+
recipientName?: string;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface CreditFinancingOptions {
|
|
137
|
+
/**
|
|
138
|
+
* This is the estimated total payment amount including interest and fees the user will pay during the lifetime of the loan.
|
|
139
|
+
*/
|
|
140
|
+
totalCost: CurrencyAmount;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Length of financing terms in months.
|
|
144
|
+
*/
|
|
145
|
+
term: number;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* This is the estimated amount per month that the customer will need to pay including fees and interest.
|
|
149
|
+
*/
|
|
150
|
+
monthlyPayment: CurrencyAmount;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Estimated interest or fees amount the payer will have to pay during the lifetime of the loan.
|
|
154
|
+
*/
|
|
155
|
+
totalInterest: CurrencyAmount;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Status of whether the customer ultimately was approved for and chose to make the payment using the approved installment credit.
|
|
159
|
+
*/
|
|
160
|
+
payerAcceptance: boolean;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Indicates whether the cart amount is editable after payer's acceptance on PayPal side.
|
|
164
|
+
*/
|
|
165
|
+
cartAmountImmutable: boolean;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface TokenizePayloadDetails {
|
|
169
|
+
email: string;
|
|
170
|
+
payerId: string;
|
|
171
|
+
firstName: string;
|
|
172
|
+
lastName: string;
|
|
173
|
+
countryCode?: string;
|
|
174
|
+
phone?: string;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* User's shipping address details, only available if shipping address is enabled.
|
|
178
|
+
*/
|
|
179
|
+
shippingAddress?: Address;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* User's billing address details.
|
|
183
|
+
*/
|
|
184
|
+
billingAddress?: Address;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* This property will only be present when the customer pays with PayPal Credit.
|
|
188
|
+
*/
|
|
189
|
+
creditFinancingOffered?: CreditFinancingOptions;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface TokenizePayload {
|
|
193
|
+
/**
|
|
194
|
+
* The payment method nonce.
|
|
195
|
+
*/
|
|
196
|
+
nonce: string;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* The payment method type, always `PayPalAccount`.
|
|
200
|
+
*/
|
|
201
|
+
type: string;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Additional PayPal account details.
|
|
205
|
+
*/
|
|
206
|
+
details: TokenizePayloadDetails;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export type FlowType = 'checkout' | 'vault';
|
|
210
|
+
|
|
211
|
+
export type Intent = 'authorize' | 'order' | 'capture';
|
|
212
|
+
|
|
213
|
+
export interface AuthorizationData {
|
|
214
|
+
payerId: string;
|
|
215
|
+
paymentId?: string;
|
|
216
|
+
billingToken?: string;
|
|
217
|
+
vault?: boolean;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export interface CancellationData {
|
|
221
|
+
billingID: string;
|
|
222
|
+
button_version: string;
|
|
223
|
+
cancelUrl: string;
|
|
224
|
+
intent: string;
|
|
225
|
+
paymentID: string;
|
|
226
|
+
paymentToken: string;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export interface AuthorizationTokenizePayload {
|
|
230
|
+
/**
|
|
231
|
+
* The payment method nonce.
|
|
232
|
+
*/
|
|
233
|
+
nonce: string;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* The payment method type, always `PayPalAccount`.
|
|
237
|
+
*/
|
|
238
|
+
type: string;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Additional PayPal account details.
|
|
242
|
+
*/
|
|
243
|
+
details: TokenizePayloadDetails;
|
|
244
|
+
}
|