Skip to content

Commit 4a13cbe

Browse files
committed
Release braintree-web 3.114.0 source
1 parent f122ec1 commit 4a13cbe

File tree

12 files changed

+709
-363
lines changed

12 files changed

+709
-363
lines changed

.husky/pre-commit

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# Ensure all JavaScript files staged for commit pass standard code style
4+
FILES=`git diff --name-only --cached --diff-filter=ACM | grep -E '(js|jsx)$' || true`;
5+
# FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\?$")
6+
7+
if [ ! -z "$FILES" ]; then
8+
for file in $FILES; do
9+
if ! npx eslint "$file"; then
10+
echo "ESLint failed on staged file '$file'. Please fix the errors and try again."
11+
exit 1
12+
fi
13+
done
14+
15+
# Prettify all selected files
16+
echo "$FILES" | xargs ./node_modules/.bin/prettier --ignore-unknown --cache --check
17+
else
18+
echo -e "\033[1;31m You have no staged javascript files, skipping checks .. "
19+
fi

package-lock.json

Lines changed: 633 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "braintree-web",
3-
"version": "3.113.0",
3+
"version": "3.114.0",
44
"license": "MIT",
55
"main": "src/index.js",
66
"private": true,
@@ -17,22 +17,23 @@
1717
"release": "./scripts/release",
1818
"posttest": "npm run lint",
1919
"prettier": "prettier --write .",
20-
"test": "BRAINTREE_JS_ENV=development jest --config=jest.config.json"
20+
"test": "BRAINTREE_JS_ENV=development jest --config=jest.config.json",
21+
"prepare": "husky"
2122
},
2223
"dependencies": {
23-
"@braintree/asset-loader": "2.0.1",
24-
"@braintree/browser-detection": "2.0.1",
24+
"@braintree/asset-loader": "2.0.2",
25+
"@braintree/browser-detection": "2.0.2",
2526
"@braintree/event-emitter": "0.4.1",
2627
"@braintree/extended-promise": "1.0.0",
27-
"@braintree/iframer": "2.0.0",
28+
"@braintree/iframer": "2.0.1",
2829
"@braintree/sanitize-url": "7.0.4",
29-
"@braintree/uuid": "1.0.0",
30+
"@braintree/uuid": "1.0.1",
3031
"@braintree/wrap-promise": "2.1.0",
3132
"@paypal/accelerated-checkout-loader": "1.1.0",
32-
"card-validator": "10.0.0",
33-
"credit-card-type": "10.0.1",
34-
"framebus": "6.0.0",
35-
"inject-stylesheet": "6.0.1",
33+
"card-validator": "10.0.2",
34+
"credit-card-type": "10.0.2",
35+
"framebus": "6.0.2",
36+
"inject-stylesheet": "6.0.2",
3637
"promise-polyfill": "8.2.3",
3738
"restricted-input": "3.0.5"
3839
},
@@ -57,11 +58,13 @@
5758
"gulp-rename": "^2.0.0",
5859
"gulp-replace": "^1.1.3",
5960
"gzip-size": "^6.0.0",
61+
"husky": "^9.1.7",
6062
"jest": "^29.2.1",
6163
"jest-environment-jsdom": "^29.2.1",
6264
"jsdoc": "^3.6.10",
6365
"jsdoc-template": "braintree/jsdoc-template#3.2.0",
6466
"json5": "2.2.3",
67+
"lint-staged": "^15.2.11",
6568
"loose-envify": "^1.0.0",
6669
"merge-stream": "^2.0.0",
6770
"minimist": "1.2.8",

src/client/request/graphql/adapters/configuration.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,6 @@ function adaptConfigurationResponseBody(body, ctx) {
111111
response.ideal = configuration.ideal;
112112
}
113113

