-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into payment-experience
- Loading branch information
Showing
29 changed files
with
2,630 additions
and
2,030 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
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
Empty file.
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"HYPERSWITCH_PUBLISHABLE_KEY": "", | ||
"HYPERSWITCH_SECRET_KEY": "" | ||
} |
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 |
---|---|---|
|
@@ -24,9 +24,10 @@ | |
// -- This will overwrite an existing command -- | ||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) | ||
import "cypress-iframe"; | ||
import { createPaymentBody } from "./utils" | ||
import * as testIds from "../../../src/Utilities/TestUtils.bs"; | ||
// commands.js or your custom support file | ||
const iframeSelector = | ||
const iframeSelector = | ||
"#orca-payment-element-iframeRef-orca-elements-payment-element-payment-element"; | ||
|
||
let globalState = {}; | ||
|
@@ -73,11 +74,11 @@ Cypress.Commands.add( | |
mapping[testIds.cardNoInputTestId] = customerData.threeDSCardNo; | ||
} | ||
let publishableKey = "pk_snd_3b33cd9404234113804aa1accaabe22f"; | ||
let clientSecret:string; | ||
let clientSecret: string; | ||
cy.request({ | ||
method: "GET", | ||
url: "http://localhost:5252/create-payment-intent", | ||
}).then((response: {body: { clientSecret: string }}) => { | ||
}).then((response: { body: { clientSecret: string } }) => { | ||
clientSecret = response.body.clientSecret; | ||
|
||
cy.request({ | ||
|
@@ -145,37 +146,18 @@ Cypress.Commands.add( | |
} | ||
); | ||
|
||
const request = { | ||
currency: "USD", | ||
amount: 6500, | ||
authentication_type: "three_ds", | ||
description: "Joseph First Crypto", | ||
email: "[email protected]", | ||
connector_metadata: { | ||
noon: { | ||
order_category: "applepay", | ||
}, | ||
}, | ||
metadata: { | ||
udf1: "value1", | ||
new_customer: "true", | ||
login_date: "2019-09-10T10:11:12Z", | ||
}, | ||
// customer_id: "hyperswitch_sdk_demo_test_id", | ||
business_country: "US", | ||
business_label: "default", | ||
}; | ||
Cypress.Commands.add("createPaymentIntent", () => { | ||
|
||
Cypress.Commands.add("createPaymentIntent", (secretKey: string, createPaymentBody: any) => { | ||
return cy | ||
.request({ | ||
method: "POST", | ||
url: "https://sandbox.hyperswitch.io/payments", | ||
headers: { | ||
"Content-Type": "application/json", | ||
Accept: "application/json", | ||
"api-key": "snd_c691ade6995743bd88c166ba509ff5da", | ||
"api-key": secretKey, | ||
}, | ||
body: JSON.stringify(request), | ||
body: JSON.stringify(createPaymentBody), | ||
}) | ||
.then((response) => { | ||
expect(response.headers["content-type"]).to.include("application/json"); | ||
|
@@ -188,6 +170,6 @@ Cypress.Commands.add("createPaymentIntent", () => { | |
}); | ||
}); | ||
|
||
Cypress.Commands.add("getGlobalState", (key: number) => { | ||
Cypress.Commands.add("getGlobalState", (key: any) => { | ||
return globalState[key]; | ||
}); |
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.