Skip to content

Commit

Permalink
Release braintree-web 3.112.0 source
Browse files Browse the repository at this point in the history
  • Loading branch information
braintreeps committed Nov 7, 2024
1 parent 6490db5 commit fdbcd5d
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 16 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## 3.112.0

- Local Payment
- Remove support of `bic` field for iDeal payments
- Update documentation for redirectUrl
- Utility Functions
- Ensure camelCaseToSnakeCase handles null values correctly

## 3.111.1

- Node.js
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "braintree-web",
"version": "3.111.1",
"version": "3.112.0",
"license": "MIT",
"main": "src/index.js",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion scripts/release
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ release_source() {
local CP_CMD="cp"
if [[ "$(uname)"="Darwin" ]]; then
# Coreutils version of cp supports --parents, mac default one doesn't
CP_CMD="cp"
CP_CMD="gcp"
fi

git ls-files | egrep -v "$(join '|' $SOURCE_IGNORES)" | xargs "$CP_CMD" --parents -t "$BRAINTREE_JS_SOURCE_DEST"
Expand Down
4 changes: 3 additions & 1 deletion src/lib/camel-case-to-snake-case.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ function transformKey(key) {
function camelCaseToSnakeCase(input) {
var converted;

if (Array.isArray(input)) {
if (input === null) {
converted = null;
} else if (Array.isArray(input)) {
converted = [];

input.forEach(function (x) {
Expand Down
2 changes: 0 additions & 2 deletions src/local-payment/external/local-payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ LocalPayment.prototype._initialize = function () {
* @property {string} givenName First name of the customer.
* @property {string} surname Last name of the customer.
* @property {string} phone Phone number of the customer.
* @property {string} bic Bank Identification Code of the customer (specific to iDEAL transactions).
* @property {boolean} recurrent Enable recurrent payment.
* @property {string} customerId The customer's id in merchant's system (required for recurrent payments).
* @property {boolean} shippingAddressRequired Indicates whether or not the payment needs to be shipped. For digital goods, this should be false. Defaults to false.
Expand Down Expand Up @@ -449,7 +448,6 @@ LocalPayment.prototype.startPayment = function (options) {
billingAddress = options.billingAddress || {};
params = {
amount: options.amount,
bic: options.bic,
billingAddress: {
line1: billingAddress.streetAddress,
line2: billingAddress.extendedAddress,
Expand Down
2 changes: 1 addition & 1 deletion src/local-payment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var parse = require("../lib/querystring").parse;
* @param {Client} [options.client] A {@link Client} instance.
* @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.
* @param {string} [options.merchantAccountId] A non-default merchant account ID to use for tokenization and creation of the authorizing transaction. Braintree strongly recommends specifying this parameter.
* @param {redirectUrl} When provided, triggers full page redirect flow instead of popup flow.
* @param {string} [options.redirectUrl] When provided, triggers full page redirect flow instead of popup flow.
* @param {callback} callback The second argument, `data`, is the {@link LocalPayment} instance.
* @example <caption>Using the local payment component to set up an iDEAL button</caption>
* var idealButton = document.querySelector('.ideal-button');
Expand Down
22 changes: 22 additions & 0 deletions test/lib/unit/camel-case-to-snake-case.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,26 @@ describe("camelCaseToSnakeCase", () => {

expect(camelCaseToSnakeCase(arrayOfValues)).toEqual(expectedArrayOfValues);
});

it("handles null values", () => {
const input = {
nullableValue: null,
};
const expectedOutput = {
nullable_value: null,
};

expect(camelCaseToSnakeCase(input)).toEqual(expectedOutput);
});

it("handles undefined values", () => {
const input = {
undefinedValue: undefined, // eslint-disable-line no-undefined
};
const expectedOutput = {
undefined_value: undefined, // eslint-disable-line no-undefined
};

expect(camelCaseToSnakeCase(input)).toEqual(expectedOutput);
});
});
8 changes: 0 additions & 8 deletions test/local-payment/unit/external/local-payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ describe("LocalPayment", () => {
phoneCountryCode: undefined,
shippingAmount: undefined,
merchantAccountId: "merchant-account-id",
bic: undefined,
blikOptions: {
// eslint-disable-next-line camelcase
level_0: {
Expand Down Expand Up @@ -584,7 +583,6 @@ describe("LocalPayment", () => {
surname: "Last",
email: "[email protected]",
phone: "1234",
bic: "ABGANL6A",
displayName: "My Brand!",
address: {
streetAddress: "123 Address",
Expand Down Expand Up @@ -745,7 +743,6 @@ describe("LocalPayment", () => {
phoneCountryCode: "49",
shippingAmount: "2.00",
merchantAccountId: "merchant-account-id",
bic: "ABGANL6A",
},
});
});
Expand Down Expand Up @@ -812,7 +809,6 @@ describe("LocalPayment", () => {
phoneCountryCode: "49",
shippingAmount: "2.00",
merchantAccountId: "merchant-account-id",
bic: "ABGANL6A",
},
});
});
Expand Down Expand Up @@ -1072,7 +1068,6 @@ describe("LocalPayment", () => {
surname: "Last",
email: "[email protected]",
phone: "1234",
bic: "ABGANL6A",
displayName: "My Brand!",
address: {
streetAddress: "123 Address",
Expand Down Expand Up @@ -1221,7 +1216,6 @@ describe("LocalPayment", () => {
phoneCountryCode: undefined,
shippingAmount: undefined,
merchantAccountId: "merchant-account-id",
bic: "ABGANL6A",
},
});
});
Expand Down Expand Up @@ -1284,7 +1278,6 @@ describe("LocalPayment", () => {
phoneCountryCode: undefined,
shippingAmount: undefined,
merchantAccountId: "merchant-account-id",
bic: "ABGANL6A",
},
});
});
Expand Down Expand Up @@ -1347,7 +1340,6 @@ describe("LocalPayment", () => {
postalCode: "60654",
countryCode: "US",
merchantAccountId: "merchant-account-id",
bic: "ABGANL6A",
},
});
});
Expand Down

0 comments on commit fdbcd5d

Please sign in to comment.