114-
if (configuration.kount) {
115-
response.kount = {
116-
kountMerchantId: configuration.kount.merchantId,
117-
};
118-
}
119-
120114
if (configuration.creditCard) {
121115
response.challenges = configuration.creditCard.challenges.map(function (
122116
challenge

src/client/request/graphql/generators/configuration.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ var CONFIGURATION_QUERY =
3636
" routeId " +
3737
" assetsUrl " +
3838
" } " +
39-
" kount { " +
40-
" merchantId " +
41-
" } " +
4239
" masterpass { " +
4340
" merchantCheckoutId " +
4441
" supportedCardBrands " +

src/data-collector/errors.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,12 @@
33
/**
44
* @name BraintreeError.Data Collector - Creation Error Codes
55
* @description Errors that occur when [creating the Data Collector component](./module-braintree-web_data-collector.html#.create).
6-
* @property {MERCHANT} DATA_COLLECTOR_KOUNT_NOT_ENABLED Occurs when Kount is enabled in creation options but is not enabled on the Braintree control panel.
7-
* @property {MERCHANT} DATA_COLLECTOR_KOUNT_ERROR Occurs when Kount errors while setting up.
8-
* @property {MERCHANT} DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS Occurs when Kount or PayPal Fraudnet could not be enabled.
6+
* @property {MERCHANT} DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS Occurs when PayPal Fraudnet could not be enabled.
97
*/
108

119
var BraintreeError = require("../lib/braintree-error");
1210

1311
module.exports = {
14-
DATA_COLLECTOR_KOUNT_NOT_ENABLED: {
15-
type: BraintreeError.types.MERCHANT,
16-
code: "DATA_COLLECTOR_KOUNT_NOT_ENABLED",
17-
message: "Kount is not enabled for this merchant.",
18-
},
19-
DATA_COLLECTOR_KOUNT_ERROR: {
20-
type: BraintreeError.types.MERCHANT,
21-
code: "DATA_COLLECTOR_KOUNT_ERROR",
22-
},
2312
DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS: {
2413
type: BraintreeError.types.MERCHANT,
2514
code: "DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS",

src/data-collector/index.js

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use strict";
22
/** @module braintree-web/data-collector */
33

4-
var kount = require("./kount");
54
var fraudnet = require("./fraudnet");
65
var BraintreeError = require("../lib/braintree-error");
76
var basicComponentVerification = require("../lib/basic-component-verification");
@@ -18,7 +17,7 @@ var errors = require("./errors");
1817
* @global
1918
* @name DataCollector
2019
* @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/data-collector.create|braintree-web.data-collector.create} instead.</strong>
21-
* @classdesc This class is used for fraud integration with PayPal and Kount. Instances of this class have {@link DataCollector#deviceData|deviceData} which is used to correlate user sessions with server transactions.
20+
* @classdesc This class is used for fraud integration with PayPal. Instances of this class have {@link DataCollector#deviceData|deviceData} which is used to correlate user sessions with server transactions.
2221
*/
2322

2423
/**
@@ -83,13 +82,10 @@ var errors = require("./errors");
8382
* @static
8483
* @function create
8584
* @description Creates a DataCollector instance and collects device data based on your merchant configuration. We recommend that you call this method as early as possible, e.g. as soon as your website loads. If that's too early, call it at the beginning of customer checkout.
86-
* **Note:** To use your own Kount ID, contact our support team ([support@braintreepayments.com](mailto:support@braintreepayments.com) or [877.434.2894](tel:877.434.2894)).
8785
* @param {object} options Creation options:
8886
* @param {Client} [options.client] A {@link Client} instance.
8987
* @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.
9088
* @param {boolean} [options.useDeferredClient] Used in conjunction with `authorization`, allows the Data Collector instance to be available right away by fetching the client configuration in the background. When this option is used, {@link GooglePayment#getDeviceData} must be used to collect the device data.
91-
* @param {boolean} [options.kount] Kount fraud data collection will occur if the merchant configuration has it enabled.
92-
* **Note:** the data sent to Kount is asynchronous and may not have completed by the time the data collector create call is complete. In most cases, this will not matter, but if you create the data collector instance and immediately navigate away from the page, the device information may fail to be sent to Kount.
9389
* @param {boolean} [options.paypal] *Deprecated:* PayPal fraud data collection will occur when the DataCollector instance is created.
9490
* @param {string} [options.riskCorrelationId] Pass a custom risk correlation id when creating the data collector.
9591
* @param {string} [options.clientMetadataId] Deprecated. Use `options.riskCorrelationId` instead.
@@ -102,7 +98,7 @@ function create(options) {
10298
var result = {
10399
_instances: [],
104100
};
105-
var data;
101+
var data = {};
106102

107103
return basicComponentVerification
108104
.verify({
@@ -120,34 +116,6 @@ function create(options) {
120116
assetsUrl: createAssetsUrl.create(options.authorization),
121117
name: name,
122118
})
123-
.then(function (client) {
124-
var kountInstance;
125-
var config = client.getConfiguration();
126-
127-
if (options.kount === true && config.gatewayConfiguration.kount) {
128-
try {
129-
kountInstance = kount.setup({
130-
environment: config.gatewayConfiguration.environment,
131-
merchantId: config.gatewayConfiguration.kount.kountMerchantId,
132-
});
133-
} catch (err) {
134-
return Promise.reject(
135-
new BraintreeError({
136-
type: errors.DATA_COLLECTOR_KOUNT_ERROR.type,
137-
code: errors.DATA_COLLECTOR_KOUNT_ERROR.code,
138-
message: err.message,
139-
})
140-
);
141-
}
142-
143-
data = kountInstance.deviceData;
144-
result._instances.push(kountInstance);
145-
} else {
146-
data = {};
147-
}
148-
149-
return Promise.resolve(client);
150-
})
151119
.then(function (client) {
152120
var clientConfiguration = client.getConfiguration();
153121

src/paypal-checkout/paypal-checkout.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ PayPalCheckout.prototype._setupFrameService = function (client) {
435435
* @param {string} [options.planType] Determines the charge pattern for the Recurring Billing Agreement. Can be 'RECURRING', 'SUBSCRIPTION', 'UNSCHEDULED', or 'INSTALLMENTS'.
436436
* @param {planMetadata} [options.planMetadata] When plan type is defined, allows for {@link PayPalCheckout~planMetadata|plan metadata} to be set for the Billing Agreement.
437437
* @param {string} [options.userAuthenticationEmail] Optional merchant-provided buyer email, used to streamline the sign-in process for both one-time checkout and vault flows.
438+
* @param {string} [options.shippingCallbackUrl] Optional server side shipping callback URL to be notified when a customer updates their shipping address or options. A callback request will be sent to the merchant server at this URL.
438439
* @param {callback} [callback] The second argument is a PayPal `paymentId` or `billingToken` string, depending on whether `options.flow` is `checkout` or `vault`. This is also what is resolved by the promise if no callback is provided.
439440
* @example
440441
* // this paypal object is created by the PayPal JS SDK
@@ -669,6 +670,7 @@ PayPalCheckout.prototype._createPaymentResource = function (options, config) {
669670
* @param {(string|number)} options.amount The amount of the transaction, including the amount of the selected shipping option, and all `line_items`.
670671
* * Supports up to 2 decimal digits.
671672
* @param {string} options.currency The currency code of the amount, such as 'USD'. Required when using the Checkout flow.
673+
* @param {string} [options.recipientEmail] Email address of the contact and shipping recipient of the order.
672674
* @param {shippingOption[]} [options.shippingOptions] List of {@link PayPalCheckout~shippingOption|shipping options} offered by the payee or merchant to the payer to ship or pick up their items.
673675
* @param {lineItem[]} [options.lineItems] The {@link PayPalCheckout~lineItem|line items} for this transaction. It can include up to 249 line items.
674676
* @param {object} [options.amountBreakdown] Optional collection of amounts that break down the total into individual pieces.
@@ -1488,6 +1490,10 @@ PayPalCheckout.prototype._formatPaymentResourceData = function (
14881490
payer_email: options.userAuthenticationEmail, // eslint-disable-line camelcase
14891491
};
14901492

1493+
if (options.hasOwnProperty("shippingCallbackUrl")) {
1494+
paymentResource.shippingCallbackUrl = options.shippingCallbackUrl;
1495+
}
1496+
14911497
if (options.flow === "checkout") {
14921498
paymentResource.amount = options.amount;
14931499
paymentResource.currencyIsoCode = options.currency;

src/three-d-secure/external/three-d-secure.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ EventEmitter.createChild(ThreeDSecure);
406406
* @param {boolean} [options.cardAddChallengeRequested] If set to `true`, a card-add challenge will be requested from the issuer. If set to `false`, a card-add challenge will not be requested. If the param is missing, a card-add challenge will only be requested for $0 amount. An authentication created using this flag should only be used for vaulting operations (creation of customers' credit cards or payment methods) and not for creating transactions.
407407
* @param {boolean} [options.cardAdd] *Deprecated:* Use `cardAddChallengeRequested` instead.
408408
* @param {boolean} [options.challengeRequested] If set to true, an authentication challenge will be forced if possible.
409-
* @param {boolean} [options.dataOnlyRequested] Indicates whether to use the data only flow. In this flow, frictionless 3DS is ensured for Mastercard cardholders as the card scheme provides a risk score for the issuer to determine whether to approve. If data only is not supported by the processor, a validation error will be raised. Non-Mastercard cardholders will fallback to a normal 3DS flow.
409+
* @param {boolean} [options.dataOnlyRequested] Indicates whether to use the data-only 3DS flow. If data-only is not supported by the processor, card brand or the transaction is in a PSD2 regulated region, it will fallback to a normal 3DS flow.
410410
* @param {boolean} [options.exemptionRequested] *Deprecated:* Use `requestedExemptionType` instead.
411411
* @param {boolean} [options.requestVisaDAF] Request to use VISA Digital Authentication Framework. If set to true, a Visa DAF authenticated payment credential will be created and/or used for authentication if the merchant is eligible.
412412
* @param {string} [options.merchantName] Allows to override the merchant name that is shown in the challenge.

test/client/unit/request/graphql/adapters/configuration.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ describe("GraphQL Configuration", () => {
9999
routeId: "route_id",
100100
assetsUrl: "https://localhost",
101101
},
102-
kount: {
103-
merchantId: "600000",
104-
},
105102
masterpass: {
106103
merchantCheckoutId: "merchant_checkout_id",
107104
supportedCardBrands: [
@@ -188,9 +185,6 @@ describe("GraphQL Configuration", () => {
188185
],
189186
},
190187
fastlane: true,
191-
kount: {
192-
kountMerchantId: "600000",
193-
},
194188
masterpass: {
195189
merchantCheckoutId: "merchant_checkout_id",
196190
supportedNetworks: [
@@ -319,7 +313,6 @@ describe("GraphQL Configuration", () => {
319313
configurationResponse.applePayWeb
320314
);
321315
expect(adaptedResponse.fastlane).toEqual(true);
322-
expect(adaptedResponse.kount).toEqual(configurationResponse.kount);
323316
expect(adaptedResponse.masterpass).toEqual(
324317
configurationResponse.masterpass
325318
);
@@ -371,7 +364,6 @@ describe("GraphQL Configuration", () => {
371364
fastlane: null,
372365
googlePay: null,
373366
ideal: null,
374-
kount: null,
375367
masterpass: null,
376368
paypal: null,
377369
unionPay: null,
@@ -402,7 +394,6 @@ describe("GraphQL Configuration", () => {
402394
expect(adaptedResponse.payWithVenmo).toBeUndefined();
403395
expect(adaptedResponse.androidPay).toBeUndefined();
404396
expect(adaptedResponse.braintreeApi).toBeUndefined();
405-
expect(adaptedResponse.kount).toBeUndefined();
406397
expect(adaptedResponse.fastlane).toBeUndefined();
407398
expect(adaptedResponse.unionPay).toBeUndefined();
408399
expect(adaptedResponse.visaCheckout).toBeUndefined();

0 commit comments

Comments
 (0)