@internetarchive/donation-form 0.5.17 → 0.5.18-alpha.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.d.ts +9 -9
- package/dist/demo/braintree-endpoint-manager.js +45 -45
- package/dist/demo/braintree-endpoint-manager.js.map +1 -1
- package/dist/demo/demo-analytics-handler.d.ts +17 -17
- package/dist/demo/demo-analytics-handler.js +13 -13
- package/dist/demo/demo-analytics-handler.js.map +1 -1
- package/dist/demo/submit-form-with.d.ts +7 -7
- package/dist/demo/submit-form-with.js +21 -21
- package/dist/demo/submit-form-with.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/src/braintree-manager/braintree-interfaces.d.ts +147 -147
- package/dist/src/braintree-manager/braintree-interfaces.js +5 -5
- package/dist/src/braintree-manager/braintree-interfaces.js.map +1 -1
- package/dist/src/braintree-manager/braintree-manager.d.ts +124 -124
- package/dist/src/braintree-manager/braintree-manager.js +149 -149
- package/dist/src/braintree-manager/braintree-manager.js.map +1 -1
- package/dist/src/braintree-manager/payment-clients.d.ts +47 -47
- package/dist/src/braintree-manager/payment-clients.js +116 -116
- package/dist/src/braintree-manager/payment-clients.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/apple-pay/apple-pay-interface.d.ts +8 -8
- 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.d.ts +6 -6
- 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.d.ts +10 -10
- 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.d.ts +21 -21
- package/dist/src/braintree-manager/payment-providers/apple-pay/apple-pay-session-datasource.js +99 -99
- 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.d.ts +10 -10
- package/dist/src/braintree-manager/payment-providers/apple-pay/apple-pay-session-manager.js +12 -12
- 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.d.ts +20 -20
- package/dist/src/braintree-manager/payment-providers/apple-pay/apple-pay.js +71 -71
- 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.d.ts +16 -16
- 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.d.ts +29 -29
- package/dist/src/braintree-manager/payment-providers/credit-card/credit-card.js +99 -99
- 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.d.ts +11 -11
- package/dist/src/braintree-manager/payment-providers/credit-card/hosted-field-configuration.js +7 -7
- 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.d.ts +34 -34
- package/dist/src/braintree-manager/payment-providers/credit-card/hosted-field-container.js +52 -52
- 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.d.ts +7 -7
- package/dist/src/braintree-manager/payment-providers/google-pay-interface.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/google-pay.d.ts +18 -18
- package/dist/src/braintree-manager/payment-providers/google-pay.js +40 -40
- package/dist/src/braintree-manager/payment-providers/google-pay.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/paypal/paypal-button-datasource.d.ts +145 -145
- package/dist/src/braintree-manager/payment-providers/paypal/paypal-button-datasource.js +60 -60
- 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.d.ts +11 -11
- package/dist/src/braintree-manager/payment-providers/paypal/paypal-interface.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/paypal/paypal.d.ts +23 -23
- package/dist/src/braintree-manager/payment-providers/paypal/paypal.js +46 -46
- package/dist/src/braintree-manager/payment-providers/paypal/paypal.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/venmo-interface.d.ts +6 -6
- package/dist/src/braintree-manager/payment-providers/venmo-interface.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers/venmo.d.ts +28 -28
- package/dist/src/braintree-manager/payment-providers/venmo.js +50 -50
- package/dist/src/braintree-manager/payment-providers/venmo.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers-interface.d.ts +16 -16
- package/dist/src/braintree-manager/payment-providers-interface.js.map +1 -1
- package/dist/src/braintree-manager/payment-providers.d.ts +45 -45
- package/dist/src/braintree-manager/payment-providers.js +105 -105
- package/dist/src/braintree-manager/payment-providers.js.map +1 -1
- package/dist/src/donation-form-controller.d.ts +116 -116
- package/dist/src/donation-form-controller.js +562 -562
- package/dist/src/donation-form-controller.js.map +1 -1
- package/dist/src/donation-form-error.d.ts +3 -3
- package/dist/src/donation-form-error.js +6 -6
- package/dist/src/donation-form-error.js.map +1 -1
- package/dist/src/donation-form.d.ts +120 -120
- package/dist/src/donation-form.js +530 -530
- package/dist/src/donation-form.js.map +1 -1
- package/dist/src/form-elements/badged-input.d.ts +32 -32
- package/dist/src/form-elements/badged-input.js +124 -124
- package/dist/src/form-elements/badged-input.js.map +1 -1
- package/dist/src/form-elements/contact-form/autocomplete-field-options.d.ts +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.d.ts +53 -53
- package/dist/src/form-elements/contact-form/contact-form.js +428 -428
- package/dist/src/form-elements/contact-form/contact-form.js.map +1 -1
- package/dist/src/form-elements/contact-form/countries.d.ts +3 -3
- package/dist/src/form-elements/contact-form/countries.js +252 -252
- package/dist/src/form-elements/contact-form/countries.js.map +1 -1
- package/dist/src/form-elements/header/donation-form-header.d.ts +27 -27
- package/dist/src/form-elements/header/donation-form-header.js +97 -97
- package/dist/src/form-elements/header/donation-form-header.js.map +1 -1
- package/dist/src/form-elements/header/donation-summary.d.ts +11 -11
- package/dist/src/form-elements/header/donation-summary.js +57 -57
- package/dist/src/form-elements/header/donation-summary.js.map +1 -1
- package/dist/src/form-elements/payment-selector.d.ts +25 -25
- package/dist/src/form-elements/payment-selector.js +286 -286
- package/dist/src/form-elements/payment-selector.js.map +1 -1
- package/dist/src/form-elements/total-amount.d.ts +8 -8
- package/dist/src/form-elements/total-amount.js +47 -47
- package/dist/src/form-elements/total-amount.js.map +1 -1
- package/dist/src/modals/confirm-donation-modal-content.d.ts +31 -31
- package/dist/src/modals/confirm-donation-modal-content.js +168 -168
- package/dist/src/modals/confirm-donation-modal-content.js.map +1 -1
- package/dist/src/modals/error-modal-content.d.ts +14 -14
- package/dist/src/modals/error-modal-content.js +49 -49
- package/dist/src/modals/error-modal-content.js.map +1 -1
- package/dist/src/modals/upsell-modal-content.d.ts +32 -32
- package/dist/src/modals/upsell-modal-content.js +294 -294
- package/dist/src/modals/upsell-modal-content.js.map +1 -1
- package/dist/src/payment-flow-handlers/donation-flow-modal-manager.d.ts +181 -181
- package/dist/src/payment-flow-handlers/donation-flow-modal-manager.js +252 -252
- package/dist/src/payment-flow-handlers/donation-flow-modal-manager.js.map +1 -1
- package/dist/src/payment-flow-handlers/handlers/applepay-flow-handler.d.ts +21 -21
- package/dist/src/payment-flow-handlers/handlers/applepay-flow-handler.js +76 -76
- package/dist/src/payment-flow-handlers/handlers/applepay-flow-handler.js.map +1 -1
- package/dist/src/payment-flow-handlers/handlers/creditcard-flow-handler.d.ts +70 -70
- package/dist/src/payment-flow-handlers/handlers/creditcard-flow-handler.js +140 -140
- package/dist/src/payment-flow-handlers/handlers/creditcard-flow-handler.js.map +1 -1
- package/dist/src/payment-flow-handlers/handlers/googlepay-flow-handler.d.ts +22 -22
- package/dist/src/payment-flow-handlers/handlers/googlepay-flow-handler.js +74 -74
- package/dist/src/payment-flow-handlers/handlers/googlepay-flow-handler.js.map +1 -1
- package/dist/src/payment-flow-handlers/handlers/paypal-flow-handler.d.ts +52 -52
- package/dist/src/payment-flow-handlers/handlers/paypal-flow-handler.js +239 -239
- package/dist/src/payment-flow-handlers/handlers/paypal-flow-handler.js.map +1 -1
- package/dist/src/payment-flow-handlers/handlers/venmo-flow-handler.d.ts +30 -30
- package/dist/src/payment-flow-handlers/handlers/venmo-flow-handler.js +89 -89
- 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.d.ts +75 -75
- package/dist/src/payment-flow-handlers/handlers/venmo-restoration-state-handler.js +94 -94
- package/dist/src/payment-flow-handlers/handlers/venmo-restoration-state-handler.js.map +1 -1
- package/dist/src/payment-flow-handlers/payment-flow-handlers.d.ts +111 -111
- package/dist/src/payment-flow-handlers/payment-flow-handlers.js +107 -107
- package/dist/src/payment-flow-handlers/payment-flow-handlers.js.map +1 -1
- package/dist/src/recaptcha-manager/recaptcha-manager.d.ts +48 -48
- package/dist/src/recaptcha-manager/recaptcha-manager.js +88 -88
- package/dist/src/recaptcha-manager/recaptcha-manager.js.map +1 -1
- package/dist/src/util/promisedSleep.d.ts +1 -1
- package/dist/src/util/promisedSleep.js +3 -3
- package/dist/src/util/promisedSleep.js.map +1 -1
- package/dist/test/helpers/fillInContactForm.d.ts +2 -2
- package/dist/test/helpers/fillInContactForm.js +19 -19
- package/dist/test/helpers/fillInContactForm.js.map +1 -1
- package/dist/test/mocks/flow-handlers/individual-handlers/mock-applepay-flow-handler.d.ts +7 -7
- package/dist/test/mocks/flow-handlers/individual-handlers/mock-applepay-flow-handler.js +9 -9
- 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.d.ts +15 -15
- package/dist/test/mocks/flow-handlers/individual-handlers/mock-creditcard-flow-handler.js +32 -32
- 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.d.ts +9 -9
- package/dist/test/mocks/flow-handlers/individual-handlers/mock-googlepay-flow-handler.js +15 -15
- 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.d.ts +15 -15
- package/dist/test/mocks/flow-handlers/individual-handlers/mock-paypal-flow-handler.js +30 -30
- 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.d.ts +9 -9
- package/dist/test/mocks/flow-handlers/individual-handlers/mock-venmo-flow-handler.js +17 -17
- 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.d.ts +30 -30
- package/dist/test/mocks/flow-handlers/mock-payment-flow-handlers.js +29 -29
- package/dist/test/mocks/flow-handlers/mock-payment-flow-handlers.js.map +1 -1
- package/dist/test/mocks/mock-braintree-manager.d.ts +45 -45
- package/dist/test/mocks/mock-braintree-manager.js +71 -71
- package/dist/test/mocks/mock-braintree-manager.js.map +1 -1
- package/dist/test/mocks/mock-donation-info.d.ts +4 -4
- package/dist/test/mocks/mock-donation-info.js +10 -10
- package/dist/test/mocks/mock-donation-info.js.map +1 -1
- package/dist/test/mocks/mock-endpoint-manager.d.ts +12 -12
- package/dist/test/mocks/mock-endpoint-manager.js +19 -19
- package/dist/test/mocks/mock-endpoint-manager.js.map +1 -1
- package/dist/test/mocks/mock-hosted-fields-config.d.ts +4 -4
- package/dist/test/mocks/mock-hosted-fields-config.js +37 -37
- package/dist/test/mocks/mock-hosted-fields-config.js.map +1 -1
- package/dist/test/mocks/mock-hosted-fields-container.d.ts +13 -13
- package/dist/test/mocks/mock-hosted-fields-container.js +27 -27
- package/dist/test/mocks/mock-hosted-fields-container.js.map +1 -1
- package/dist/test/mocks/mock-lazy-loader.d.ts +15 -15
- package/dist/test/mocks/mock-lazy-loader.js +20 -20
- package/dist/test/mocks/mock-lazy-loader.js.map +1 -1
- package/dist/test/mocks/mock-modal-manager.d.ts +17 -17
- package/dist/test/mocks/mock-modal-manager.js +26 -26
- package/dist/test/mocks/mock-modal-manager.js.map +1 -1
- package/dist/test/mocks/mock-payment-clients.d.ts +29 -29
- package/dist/test/mocks/mock-payment-clients.js +78 -78
- package/dist/test/mocks/mock-payment-clients.js.map +1 -1
- package/dist/test/mocks/mock-paypal-button-renderer.d.ts +5 -5
- package/dist/test/mocks/mock-paypal-button-renderer.js +6 -6
- package/dist/test/mocks/mock-paypal-button-renderer.js.map +1 -1
- package/dist/test/mocks/mock-recaptcha-manager.d.ts +7 -7
- package/dist/test/mocks/mock-recaptcha-manager.js +14 -14
- package/dist/test/mocks/mock-recaptcha-manager.js.map +1 -1
- package/dist/test/mocks/models/mock-billing-info.d.ts +2 -2
- package/dist/test/mocks/models/mock-billing-info.js +9 -9
- package/dist/test/mocks/models/mock-billing-info.js.map +1 -1
- package/dist/test/mocks/models/mock-custom-fields.d.ts +2 -2
- package/dist/test/mocks/models/mock-custom-fields.js +7 -7
- package/dist/test/mocks/models/mock-custom-fields.js.map +1 -1
- package/dist/test/mocks/models/mock-customer-info.d.ts +2 -2
- package/dist/test/mocks/models/mock-customer-info.js +6 -6
- package/dist/test/mocks/models/mock-customer-info.js.map +1 -1
- package/dist/test/mocks/models/mock-donation-request.d.ts +2 -2
- package/dist/test/mocks/models/mock-donation-request.js +18 -18
- package/dist/test/mocks/models/mock-donation-request.js.map +1 -1
- package/dist/test/mocks/models/mock-success-response.d.ts +2 -2
- package/dist/test/mocks/models/mock-success-response.js +14 -14
- package/dist/test/mocks/models/mock-success-response.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-applepay-client.d.ts +21 -21
- package/dist/test/mocks/payment-clients/mock-applepay-client.js +72 -72
- package/dist/test/mocks/payment-clients/mock-applepay-client.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-applepay-payment.d.ts +6 -6
- package/dist/test/mocks/payment-clients/mock-applepay-payment.js +42 -42
- package/dist/test/mocks/payment-clients/mock-applepay-payment.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-applepay-paymentauthorizedevent.d.ts +22 -22
- package/dist/test/mocks/payment-clients/mock-applepay-paymentauthorizedevent.js +35 -35
- package/dist/test/mocks/payment-clients/mock-applepay-paymentauthorizedevent.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-applepay-session.d.ts +30 -30
- package/dist/test/mocks/payment-clients/mock-applepay-session.js +52 -52
- package/dist/test/mocks/payment-clients/mock-applepay-session.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-applepay-sessionmanager.d.ts +10 -10
- package/dist/test/mocks/payment-clients/mock-applepay-sessionmanager.js +12 -12
- package/dist/test/mocks/payment-clients/mock-applepay-sessionmanager.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-applepay-validatemerchantevent.d.ts +22 -22
- package/dist/test/mocks/payment-clients/mock-applepay-validatemerchantevent.js +34 -34
- package/dist/test/mocks/payment-clients/mock-applepay-validatemerchantevent.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-braintree-client.d.ts +14 -14
- package/dist/test/mocks/payment-clients/mock-braintree-client.js +19 -19
- package/dist/test/mocks/payment-clients/mock-braintree-client.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-data-collector.d.ts +11 -11
- package/dist/test/mocks/payment-clients/mock-data-collector.js +17 -17
- package/dist/test/mocks/payment-clients/mock-data-collector.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-googlepay-client.d.ts +22 -22
- package/dist/test/mocks/payment-clients/mock-googlepay-client.js +42 -42
- package/dist/test/mocks/payment-clients/mock-googlepay-client.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-googlepay-library.d.ts +10 -10
- package/dist/test/mocks/payment-clients/mock-googlepay-library.js +22 -22
- package/dist/test/mocks/payment-clients/mock-googlepay-library.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-grecaptcha.d.ts +23 -23
- package/dist/test/mocks/payment-clients/mock-grecaptcha.js +62 -62
- package/dist/test/mocks/payment-clients/mock-grecaptcha.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-hostedfields-client.d.ts +33 -33
- package/dist/test/mocks/payment-clients/mock-hostedfields-client.js +54 -54
- package/dist/test/mocks/payment-clients/mock-hostedfields-client.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-hostedfieldstateobject-generator.d.ts +1 -1
- package/dist/test/mocks/payment-clients/mock-hostedfieldstateobject-generator.js +50 -50
- package/dist/test/mocks/payment-clients/mock-hostedfieldstateobject-generator.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-hostedfieldtokenizepayload.d.ts +1 -1
- package/dist/test/mocks/payment-clients/mock-hostedfieldtokenizepayload.js +13 -13
- package/dist/test/mocks/payment-clients/mock-hostedfieldtokenizepayload.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-paypal-client.d.ts +23 -23
- package/dist/test/mocks/payment-clients/mock-paypal-client.js +62 -62
- package/dist/test/mocks/payment-clients/mock-paypal-client.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-paypal-library.d.ts +4 -4
- package/dist/test/mocks/payment-clients/mock-paypal-library.js +9 -9
- package/dist/test/mocks/payment-clients/mock-paypal-library.js.map +1 -1
- package/dist/test/mocks/payment-clients/mock-venmo-client.d.ts +22 -22
- package/dist/test/mocks/payment-clients/mock-venmo-client.js +36 -36
- 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.d.ts +10 -10
- package/dist/test/mocks/payment-providers/individual-providers/mock-applepay-datasource-delegate.js +14 -14
- 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.d.ts +9 -9
- package/dist/test/mocks/payment-providers/individual-providers/mock-applepay-handler.js +19 -19
- 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.d.ts +18 -18
- package/dist/test/mocks/payment-providers/individual-providers/mock-creditcard-handler.js +41 -41
- 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.d.ts +8 -8
- package/dist/test/mocks/payment-providers/individual-providers/mock-googlepay-handler.js +16 -16
- 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.d.ts +28 -28
- package/dist/test/mocks/payment-providers/individual-providers/mock-paypal-button-datasource-delegate.js +52 -52
- 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.d.ts +11 -11
- package/dist/test/mocks/payment-providers/individual-providers/mock-paypal-button-datasource.js +37 -37
- 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.d.ts +12 -12
- package/dist/test/mocks/payment-providers/individual-providers/mock-paypal-handler.js +15 -15
- 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.d.ts +7 -7
- package/dist/test/mocks/payment-providers/individual-providers/mock-venmo-handler.js +22 -22
- package/dist/test/mocks/payment-providers/individual-providers/mock-venmo-handler.js.map +1 -1
- package/dist/test/mocks/payment-providers/mock-payment-providers.d.ts +21 -21
- package/dist/test/mocks/payment-providers/mock-payment-providers.js +45 -45
- package/dist/test/mocks/payment-providers/mock-payment-providers.js.map +1 -1
- package/dist/test/tests/braintree-manager.test.d.ts +1 -1
- package/dist/test/tests/braintree-manager.test.js +166 -166
- package/dist/test/tests/braintree-manager.test.js.map +1 -1
- package/dist/test/tests/donation-form-controller.test.d.ts +1 -1
- package/dist/test/tests/donation-form-controller.test.js +188 -188
- package/dist/test/tests/donation-form-controller.test.js.map +1 -1
- package/dist/test/tests/donation-form.test.d.ts +1 -1
- package/dist/test/tests/donation-form.test.js +109 -109
- package/dist/test/tests/donation-form.test.js.map +1 -1
- package/dist/test/tests/flow-handlers/donation-flow-modal-manager.test.d.ts +1 -1
- package/dist/test/tests/flow-handlers/donation-flow-modal-manager.test.js +216 -216
- package/dist/test/tests/flow-handlers/donation-flow-modal-manager.test.js.map +1 -1
- package/dist/test/tests/form-elements/donation-summary.test.d.ts +1 -1
- package/dist/test/tests/form-elements/donation-summary.test.js +36 -36
- package/dist/test/tests/form-elements/donation-summary.test.js.map +1 -1
- package/dist/test/tests/form-elements/payment-selector.test.d.ts +1 -1
- package/dist/test/tests/form-elements/payment-selector.test.js +69 -69
- package/dist/test/tests/form-elements/payment-selector.test.js.map +1 -1
- package/dist/test/tests/modals/error-modal-content.test.d.ts +1 -1
- package/dist/test/tests/modals/error-modal-content.test.js +14 -14
- package/dist/test/tests/modals/error-modal-content.test.js.map +1 -1
- package/dist/test/tests/modals/upsell-modal-content.test.d.ts +1 -1
- package/dist/test/tests/modals/upsell-modal-content.test.js +163 -163
- package/dist/test/tests/modals/upsell-modal-content.test.js.map +1 -1
- package/dist/test/tests/models/donation-payment-info.test.d.ts +1 -1
- package/dist/test/tests/models/donation-payment-info.test.js +74 -74
- package/dist/test/tests/models/donation-payment-info.test.js.map +1 -1
- package/dist/test/tests/payment-clients.test.d.ts +1 -1
- package/dist/test/tests/payment-clients.test.js +130 -130
- package/dist/test/tests/payment-clients.test.js.map +1 -1
- package/dist/test/tests/payment-providers/applepay-sessiondatasource.test.d.ts +1 -1
- package/dist/test/tests/payment-providers/applepay-sessiondatasource.test.js +160 -160
- package/dist/test/tests/payment-providers/applepay-sessiondatasource.test.js.map +1 -1
- package/dist/test/tests/payment-providers/applepay-sessionmanager.test.d.ts +1 -1
- package/dist/test/tests/payment-providers/applepay-sessionmanager.test.js +36 -36
- package/dist/test/tests/payment-providers/applepay-sessionmanager.test.js.map +1 -1
- package/dist/test/tests/payment-providers/applepay.test.d.ts +1 -1
- package/dist/test/tests/payment-providers/applepay.test.js +78 -78
- package/dist/test/tests/payment-providers/applepay.test.js.map +1 -1
- package/dist/test/tests/payment-providers/creditcard.test.d.ts +1 -1
- package/dist/test/tests/payment-providers/creditcard.test.js +190 -190
- package/dist/test/tests/payment-providers/creditcard.test.js.map +1 -1
- package/dist/test/tests/payment-providers/googlepay.test.d.ts +1 -1
- package/dist/test/tests/payment-providers/googlepay.test.js +48 -48
- package/dist/test/tests/payment-providers/googlepay.test.js.map +1 -1
- package/dist/test/tests/payment-providers/payment-providers.test.d.ts +1 -1
- package/dist/test/tests/payment-providers/payment-providers.test.js +38 -38
- package/dist/test/tests/payment-providers/payment-providers.test.js.map +1 -1
- package/dist/test/tests/payment-providers/paypal-button-datasource.test.d.ts +1 -1
- package/dist/test/tests/payment-providers/paypal-button-datasource.test.js +162 -162
- package/dist/test/tests/payment-providers/paypal-button-datasource.test.js.map +1 -1
- package/dist/test/tests/payment-providers/paypal.test.d.ts +1 -1
- package/dist/test/tests/payment-providers/paypal.test.js +38 -38
- package/dist/test/tests/payment-providers/paypal.test.js.map +1 -1
- package/dist/test/tests/payment-providers/venmo.test.d.ts +1 -1
- package/dist/test/tests/payment-providers/venmo.test.js +77 -77
- package/dist/test/tests/payment-providers/venmo.test.js.map +1 -1
- package/dist/test/tests/recaptcha-manager.test.d.ts +1 -1
- package/dist/test/tests/recaptcha-manager.test.js +70 -70
- package/dist/test/tests/recaptcha-manager.test.js.map +1 -1
- package/package.json +101 -101
- 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 +283 -283
- package/src/braintree-manager/payment-clients.ts +148 -148
- 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 +98 -98
- 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 +619 -619
- package/src/donation-form-error.ts +6 -6
- package/src/donation-form.ts +566 -566
- package/src/form-elements/badged-input.ts +113 -113
- package/src/form-elements/contact-form/autocomplete-field-options.ts +63 -63
- package/src/form-elements/contact-form/contact-form.ts +427 -427
- package/src/form-elements/contact-form/countries.ts +252 -252
- package/src/form-elements/header/donation-form-header.ts +100 -100
- package/src/form-elements/header/donation-summary.ts +61 -61
- package/src/form-elements/payment-selector.ts +293 -293
- package/src/form-elements/total-amount.ts +46 -46
- package/src/modals/confirm-donation-modal-content.ts +160 -160
- package/src/modals/error-modal-content.ts +48 -48
- package/src/modals/upsell-modal-content.ts +294 -294
- package/src/payment-flow-handlers/donation-flow-modal-manager.ts +450 -450
- package/src/payment-flow-handlers/handlers/applepay-flow-handler.ts +108 -108
- package/src/payment-flow-handlers/handlers/creditcard-flow-handler.ts +231 -231
- package/src/payment-flow-handlers/handlers/googlepay-flow-handler.ts +113 -113
- package/src/payment-flow-handlers/handlers/paypal-flow-handler.ts +332 -332
- package/src/payment-flow-handlers/handlers/venmo-flow-handler.ts +118 -118
- 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/test/mocks/mock-analytics-handler.d.ts +0 -8
- package/dist/test/mocks/mock-analytics-handler.js +0 -10
- package/dist/test/mocks/mock-analytics-handler.js.map +0 -1
|
@@ -1,213 +1,213 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { callback } from './core';
|
|
3
|
-
import { Client } from './client';
|
|
4
|
-
|
|
5
|
-
// more info https://developer.apple.com/reference/applepayjs/1916082-applepay_js_data_types/paymentrequest
|
|
6
|
-
|
|
7
|
-
// billingContact
|
|
8
|
-
// Billing contact information for the user.
|
|
9
|
-
// countryCode
|
|
10
|
-
// Required.The merchant’s two- letter ISO 3166 country code.
|
|
11
|
-
// currencyCode
|
|
12
|
-
// Required.The three- letter ISO 4217 currency code for the payment.
|
|
13
|
-
// lineItems
|
|
14
|
-
// A set of line items that explain recurring payments and additional charges.
|
|
15
|
-
// merchantCapabilities
|
|
16
|
-
// Required.The payment capabilities supported by the merchant.The value must be one or more of supports3DS, supportsEMV, supportsCredit, or supportsDebit.
|
|
17
|
-
// requiredBillingContactFields
|
|
18
|
-
// The billing information that is required from the user.The value must be one or more of postalAddress, phone, email, or name.
|
|
19
|
-
// requiredShippingContactFields
|
|
20
|
-
// The shipping information that is required from the user.The value must be one or more of postalAddress, phone, email, or name.
|
|
21
|
-
// shippingContact
|
|
22
|
-
// Shipping contact information for the user.
|
|
23
|
-
// shippingMethods
|
|
24
|
-
// A set of available shipping methods.Totals for all shipping methods must be non- negative to pass validation.
|
|
25
|
-
// shippingType
|
|
26
|
-
// How the items are to be shipped.This property is optional.If specified, it must be one or more of shipping, delivery, storePickup, or servicePickup.The default value is shipping.
|
|
27
|
-
// supportedNetworks
|
|
28
|
-
// Required.The payment networks supported by the merchant.The value must be one or more of amex, discover, interac, masterCard, privateLabel, or visa.
|
|
29
|
-
// total
|
|
30
|
-
// Required.The total amount for the payment.The total must be greater than zero and have a label to pass validation.
|
|
31
|
-
export interface ApplePayPaymentRequest {
|
|
32
|
-
total: {
|
|
33
|
-
label: string;
|
|
34
|
-
amount: string;
|
|
35
|
-
};
|
|
36
|
-
countryCode: string;
|
|
37
|
-
currencyCode: string;
|
|
38
|
-
supportedNetworks: string[];
|
|
39
|
-
merchantCapabilities: string[];
|
|
40
|
-
|
|
41
|
-
billingContact?: any;
|
|
42
|
-
shippingContact?: any;
|
|
43
|
-
shippingMethods?: any;
|
|
44
|
-
shippingType?: any;
|
|
45
|
-
requiredBillingContactFields?: any;
|
|
46
|
-
requiredShippingContactFields?: any;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export enum ApplePayStatusCodes {
|
|
50
|
-
// The requested action succeeded.
|
|
51
|
-
STATUS_SUCCESS = 1,
|
|
52
|
-
// The requested action failed.
|
|
53
|
-
STATUS_FAILURE,
|
|
54
|
-
// The billing address is not valid.
|
|
55
|
-
STATUS_INVALID_BILLING_POSTAL_ADDRESS,
|
|
56
|
-
// The shipping address is not valid.
|
|
57
|
-
STATUS_INVALID_SHIPPING_POSTAL_ADDRESS,
|
|
58
|
-
// The shipping contact information is not valid.
|
|
59
|
-
STATUS_INVALID_SHIPPING_CONTACT,
|
|
60
|
-
// The required PIN information was not provided. Cards on the China Union Pay payment network may require a PIN to authenticate the transaction.
|
|
61
|
-
STATUS_PIN_REQUIRED,
|
|
62
|
-
// The PIN information is not valid.Cards on the China Union Pay network may require a PIN.
|
|
63
|
-
STATUS_PIN_INCORRECT,
|
|
64
|
-
// The maximum number of tries for a PIN has been reached and the user has been locked out. Cards on the China Union Pay network may require a PIN.
|
|
65
|
-
STATUS_PIN_LOCKOUT,
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export interface ApplePayPayload {
|
|
69
|
-
merchantIdentifier: string;
|
|
70
|
-
domainName: string;
|
|
71
|
-
displayName: string;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export class ApplePaySession {
|
|
75
|
-
constructor(version: number, request: ApplePayPaymentRequest);
|
|
76
|
-
|
|
77
|
-
canMakePayments(): boolean;
|
|
78
|
-
|
|
79
|
-
canMakePaymentsWithActiveCard(merchantIdentifier: string): boolean;
|
|
80
|
-
|
|
81
|
-
completeMerchantValidation(merchantSession: any): void;
|
|
82
|
-
|
|
83
|
-
abort(): void;
|
|
84
|
-
|
|
85
|
-
begin(): void;
|
|
86
|
-
|
|
87
|
-
completePayment(status: ApplePayStatusCodes): void;
|
|
88
|
-
|
|
89
|
-
completePaymentMethodSelection(newTotal: any, newLineItems: any): void;
|
|
90
|
-
|
|
91
|
-
completeShippingContactSelection(
|
|
92
|
-
status: ApplePayStatusCodes,
|
|
93
|
-
newShippingMethods: any,
|
|
94
|
-
newTotal: any,
|
|
95
|
-
newLineItems: any,
|
|
96
|
-
): void;
|
|
97
|
-
|
|
98
|
-
completeShippingMethodSelection(
|
|
99
|
-
status: ApplePayStatusCodes,
|
|
100
|
-
newTotal: any,
|
|
101
|
-
newLineItems: any,
|
|
102
|
-
): void;
|
|
103
|
-
|
|
104
|
-
supportsVersion(version: number): boolean;
|
|
105
|
-
|
|
106
|
-
oncancel: (event: any) => void;
|
|
107
|
-
|
|
108
|
-
onpaymentauthorized: (event: any) => void;
|
|
109
|
-
|
|
110
|
-
onpaymentmethodselected: (event: any) => void;
|
|
111
|
-
|
|
112
|
-
onshippingcontactselected: (event: any) => void;
|
|
113
|
-
|
|
114
|
-
onshippingmethodselected: (event: any) => void;
|
|
115
|
-
|
|
116
|
-
onvalidatemerchant: (event: any) => void;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* @description Accept Apple Pay on the Web. *This component is currently in beta and is subject to change.*
|
|
121
|
-
*/
|
|
122
|
-
export interface ApplePay {
|
|
123
|
-
create(options: { client: Client }): Promise<any>;
|
|
124
|
-
create(options: { client: Client }, callback?: callback): void;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* @description The current version of the SDK, i.e. `3.0.2`.
|
|
128
|
-
*/
|
|
129
|
-
VERSION: string;
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Merges a payment request with Braintree defaults
|
|
133
|
-
* The following properties are assigned to `paymentRequest` if not already defined
|
|
134
|
-
* - countryCode
|
|
135
|
-
* - currencyCode
|
|
136
|
-
* - merchantCapabilities
|
|
137
|
-
* - supportedNetworks * @example
|
|
138
|
-
* var applePay = require('braintree-web/apple-pay');
|
|
139
|
-
*
|
|
140
|
-
* applePay.create({client: clientInstance}, function (createErr, applePayInstance) {
|
|
141
|
-
* // ...
|
|
142
|
-
* var paymentRequest = applePay.createPaymentRequest({
|
|
143
|
-
* total: {
|
|
144
|
-
* label: 'My Company',
|
|
145
|
-
* amount: '19.99'
|
|
146
|
-
* });
|
|
147
|
-
*
|
|
148
|
-
* console.log(paymentRequest);
|
|
149
|
-
* // { total: { }, countryCode: 'US', currencyCode: 'USD', merchantCapabilities: [ ], supportedNetworks: [ ] }
|
|
150
|
-
*
|
|
151
|
-
*/
|
|
152
|
-
createPaymentRequest(paymentRequest: ApplePayPaymentRequest): ApplePayPaymentRequest;
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Validates the merchant website, as required by ApplePaySession before payment can be authorized. * - The canonical name for your store.
|
|
156
|
-
* - The system may display this name to the user.
|
|
157
|
-
* - Use a 128-character or less, UTF-8 string.
|
|
158
|
-
* - Do not localize the name. * Your Apple merchant identifier. This is the Apple Merchant ID created on the Apple Developer Portal.
|
|
159
|
-
* Defaults to the merchant identifier specified in the Braintree Control Panel.
|
|
160
|
-
* You can use this field to override the merchant identifier for this transaction. * Pass the merchant session to your Apple Pay session's completeMerchantValidation method.
|
|
161
|
-
* @example
|
|
162
|
-
* var applePay = require('braintree-web/apple-pay');
|
|
163
|
-
*
|
|
164
|
-
* applePay.create({client: clientInstance}, function (createErr, applePayInstance) {
|
|
165
|
-
* var session = new ApplePaySession(1, {
|
|
166
|
-
* // This should be the payment request object that
|
|
167
|
-
* // contains the information needed to display the payment sheet.
|
|
168
|
-
* });
|
|
169
|
-
*
|
|
170
|
-
* session.onvalidatemerchant = function (event) {
|
|
171
|
-
* applePay.performValidation({
|
|
172
|
-
* validationURL: event.validationURL
|
|
173
|
-
* }, function(err, validationData) {
|
|
174
|
-
* if (err) {
|
|
175
|
-
* console.error(err);
|
|
176
|
-
* session.abort();
|
|
177
|
-
* return;
|
|
178
|
-
* }
|
|
179
|
-
* session.completeMerchantValidation(validationData);
|
|
180
|
-
* });
|
|
181
|
-
* };
|
|
182
|
-
* });
|
|
183
|
-
*/
|
|
184
|
-
performValidation(
|
|
185
|
-
options: { validationURL: string; displayName?: string; merchantIdentifier?: string },
|
|
186
|
-
callback: callback,
|
|
187
|
-
): void;
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Tokenizes an Apple Pay payment. * @example
|
|
191
|
-
* var applePay = require('braintree-web/apple-pay');
|
|
192
|
-
*
|
|
193
|
-
* applePay.create({client: clientInstance}, function (createErr, applePayInstance) {
|
|
194
|
-
* var session = new ApplePaySession(1, { });
|
|
195
|
-
*
|
|
196
|
-
* session.onpaymentauthorized = function (event) {
|
|
197
|
-
* applePay.tokenize({
|
|
198
|
-
* token: event.payment.token
|
|
199
|
-
* }, function (err, tokenizedPayload) {
|
|
200
|
-
* if (err) {
|
|
201
|
-
* session.completePayment(ApplePaySession.STATUS_FAILURE);
|
|
202
|
-
* return;
|
|
203
|
-
* }
|
|
204
|
-
* session.completePayment(ApplePaySession.STATUS_SUCCESS);
|
|
205
|
-
*
|
|
206
|
-
* // Send the tokenizedPayload to your server.
|
|
207
|
-
* });
|
|
208
|
-
* };
|
|
209
|
-
* });
|
|
210
|
-
*/
|
|
211
|
-
tokenize(options: { token: any }, callback: callback): void;
|
|
212
|
-
tokenize(options: { token: any }): Promise<any>;
|
|
213
|
-
}
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { callback } from './core';
|
|
3
|
+
import { Client } from './client';
|
|
4
|
+
|
|
5
|
+
// more info https://developer.apple.com/reference/applepayjs/1916082-applepay_js_data_types/paymentrequest
|
|
6
|
+
|
|
7
|
+
// billingContact
|
|
8
|
+
// Billing contact information for the user.
|
|
9
|
+
// countryCode
|
|
10
|
+
// Required.The merchant’s two- letter ISO 3166 country code.
|
|
11
|
+
// currencyCode
|
|
12
|
+
// Required.The three- letter ISO 4217 currency code for the payment.
|
|
13
|
+
// lineItems
|
|
14
|
+
// A set of line items that explain recurring payments and additional charges.
|
|
15
|
+
// merchantCapabilities
|
|
16
|
+
// Required.The payment capabilities supported by the merchant.The value must be one or more of supports3DS, supportsEMV, supportsCredit, or supportsDebit.
|
|
17
|
+
// requiredBillingContactFields
|
|
18
|
+
// The billing information that is required from the user.The value must be one or more of postalAddress, phone, email, or name.
|
|
19
|
+
// requiredShippingContactFields
|
|
20
|
+
// The shipping information that is required from the user.The value must be one or more of postalAddress, phone, email, or name.
|
|
21
|
+
// shippingContact
|
|
22
|
+
// Shipping contact information for the user.
|
|
23
|
+
// shippingMethods
|
|
24
|
+
// A set of available shipping methods.Totals for all shipping methods must be non- negative to pass validation.
|
|
25
|
+
// shippingType
|
|
26
|
+
// How the items are to be shipped.This property is optional.If specified, it must be one or more of shipping, delivery, storePickup, or servicePickup.The default value is shipping.
|
|
27
|
+
// supportedNetworks
|
|
28
|
+
// Required.The payment networks supported by the merchant.The value must be one or more of amex, discover, interac, masterCard, privateLabel, or visa.
|
|
29
|
+
// total
|
|
30
|
+
// Required.The total amount for the payment.The total must be greater than zero and have a label to pass validation.
|
|
31
|
+
export interface ApplePayPaymentRequest {
|
|
32
|
+
total: {
|
|
33
|
+
label: string;
|
|
34
|
+
amount: string;
|
|
35
|
+
};
|
|
36
|
+
countryCode: string;
|
|
37
|
+
currencyCode: string;
|
|
38
|
+
supportedNetworks: string[];
|
|
39
|
+
merchantCapabilities: string[];
|
|
40
|
+
|
|
41
|
+
billingContact?: any;
|
|
42
|
+
shippingContact?: any;
|
|
43
|
+
shippingMethods?: any;
|
|
44
|
+
shippingType?: any;
|
|
45
|
+
requiredBillingContactFields?: any;
|
|
46
|
+
requiredShippingContactFields?: any;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export enum ApplePayStatusCodes {
|
|
50
|
+
// The requested action succeeded.
|
|
51
|
+
STATUS_SUCCESS = 1,
|
|
52
|
+
// The requested action failed.
|
|
53
|
+
STATUS_FAILURE,
|
|
54
|
+
// The billing address is not valid.
|
|
55
|
+
STATUS_INVALID_BILLING_POSTAL_ADDRESS,
|
|
56
|
+
// The shipping address is not valid.
|
|
57
|
+
STATUS_INVALID_SHIPPING_POSTAL_ADDRESS,
|
|
58
|
+
// The shipping contact information is not valid.
|
|
59
|
+
STATUS_INVALID_SHIPPING_CONTACT,
|
|
60
|
+
// The required PIN information was not provided. Cards on the China Union Pay payment network may require a PIN to authenticate the transaction.
|
|
61
|
+
STATUS_PIN_REQUIRED,
|
|
62
|
+
// The PIN information is not valid.Cards on the China Union Pay network may require a PIN.
|
|
63
|
+
STATUS_PIN_INCORRECT,
|
|
64
|
+
// The maximum number of tries for a PIN has been reached and the user has been locked out. Cards on the China Union Pay network may require a PIN.
|
|
65
|
+
STATUS_PIN_LOCKOUT,
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface ApplePayPayload {
|
|
69
|
+
merchantIdentifier: string;
|
|
70
|
+
domainName: string;
|
|
71
|
+
displayName: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export class ApplePaySession {
|
|
75
|
+
constructor(version: number, request: ApplePayPaymentRequest);
|
|
76
|
+
|
|
77
|
+
canMakePayments(): boolean;
|
|
78
|
+
|
|
79
|
+
canMakePaymentsWithActiveCard(merchantIdentifier: string): boolean;
|
|
80
|
+
|
|
81
|
+
completeMerchantValidation(merchantSession: any): void;
|
|
82
|
+
|
|
83
|
+
abort(): void;
|
|
84
|
+
|
|
85
|
+
begin(): void;
|
|
86
|
+
|
|
87
|
+
completePayment(status: ApplePayStatusCodes): void;
|
|
88
|
+
|
|
89
|
+
completePaymentMethodSelection(newTotal: any, newLineItems: any): void;
|
|
90
|
+
|
|
91
|
+
completeShippingContactSelection(
|
|
92
|
+
status: ApplePayStatusCodes,
|
|
93
|
+
newShippingMethods: any,
|
|
94
|
+
newTotal: any,
|
|
95
|
+
newLineItems: any,
|
|
96
|
+
): void;
|
|
97
|
+
|
|
98
|
+
completeShippingMethodSelection(
|
|
99
|
+
status: ApplePayStatusCodes,
|
|
100
|
+
newTotal: any,
|
|
101
|
+
newLineItems: any,
|
|
102
|
+
): void;
|
|
103
|
+
|
|
104
|
+
supportsVersion(version: number): boolean;
|
|
105
|
+
|
|
106
|
+
oncancel: (event: any) => void;
|
|
107
|
+
|
|
108
|
+
onpaymentauthorized: (event: any) => void;
|
|
109
|
+
|
|
110
|
+
onpaymentmethodselected: (event: any) => void;
|
|
111
|
+
|
|
112
|
+
onshippingcontactselected: (event: any) => void;
|
|
113
|
+
|
|
114
|
+
onshippingmethodselected: (event: any) => void;
|
|
115
|
+
|
|
116
|
+
onvalidatemerchant: (event: any) => void;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @description Accept Apple Pay on the Web. *This component is currently in beta and is subject to change.*
|
|
121
|
+
*/
|
|
122
|
+
export interface ApplePay {
|
|
123
|
+
create(options: { client: Client }): Promise<any>;
|
|
124
|
+
create(options: { client: Client }, callback?: callback): void;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @description The current version of the SDK, i.e. `3.0.2`.
|
|
128
|
+
*/
|
|
129
|
+
VERSION: string;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Merges a payment request with Braintree defaults
|
|
133
|
+
* The following properties are assigned to `paymentRequest` if not already defined
|
|
134
|
+
* - countryCode
|
|
135
|
+
* - currencyCode
|
|
136
|
+
* - merchantCapabilities
|
|
137
|
+
* - supportedNetworks * @example
|
|
138
|
+
* var applePay = require('braintree-web/apple-pay');
|
|
139
|
+
*
|
|
140
|
+
* applePay.create({client: clientInstance}, function (createErr, applePayInstance) {
|
|
141
|
+
* // ...
|
|
142
|
+
* var paymentRequest = applePay.createPaymentRequest({
|
|
143
|
+
* total: {
|
|
144
|
+
* label: 'My Company',
|
|
145
|
+
* amount: '19.99'
|
|
146
|
+
* });
|
|
147
|
+
*
|
|
148
|
+
* console.log(paymentRequest);
|
|
149
|
+
* // { total: { }, countryCode: 'US', currencyCode: 'USD', merchantCapabilities: [ ], supportedNetworks: [ ] }
|
|
150
|
+
*
|
|
151
|
+
*/
|
|
152
|
+
createPaymentRequest(paymentRequest: ApplePayPaymentRequest): ApplePayPaymentRequest;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Validates the merchant website, as required by ApplePaySession before payment can be authorized. * - The canonical name for your store.
|
|
156
|
+
* - The system may display this name to the user.
|
|
157
|
+
* - Use a 128-character or less, UTF-8 string.
|
|
158
|
+
* - Do not localize the name. * Your Apple merchant identifier. This is the Apple Merchant ID created on the Apple Developer Portal.
|
|
159
|
+
* Defaults to the merchant identifier specified in the Braintree Control Panel.
|
|
160
|
+
* You can use this field to override the merchant identifier for this transaction. * Pass the merchant session to your Apple Pay session's completeMerchantValidation method.
|
|
161
|
+
* @example
|
|
162
|
+
* var applePay = require('braintree-web/apple-pay');
|
|
163
|
+
*
|
|
164
|
+
* applePay.create({client: clientInstance}, function (createErr, applePayInstance) {
|
|
165
|
+
* var session = new ApplePaySession(1, {
|
|
166
|
+
* // This should be the payment request object that
|
|
167
|
+
* // contains the information needed to display the payment sheet.
|
|
168
|
+
* });
|
|
169
|
+
*
|
|
170
|
+
* session.onvalidatemerchant = function (event) {
|
|
171
|
+
* applePay.performValidation({
|
|
172
|
+
* validationURL: event.validationURL
|
|
173
|
+
* }, function(err, validationData) {
|
|
174
|
+
* if (err) {
|
|
175
|
+
* console.error(err);
|
|
176
|
+
* session.abort();
|
|
177
|
+
* return;
|
|
178
|
+
* }
|
|
179
|
+
* session.completeMerchantValidation(validationData);
|
|
180
|
+
* });
|
|
181
|
+
* };
|
|
182
|
+
* });
|
|
183
|
+
*/
|
|
184
|
+
performValidation(
|
|
185
|
+
options: { validationURL: string; displayName?: string; merchantIdentifier?: string },
|
|
186
|
+
callback: callback,
|
|
187
|
+
): void;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Tokenizes an Apple Pay payment. * @example
|
|
191
|
+
* var applePay = require('braintree-web/apple-pay');
|
|
192
|
+
*
|
|
193
|
+
* applePay.create({client: clientInstance}, function (createErr, applePayInstance) {
|
|
194
|
+
* var session = new ApplePaySession(1, { });
|
|
195
|
+
*
|
|
196
|
+
* session.onpaymentauthorized = function (event) {
|
|
197
|
+
* applePay.tokenize({
|
|
198
|
+
* token: event.payment.token
|
|
199
|
+
* }, function (err, tokenizedPayload) {
|
|
200
|
+
* if (err) {
|
|
201
|
+
* session.completePayment(ApplePaySession.STATUS_FAILURE);
|
|
202
|
+
* return;
|
|
203
|
+
* }
|
|
204
|
+
* session.completePayment(ApplePaySession.STATUS_SUCCESS);
|
|
205
|
+
*
|
|
206
|
+
* // Send the tokenizedPayload to your server.
|
|
207
|
+
* });
|
|
208
|
+
* };
|
|
209
|
+
* });
|
|
210
|
+
*/
|
|
211
|
+
tokenize(options: { token: any }, callback: callback): void;
|
|
212
|
+
tokenize(options: { token: any }): Promise<any>;
|
|
213
|
+
}
|
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { callback } from './core';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* This object is returned by {@link Client#getConfiguration|getConfiguration}. This information is used extensively by other Braintree modules to properly configure themselves.
|
|
6
|
-
*/
|
|
7
|
-
export interface ClientAnalyticsMetadata {
|
|
8
|
-
sessionId: string;
|
|
9
|
-
sdkVersion: string;
|
|
10
|
-
merchantAppId: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface Configuration {
|
|
14
|
-
client: Client;
|
|
15
|
-
gatewayConfiguration: any;
|
|
16
|
-
analyticsMetadata: ClientAnalyticsMetadata;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface CreditCardInfo {
|
|
20
|
-
number: string;
|
|
21
|
-
cvv: string;
|
|
22
|
-
expirationDate: string;
|
|
23
|
-
billingAddress: {
|
|
24
|
-
postalCode?: string;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface Client {
|
|
29
|
-
authorization: string;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @description This function is the entry point for the <code>braintree.client</code> module.
|
|
33
|
-
* It is used for creating {@link Client} instances that service communication to Braintree servers.
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* var createClient = require('braintree-web/client').create;
|
|
37
|
-
*
|
|
38
|
-
* createClient({
|
|
39
|
-
* authorization: CLIENT_AUTHORIZATION
|
|
40
|
-
* }, function (createErr, clientInstance) {
|
|
41
|
-
* ...
|
|
42
|
-
* });
|
|
43
|
-
*/
|
|
44
|
-
create(options: { authorization: string }): Promise<Client>;
|
|
45
|
-
create(options: { authorization: string }, callback: callback): void;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @description The current version of the SDK, i.e. `3.0.2`.
|
|
49
|
-
*/
|
|
50
|
-
VERSION: string;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Returns a copy of the configuration values.
|
|
54
|
-
*/
|
|
55
|
-
getConfiguration(): Configuration;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Used by other modules to formulate all network requests to the Braintree gateway.
|
|
59
|
-
* It is also capable of being used directly from your own form to tokenize credit card information.
|
|
60
|
-
* However, be sure to satisfy PCI compliance if you use direct card tokenization.
|
|
61
|
-
* * @example
|
|
62
|
-
*
|
|
63
|
-
* <caption>Direct Credit Card Tokenization</caption>
|
|
64
|
-
* var createClient = require('braintree-web/client').create;
|
|
65
|
-
*
|
|
66
|
-
* createClient({
|
|
67
|
-
* authorization: CLIENT_AUTHORIZATION
|
|
68
|
-
* }, function (createErr, clientInstance) {
|
|
69
|
-
* var form = document.getElementById('my-form-id');
|
|
70
|
-
* var data = {
|
|
71
|
-
* creditCard: {
|
|
72
|
-
* number: form['cc-number'].value,
|
|
73
|
-
* cvv: form['cc-cvv'].value,
|
|
74
|
-
* expirationDate: form['cc-date'].value,
|
|
75
|
-
* billingAddress: {
|
|
76
|
-
* postalCode: form['cc-postal'].value
|
|
77
|
-
* },
|
|
78
|
-
* options: {
|
|
79
|
-
* validate: false
|
|
80
|
-
* }
|
|
81
|
-
* }
|
|
82
|
-
* };
|
|
83
|
-
*
|
|
84
|
-
* // Warning: For a merchant to be eligible for the easiest level of PCI compliance (SAQ A),
|
|
85
|
-
* // payment fields cannot be hosted on your checkout page.
|
|
86
|
-
* // For an alternative to the following, use Hosted Fields.
|
|
87
|
-
* clientInstance.request({
|
|
88
|
-
* endpoint: 'payment_methods/credit_cards',
|
|
89
|
-
* method: 'post',
|
|
90
|
-
* data: data
|
|
91
|
-
* }, function (requestErr, response) {
|
|
92
|
-
* // More detailed example of handling API errors: https://codepen.io/braintree/pen/MbwjdM
|
|
93
|
-
* if (requestErr) { throw new Error(requestErr); }
|
|
94
|
-
*
|
|
95
|
-
* console.log('Got nonce:', response.creditCards[0].nonce);
|
|
96
|
-
* });
|
|
97
|
-
* });
|
|
98
|
-
*/
|
|
99
|
-
request(
|
|
100
|
-
options: { method: string; endpoint: string; data: any; timeout?: number },
|
|
101
|
-
callback: callback,
|
|
102
|
-
): void;
|
|
103
|
-
}
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { callback } from './core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* This object is returned by {@link Client#getConfiguration|getConfiguration}. This information is used extensively by other Braintree modules to properly configure themselves.
|
|
6
|
+
*/
|
|
7
|
+
export interface ClientAnalyticsMetadata {
|
|
8
|
+
sessionId: string;
|
|
9
|
+
sdkVersion: string;
|
|
10
|
+
merchantAppId: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface Configuration {
|
|
14
|
+
client: Client;
|
|
15
|
+
gatewayConfiguration: any;
|
|
16
|
+
analyticsMetadata: ClientAnalyticsMetadata;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface CreditCardInfo {
|
|
20
|
+
number: string;
|
|
21
|
+
cvv: string;
|
|
22
|
+
expirationDate: string;
|
|
23
|
+
billingAddress: {
|
|
24
|
+
postalCode?: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface Client {
|
|
29
|
+
authorization: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @description This function is the entry point for the <code>braintree.client</code> module.
|
|
33
|
+
* It is used for creating {@link Client} instances that service communication to Braintree servers.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* var createClient = require('braintree-web/client').create;
|
|
37
|
+
*
|
|
38
|
+
* createClient({
|
|
39
|
+
* authorization: CLIENT_AUTHORIZATION
|
|
40
|
+
* }, function (createErr, clientInstance) {
|
|
41
|
+
* ...
|
|
42
|
+
* });
|
|
43
|
+
*/
|
|
44
|
+
create(options: { authorization: string }): Promise<Client>;
|
|
45
|
+
create(options: { authorization: string }, callback: callback): void;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @description The current version of the SDK, i.e. `3.0.2`.
|
|
49
|
+
*/
|
|
50
|
+
VERSION: string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Returns a copy of the configuration values.
|
|
54
|
+
*/
|
|
55
|
+
getConfiguration(): Configuration;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Used by other modules to formulate all network requests to the Braintree gateway.
|
|
59
|
+
* It is also capable of being used directly from your own form to tokenize credit card information.
|
|
60
|
+
* However, be sure to satisfy PCI compliance if you use direct card tokenization.
|
|
61
|
+
* * @example
|
|
62
|
+
*
|
|
63
|
+
* <caption>Direct Credit Card Tokenization</caption>
|
|
64
|
+
* var createClient = require('braintree-web/client').create;
|
|
65
|
+
*
|
|
66
|
+
* createClient({
|
|
67
|
+
* authorization: CLIENT_AUTHORIZATION
|
|
68
|
+
* }, function (createErr, clientInstance) {
|
|
69
|
+
* var form = document.getElementById('my-form-id');
|
|
70
|
+
* var data = {
|
|
71
|
+
* creditCard: {
|
|
72
|
+
* number: form['cc-number'].value,
|
|
73
|
+
* cvv: form['cc-cvv'].value,
|
|
74
|
+
* expirationDate: form['cc-date'].value,
|
|
75
|
+
* billingAddress: {
|
|
76
|
+
* postalCode: form['cc-postal'].value
|
|
77
|
+
* },
|
|
78
|
+
* options: {
|
|
79
|
+
* validate: false
|
|
80
|
+
* }
|
|
81
|
+
* }
|
|
82
|
+
* };
|
|
83
|
+
*
|
|
84
|
+
* // Warning: For a merchant to be eligible for the easiest level of PCI compliance (SAQ A),
|
|
85
|
+
* // payment fields cannot be hosted on your checkout page.
|
|
86
|
+
* // For an alternative to the following, use Hosted Fields.
|
|
87
|
+
* clientInstance.request({
|
|
88
|
+
* endpoint: 'payment_methods/credit_cards',
|
|
89
|
+
* method: 'post',
|
|
90
|
+
* data: data
|
|
91
|
+
* }, function (requestErr, response) {
|
|
92
|
+
* // More detailed example of handling API errors: https://codepen.io/braintree/pen/MbwjdM
|
|
93
|
+
* if (requestErr) { throw new Error(requestErr); }
|
|
94
|
+
*
|
|
95
|
+
* console.log('Got nonce:', response.creditCards[0].nonce);
|
|
96
|
+
* });
|
|
97
|
+
* });
|
|
98
|
+
*/
|
|
99
|
+
request(
|
|
100
|
+
options: { method: string; endpoint: string; data: any; timeout?: number },
|
|
101
|
+
callback: callback,
|
|
102
|
+
): void;
|
|
103
|
+
}
|