-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release braintree-web 3.100.0 source
Co-authored-by: Joe Plukarski <[email protected]>
- Loading branch information
1 parent
288ea4f
commit eb5b835
Showing
8 changed files
with
141 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -327,6 +327,8 @@ describe("LocalPayment", () => { | |
paymentTypeCountryCode: "PL", | ||
amount: "10.00", | ||
intent: "sale", | ||
recurrent: undefined, | ||
merchantOrPartnerCustomerId: undefined, | ||
billingAddress: { | ||
line1: undefined, | ||
line2: undefined, | ||
|
@@ -601,6 +603,8 @@ describe("LocalPayment", () => { | |
paymentTypeCountryCode: "NL", | ||
amount: "10.00", | ||
intent: "sale", | ||
recurrent: undefined, | ||
merchantOrPartnerCustomerId: undefined, | ||
billingAddress: { | ||
line1: "Prinzregentenstr 99991658", | ||
line2: undefined, | ||
|
@@ -666,6 +670,8 @@ describe("LocalPayment", () => { | |
paymentTypeCountryCode: "NL", | ||
amount: "10.00", | ||
intent: "sale", | ||
recurrent: undefined, | ||
merchantOrPartnerCustomerId: undefined, | ||
billingAddress: { | ||
line1: "Prinzregentenstr 99991658", | ||
line2: undefined, | ||
|
@@ -937,6 +943,18 @@ describe("LocalPayment", () => { | |
}); | ||
}); | ||
|
||
it("errors when no customerId param provided for recurrent payment", () => { | ||
testContext.options.recurrent = true; | ||
|
||
return testContext.localPayment | ||
.startPayment(testContext.options) | ||
.catch(({ code }) => { | ||
expect(code).toBe( | ||
"LOCAL_PAYMENT_START_PAYMENT_MISSING_REQUIRED_OPTION" | ||
); | ||
}); | ||
}); | ||
|
||
it("errors when authorization is already in progress", () => { | ||
testContext.localPayment._authorizationInProgress = true; | ||
|
||
|
@@ -967,6 +985,71 @@ describe("LocalPayment", () => { | |
paymentTypeCountryCode: "NL", | ||
amount: "10.00", | ||
intent: "sale", | ||
recurrent: undefined, | ||
merchantOrPartnerCustomerId: undefined, | ||
billingAddress: { | ||
line1: undefined, | ||
line2: undefined, | ||
city: undefined, | ||
state: undefined, | ||
postalCode: undefined, | ||
countryCode: undefined, | ||
}, | ||
birthDate: undefined, | ||
correlationId: undefined, | ||
discountAmount: undefined, | ||
experienceProfile: { | ||
brandName: "My Brand!", | ||
noShipping: false, | ||
customerServiceInstructions: undefined, | ||
locale: undefined, | ||
}, | ||
currencyIsoCode: "USD", | ||
firstName: "First", | ||
lastName: "Last", | ||
payerEmail: "[email protected]", | ||
phone: "1234", | ||
line1: "123 Address", | ||
line2: "Unit 1", | ||
city: "Chicago", | ||
state: "IL", | ||
postalCode: "60654", | ||
countryCode: "US", | ||
lineItems: undefined, | ||
phoneCountryCode: undefined, | ||
shippingAmount: undefined, | ||
merchantAccountId: "merchant-account-id", | ||
bic: "ABGANL6A", | ||
}, | ||
}); | ||
}); | ||
}); | ||
|
||
it("creates a payment resource for a recurrent payment", () => { | ||
const client = testContext.client; | ||
|
||
testContext.options.recurrent = true; | ||
testContext.options.customerId = "12345678"; | ||
|
||
testContext.frameServiceInstance.open.mockImplementation( | ||
yields(null, { foo: "bar" }) | ||
); | ||
|
||
return testContext.localPayment | ||
.startPayment(testContext.options) | ||
.then(() => { | ||
expect(client.request).toHaveBeenCalledWith({ | ||
method: "post", | ||
endpoint: "local_payments/create", | ||
data: { | ||
cancelUrl: `https://example.com:9292/web/${VERSION}/html/local-payment-redirect-frame.min.html?channel=service-id&r=https%3A%2F%2Fexample.com%2Ffallback&t=Button%20Text&c=1`, | ||
returnUrl: `https://example.com:9292/web/${VERSION}/html/local-payment-redirect-frame.min.html?channel=service-id&r=https%3A%2F%2Fexample.com%2Ffallback&t=Button%20Text`, | ||
fundingSource: "ideal", | ||
paymentTypeCountryCode: "NL", | ||
amount: "10.00", | ||
intent: "sale", | ||
recurrent: true, | ||
merchantOrPartnerCustomerId: "12345678", | ||
billingAddress: { | ||
line1: undefined, | ||
line2: undefined, | ||
|
@@ -1028,6 +1111,8 @@ describe("LocalPayment", () => { | |
paymentTypeCountryCode: "NL", | ||
amount: "10.00", | ||
intent: "sale", | ||
recurrent: undefined, | ||
merchantOrPartnerCustomerId: undefined, | ||
experienceProfile: { | ||
brandName: "My Brand!", | ||
noShipping: false, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.