Skip to content

Commit 472361b

Browse files
committed
Release Braintree-web 3.116.1 source
1 parent 9063534 commit 472361b

File tree

5 files changed

+39
-12
lines changed

5 files changed

+39
-12
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CHANGELOG
22

3+
## 3.116.1
4+
5+
- Fastlane
6+
- Fix bug that occured when `termsAndConditionsCountry` was not available for tokenization
7+
38
## 3.116.0
49

510
- Fastlane

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "braintree-web",
3-
"version": "3.116.0",
3+
"version": "3.116.1",
44
"license": "MIT",
55
"main": "src/index.js",
66
"private": true,

src/hosted-fields/internal/format-card-request-data.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,22 @@ module.exports = function (data) {
3333
// connectCheckout are the tokenize options from the Fastlane SDK
3434
if ("metadata" in data && "connectCheckout" in data.metadata) {
3535
result.fastlane = {
36-
terms_and_conditions_version:
37-
"termsAndConditionsVersion" in data.metadata.connectCheckout
38-
? data.metadata.connectCheckout.termsAndConditionsVersion
39-
: "",
40-
terms_and_conditions_country:
41-
"termsAndConditionsCountry" in data.metadata.connectCheckout
42-
? data.metadata.connectCheckout.termsAndConditionsCountry
43-
: "",
36+
auth_assertion: data.metadata.connectCheckout.authAssertion,
4437
has_buyer_consent:
4538
"hasBuyerConsent" in data.metadata.connectCheckout
4639
? data.metadata.connectCheckout.hasBuyerConsent
4740
: false,
48-
auth_assertion: data.metadata.connectCheckout.authAssertion,
4941
};
42+
43+
if ("termsAndConditionsVersion" in data.metadata.connectCheckout) {
44+
result.fastlane.terms_and_conditions_version =
45+
data.metadata.connectCheckout.termsAndConditionsVersion;
46+
}
47+
48+
if ("termsAndConditionsCountry" in data.metadata.connectCheckout) {
49+
result.fastlane.terms_and_conditions_country =
50+
data.metadata.connectCheckout.termsAndConditionsCountry;
51+
}
5052
}
5153

5254
if ("billingAddress" in data) {

test/hosted-fields/unit/internal/format-card-request-data.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,26 @@ describe("formatCardRequestData", () => {
139139
});
140140
});
141141

142+
it("excludes termsAndConditionsCountry from Connect (Fastlane) metadata if not sent", () => {
143+
const result = formatCardRequestData({
144+
metadata: {
145+
connectCheckout: {
146+
termsAndConditionsVersion: "1",
147+
hasBuyerConsent: true,
148+
authAssertion: "test-auth-assertion",
149+
},
150+
},
151+
});
152+
153+
expect(result).toEqual({
154+
fastlane: {
155+
terms_and_conditions_version: "1",
156+
has_buyer_consent: true,
157+
auth_assertion: "test-auth-assertion",
158+
},
159+
});
160+
});
161+
142162
it("includes all data", () => {
143163
const inputData = {
144164
cardholderName: "First Last",

0 commit comments

Comments
 (0)