braintree-web-drop-in
Advanced tools
Comparing version 1.29.0 to 1.30.0
CHANGELOG | ||
========= | ||
1.30.0 | ||
------ | ||
- Update braintree-web to v3.78.0 | ||
- Apple Pay: Support Elo cards | ||
- Google Pay: Support Elo cards | ||
- Venmo: Add `paymentMethodUsage` and `displayName` parameter to Venmo create options | ||
- Update browser-detection to v1.12.0 | ||
- Fix issue where cursor didn't change for Apple Pay on hover (#737) | ||
- Fix issue where Drop-in couldn't load if `paymentOptionPriority` is set (#739) | ||
1.29.0 | ||
@@ -406,3 +416,3 @@ ------ | ||
- Add ability to pass in a DOM Node to Drop-in as an alternative to a CSS selector | ||
- Update braintree-web to [version 3.16.0](https://github.com/braintree/braintree-web/blob/master/CHANGELOG.md#3160) | ||
- Update braintree-web to [version 3.16.0](https://github.com/braintree/braintree-web/blob/main/CHANGELOG.md#3160) | ||
- Update browser-detection to version 1.3.0 | ||
@@ -409,0 +419,0 @@ - Update PayPal Checkout.js to version 4.0.75 |
@@ -28,3 +28,4 @@ 'use strict'; | ||
]; | ||
var ASYNC_DEPENDENCIES = DEFAULT_PAYMENT_OPTION_PRIORITY.concat(['threeDSecure', 'dataCollector']); | ||
var NON_PAYMENT_OPTION_DEPENDENCIES = ['threeDSecure', 'dataCollector']; | ||
var ASYNC_DEPENDENCIES = DEFAULT_PAYMENT_OPTION_PRIORITY.concat(NON_PAYMENT_OPTION_DEPENDENCIES); | ||
var DEPENDENCY_READY_CHECK_INTERVAL = 200; | ||
@@ -37,5 +38,4 @@ | ||
this.isGuestCheckout = isGuestCheckout(options.client); | ||
this.dependencyStates = ASYNC_DEPENDENCIES.reduce(function (total, dependencyKey) { | ||
if (options.merchantConfiguration[dependencyKey]) { | ||
if (this._shouldIncludeDependency(dependencyKey)) { | ||
total[dependencyKey] = dependencySetupStates.INITIALIZING; | ||
@@ -45,8 +45,3 @@ } | ||
return total; | ||
}, {}); | ||
// card is on by default, so we need to set it's state to INITIALIZING | ||
// unless the merchant has specifically opted out of using the card form | ||
if (options.merchantConfiguration.card !== false) { | ||
this.dependencyStates.card = dependencySetupStates.INITIALIZING; | ||
} | ||
}.bind(this), {}); | ||
@@ -182,2 +177,36 @@ this.failedDependencies = {}; | ||
DropinModel.prototype._shouldIncludeDependency = function (key) { | ||
if (key === 'card') { | ||
// card is turned on by default unless the merchant explicitly | ||
// passes a value of `false` or omits it from a custom | ||
// `paymentOptionPriority` array | ||
if (this.merchantConfiguration.card === false) { | ||
return false; | ||
} | ||
} else if (!this.merchantConfiguration[key]) { | ||
// if the merchant does not have the non-card dependency | ||
// configured, do not include the dependency | ||
return false; | ||
} | ||
if (NON_PAYMENT_OPTION_DEPENDENCIES.indexOf(key) > -1) { | ||
console.log(key); | ||
console.log('it got here'); | ||
// if the dependency is not a payment option (3DS, data collector) | ||
// include it since the merchant configured Drop-in for it | ||
return true; | ||
} | ||
if (this.merchantConfiguration.paymentOptionPriority) { | ||
// if the merchant passed a custom `paymentOptionPriority` array, | ||
// only include the dependency if it was configured _and_ | ||
// included in the array | ||
return this.merchantConfiguration.paymentOptionPriority.indexOf(key) > -1; | ||
} | ||
// otherwise, include it if it is a valid payment option | ||
return DEFAULT_PAYMENT_OPTION_PRIORITY.indexOf(key) > -1; | ||
}; | ||
DropinModel.prototype._shouldEmitRequestableEvent = function (options) { | ||
@@ -184,0 +213,0 @@ var requestableStateHasNotChanged = this.isPaymentMethodRequestable() === options.isRequestable; |
36
index.js
@@ -40,3 +40,3 @@ 'use strict'; | ||
* <form id="payment-form" action="/" method="post"> | ||
* <script src="https://js.braintreegateway.com/web/dropin/1.29.0/js/dropin.min.js" | ||
* <script src="https://js.braintreegateway.com/web/dropin/1.30.0/js/dropin.min.js" | ||
* data-braintree-dropin-authorization="CLIENT_AUTHORIZATION" | ||
@@ -59,3 +59,3 @@ * ></script> | ||
* <form id="payment-form" action="/" method="post"> | ||
* <script src="https://js.braintreegateway.com/web/dropin/1.29.0/js/dropin.min.js" | ||
* <script src="https://js.braintreegateway.com/web/dropin/1.30.0/js/dropin.min.js" | ||
* data-braintree-dropin-authorization="CLIENT_AUTHORIZATION" | ||
@@ -75,3 +75,3 @@ * data-paypal.flow="checkout" | ||
* <form id="payment-form" action="/" method="post"> | ||
* <script src="https://js.braintreegateway.com/web/dropin/1.29.0/js/dropin.min.js" | ||
* <script src="https://js.braintreegateway.com/web/dropin/1.30.0/js/dropin.min.js" | ||
* data-braintree-dropin-authorization="CLIENT_AUTHORIZATION" | ||
@@ -91,3 +91,3 @@ * data-locale="de_DE" | ||
* <form id="payment-form" action="/" method="post"> | ||
* <script src="https://js.braintreegateway.com/web/dropin/1.29.0/js/dropin.min.js" | ||
* <script src="https://js.braintreegateway.com/web/dropin/1.30.0/js/dropin.min.js" | ||
* data-braintree-dropin-authorization="CLIENT_AUTHORIZATION" | ||
@@ -102,3 +102,3 @@ * data-card.cardholder-name.required="false" | ||
* <form id="payment-form" action="/" method="post"> | ||
* <script src="https://js.braintreegateway.com/web/dropin/1.29.0/js/dropin.min.js" | ||
* <script src="https://js.braintreegateway.com/web/dropin/1.30.0/js/dropin.min.js" | ||
* data-braintree-dropin-authorization="CLIENT_AUTHORIZATION" | ||
@@ -120,11 +120,11 @@ * data-card.cardholder-name.required="true" | ||
var VERSION = '1.29.0'; | ||
var VERSION = '1.30.0'; | ||
/** | ||
* @typedef {object} cardCreateOptions The configuration options for cards. Internally, Drop-in uses [Hosted Fields](http://braintree.github.io/braintree-web/3.76.4/module-braintree-web_hosted-fields.html) to render the card form. The `overrides.fields` and `overrides.styles` allow the Hosted Fields to be customized. | ||
* @typedef {object} cardCreateOptions The configuration options for cards. Internally, Drop-in uses [Hosted Fields](http://braintree.github.io/braintree-web/3.78.0/module-braintree-web_hosted-fields.html) to render the card form. The `overrides.fields` and `overrides.styles` allow the Hosted Fields to be customized. | ||
* | ||
* @param {(boolean|object)} [cardholderName] Will enable a cardholder name field above the card number field. If set to an object, you can specify whether or not the field is required. If set to a `true`, it will default the field to being present, but not required. | ||
* @param {boolean} [cardholderName.required=false] When true, the cardholder name field will be required to request the payment method nonce. | ||
* @param {object} [overrides.fields] The Hosted Fields [`fields` options](http://braintree.github.io/braintree-web/3.76.4/module-braintree-web_hosted-fields.html#~fieldOptions). Only `number`, `cvv`, `expirationDate` and `postalCode` can be configured. Each is a [Hosted Fields `field` object](http://braintree.github.io/braintree-web/3.76.4/module-braintree-web_hosted-fields.html#~field). `selector` cannot be modified. | ||
* @param {object} [overrides.styles] The Hosted Fields [`styles` options](http://braintree.github.io/braintree-web/3.76.4/module-braintree-web_hosted-fields.html#~styleOptions). These can be used to add custom styles to the Hosted Fields iframes. To style the rest of Drop-in, [review the documentation for customizing Drop-in](https://developers.braintreepayments.com/guides/drop-in/customization/javascript/v3#customize-your-ui). | ||
* @param {object} [overrides.fields] The Hosted Fields [`fields` options](http://braintree.github.io/braintree-web/3.78.0/module-braintree-web_hosted-fields.html#~fieldOptions). Only `number`, `cvv`, `expirationDate` and `postalCode` can be configured. Each is a [Hosted Fields `field` object](http://braintree.github.io/braintree-web/3.78.0/module-braintree-web_hosted-fields.html#~field). `selector` cannot be modified. | ||
* @param {object} [overrides.styles] The Hosted Fields [`styles` options](http://braintree.github.io/braintree-web/3.78.0/module-braintree-web_hosted-fields.html#~styleOptions). These can be used to add custom styles to the Hosted Fields iframes. To style the rest of Drop-in, [review the documentation for customizing Drop-in](https://developers.braintreepayments.com/guides/drop-in/customization/javascript/v3#customize-your-ui). | ||
* @param {boolean} [clearFieldsAfterTokenization=true] When false, the card form will not clear the card data when the customer returns to the card view after a successful tokenization. | ||
@@ -145,7 +145,7 @@ * @param {object} [vault] Configuration for vaulting credit cards. Only applies when using a [client token with a customer id](https://developers.braintreepayments.com/reference/request/client-token/generate/#customer_id). | ||
* | ||
* @param {options} cardinalSDKConfig A configuration object to adjust the configuration for the underlying Cardinal SDK (Braintree's 3D Secure provider). See [`cardinalSDKConfig` options](http://braintree.github.io/braintree-web/3.76.4/module-braintree-web_three-d-secure.html#.create) for all options. | ||
* @param {options} cardinalSDKConfig A configuration object to adjust the configuration for the underlying Cardinal SDK (Braintree's 3D Secure provider). See [`cardinalSDKConfig` options](http://braintree.github.io/braintree-web/3.78.0/module-braintree-web_three-d-secure.html#.create) for all options. | ||
* @param {string} amount __Deprecated__ The amount to verify with 3D Secure. Set amount in the {@link Dropin#requestPaymentMethod|requestPaymentMethod options} instead. | ||
*/ | ||
/** @typedef {object} paypalCreateOptions The configuration options for PayPal and PayPalCredit. For a full list of options see the [PayPal Checkout client reference options](http://braintree.github.io/braintree-web/3.76.4/PayPalCheckout.html#createPayment). | ||
/** @typedef {object} paypalCreateOptions The configuration options for PayPal and PayPalCredit. For a full list of options see the [PayPal Checkout client reference options](http://braintree.github.io/braintree-web/3.78.0/PayPalCheckout.html#createPayment). | ||
* | ||
@@ -244,3 +244,3 @@ * @param {string} flow Either `checkout` for a one-time [Checkout with PayPal](https://developers.braintreepayments.com/guides/paypal/checkout-with-paypal/javascript/v3) flow or `vault` for a [Vault flow](https://developers.braintreepayments.com/guides/paypal/vault/javascript/v3). Required when using PayPal or PayPal Credit. | ||
* | ||
* @param {object} [options.translations] To use your own translations, pass an object with the strings you wish to replace. This object must use the same structure as the object used internally for supported translations, which can be found [here](https://github.com/braintree/braintree-web-drop-in/blob/master/src/translations/en_US.js). Any strings that are not included will be those from the provided `locale` or `en_US` if no `locale` is provided. See below for an example of creating Drop-in with custom translations. | ||
* @param {object} [options.translations] To use your own translations, pass an object with the strings you wish to replace. This object must use the same structure as the object used internally for supported translations, which can be found [here](https://github.com/braintree/braintree-web-drop-in/blob/main/src/translations/en_US.js). Any strings that are not included will be those from the provided `locale` or `en_US` if no `locale` is provided. See below for an example of creating Drop-in with custom translations. | ||
* @param {array} [options.paymentOptionPriority] Use this option to indicate the order in which enabled payment options should appear when multiple payment options are enabled. By default, payment options will appear in this order: `['card', 'paypal', 'paypalCredit', 'venmo', 'applePay', 'googlePay']`. Payment options omitted from this array will not be offered to the customer. | ||
@@ -251,3 +251,3 @@ * | ||
* | ||
* Some of the PayPal configuration options are listed [here](#~paypalCreateOptions), but for a full list see the [PayPal Checkout client reference options](http://braintree.github.io/braintree-web/3.76.4/PayPalCheckout.html#createPayment). | ||
* Some of the PayPal configuration options are listed [here](#~paypalCreateOptions), but for a full list see the [PayPal Checkout client reference options](http://braintree.github.io/braintree-web/3.78.0/PayPalCheckout.html#createPayment). | ||
* | ||
@@ -258,3 +258,3 @@ * PayPal is not [supported in Internet Explorer versions lower than 11](https://developer.paypal.com/docs/checkout/reference/faq/#which-browsers-does-paypal-checkout-support). | ||
* | ||
* Some of the PayPal Credit configuration options are listed [here](#~paypalCreateOptions), but for a full list see the [PayPal Checkout client reference options](http://braintree.github.io/braintree-web/3.76.4/PayPalCheckout.html#createPayment). For more information on PayPal Credit, see the [Braintree Developer Docs](https://developers.braintreepayments.com/guides/paypal/paypal-credit/javascript/v3). | ||
* Some of the PayPal Credit configuration options are listed [here](#~paypalCreateOptions), but for a full list see the [PayPal Checkout client reference options](http://braintree.github.io/braintree-web/3.78.0/PayPalCheckout.html#createPayment). For more information on PayPal Credit, see the [Braintree Developer Docs](https://developers.braintreepayments.com/guides/paypal/paypal-credit/javascript/v3). | ||
* | ||
@@ -299,3 +299,3 @@ * PayPal Credit is not [supported in Internet Explorer versions lower than 11](https://developer.paypal.com/docs/checkout/reference/faq/#which-browsers-does-paypal-checkout-support). | ||
* | ||
* <script src="https://js.braintreegateway.com/web/dropin/1.29.0/js/dropin.min.js"></script> | ||
* <script src="https://js.braintreegateway.com/web/dropin/1.30.0/js/dropin.min.js"></script> | ||
* | ||
@@ -339,3 +339,3 @@ * <script> | ||
* | ||
* <script src="https://js.braintreegateway.com/web/dropin/1.29.0/js/dropin.min.js"></script> | ||
* <script src="https://js.braintreegateway.com/web/dropin/1.30.0/js/dropin.min.js"></script> | ||
* | ||
@@ -418,3 +418,3 @@ * <script> | ||
* | ||
* <script src="https://js.braintreegateway.com/web/dropin/1.29.0/js/dropin.min.js"></script> | ||
* <script src="https://js.braintreegateway.com/web/dropin/1.30.0/js/dropin.min.js"></script> | ||
* | ||
@@ -637,3 +637,3 @@ * <script> | ||
/** | ||
* @description The current version of Drop-in, i.e. `1.29.0`. | ||
* @description The current version of Drop-in, i.e. `1.30.0`. | ||
* @type {string} | ||
@@ -640,0 +640,0 @@ */ |
{ | ||
"name": "braintree-web-drop-in", | ||
"version": "1.29.0", | ||
"version": "1.30.0", | ||
"main": "index.js", | ||
@@ -28,8 +28,8 @@ "scripts": { | ||
"devDependencies": { | ||
"@wdio/browserstack-service": "^7.5.7", | ||
"@wdio/cli": "^7.5.7", | ||
"@wdio/local-runner": "^7.5.7", | ||
"@wdio/mocha-framework": "^7.5.3", | ||
"@wdio/spec-reporter": "^7.5.7", | ||
"@wdio/sync": "^7.5.7", | ||
"@wdio/browserstack-service": "^7.7.3", | ||
"@wdio/cli": "^7.7.3", | ||
"@wdio/local-runner": "^7.7.3", | ||
"@wdio/mocha-framework": "^7.7.3", | ||
"@wdio/spec-reporter": "^7.7.3", | ||
"@wdio/sync": "^7.7.3", | ||
"ansi-colors": "^4.1.0", | ||
@@ -42,5 +42,5 @@ "brfs": "^2.0.2", | ||
"del": "^6.0.0", | ||
"dotenv": "^9.0.2", | ||
"dotenv": "^10.0.0", | ||
"es6-shim": "^0.35.6", | ||
"eslint": "^7.26.0", | ||
"eslint": "^7.28.0", | ||
"eslint-config-braintree": "^4.0.0", | ||
@@ -53,3 +53,3 @@ "fancy-log": "^1.3.3", | ||
"gulp-replace": "^1.1.3", | ||
"gulp-size": "^4.0.0", | ||
"gulp-size": "^4.0.1", | ||
"gulp-streamify": "1.0.2", | ||
@@ -59,6 +59,6 @@ "gulp-uglify": "^3.0.2", | ||
"jest": "^26.6.3", | ||
"jsdoc": "^3.6.6", | ||
"jsdoc": "^3.6.7", | ||
"jsdoc-template": "braintree/jsdoc-template#3.2.0", | ||
"mkdirp": "^1.0.4", | ||
"mocha": "^8.4.0", | ||
"mocha": "^9.0.0", | ||
"npm-run-all": "^4.1.5", | ||
@@ -74,3 +74,3 @@ "serve-static": "^1.14.1", | ||
"@braintree/asset-loader": "0.4.4", | ||
"@braintree/browser-detection": "1.11.1", | ||
"@braintree/browser-detection": "1.12.0", | ||
"@braintree/class-list": "0.2.0", | ||
@@ -80,3 +80,3 @@ "@braintree/event-emitter": "0.4.1", | ||
"@braintree/wrap-promise": "2.1.0", | ||
"braintree-web": "3.76.4", | ||
"braintree-web": "3.78.0", | ||
"promise-polyfill": "8.2.0" | ||
@@ -83,0 +83,0 @@ }, |
@@ -38,3 +38,3 @@ # Braintree Web Drop-in | ||
<script src="https://js.braintreegateway.com/web/dropin/1.28.0/js/dropin.min.js"></script> | ||
<script src="https://js.braintreegateway.com/web/dropin/1.30.0/js/dropin.min.js"></script> | ||
@@ -41,0 +41,0 @@ <script> |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
1402040
28157
+ Added@braintree/browser-detection@1.12.0(transitive)
+ Added@braintree/sanitize-url@5.0.2(transitive)
+ Addedbraintree-web@3.78.0(transitive)
- Removed@braintree/browser-detection@1.11.1(transitive)
- Removed@braintree/sanitize-url@5.0.1(transitive)
- Removedbraintree-web@3.76.4(transitive)
Updatedbraintree-web@3.78.0