fix tests for stripe (#2260)
This commit is contained in:
parent
15274e14d7
commit
43be1d60e2
2 changed files with 15 additions and 13 deletions
2
.github/workflows/tests-nightly.yml
vendored
2
.github/workflows/tests-nightly.yml
vendored
|
@ -135,6 +135,8 @@ jobs:
|
|||
CYPRESS_mailHogUrl: ${{ secrets.CYPRESS_MAILHOG }}
|
||||
COMMIT_INFO_MESSAGE: All tests triggered via ${{ github.event_name}} on ${{ steps.get-env-uri.outputs.ENV_URI }}
|
||||
CYPRESS_grepTags: ${{ github.event.inputs.tags }}
|
||||
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }}
|
||||
STRIPE_PUBLIC_KEY: ${{ secrets.STRIPE_PUBLIC_KEY }}
|
||||
with:
|
||||
parallel: true
|
||||
group: 'UI - Chrome'
|
||||
|
|
|
@ -8,7 +8,7 @@ export function getPaymentMethodStripeId({
|
|||
cardNumber,
|
||||
cvc,
|
||||
expMonth,
|
||||
expYear
|
||||
expYear,
|
||||
}) {
|
||||
return cy.request({
|
||||
url: urlList.stripeApiPaymentMethods,
|
||||
|
@ -21,11 +21,11 @@ export function getPaymentMethodStripeId({
|
|||
"card[exp_month]": expMonth,
|
||||
"card[exp_year]": expYear,
|
||||
pasted_fields: "number",
|
||||
key: stripePublicKey
|
||||
key: stripePublicKey,
|
||||
},
|
||||
headers: {
|
||||
Authorization: stripeAuthBearer
|
||||
}
|
||||
Authorization: stripeAuthBearer,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -36,15 +36,15 @@ export function sendConfirmationToStripe(paymentMethodId, confirmationId) {
|
|||
form: true,
|
||||
failOnStatusCode: false,
|
||||
headers: {
|
||||
Authorization: stripeAuthBearer
|
||||
Authorization: stripeAuthBearer,
|
||||
},
|
||||
body: {
|
||||
payment_method: paymentMethodId,
|
||||
return_url: Cypress.config().baseUrl,
|
||||
webauthn_uvpa_available: "true",
|
||||
spc_eligible: "false",
|
||||
key: stripePublicKey
|
||||
}
|
||||
key: stripePublicKey,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ export function confirmThreeDSecure(nextActionUrl, withSuccess = true) {
|
|||
const { body } = new DOMParser().parseFromString(resp.body, "text/html");
|
||||
const formUrl = body.querySelector('[id="form"]').getAttribute("action");
|
||||
const source = body
|
||||
.querySelector('[name="source"]')
|
||||
.querySelector('[name="source_slug"]')
|
||||
.getAttribute("value");
|
||||
returnUrl = body
|
||||
.querySelector('[name="return_url"]')
|
||||
|
@ -71,7 +71,7 @@ export function confirmThreeDSecure(nextActionUrl, withSuccess = true) {
|
|||
.getAttribute("value");
|
||||
const usage = body.querySelector('[name="usage"]').getAttribute("value");
|
||||
|
||||
const url = `${formUrl}?source=${source}&livemode=false&type=three_d_secure&pass_through=&return_url=${returnUrl}&amount=${amount}¤cy=
|
||||
const url = `${formUrl}?source_slug=${source}&livemode=false&type=three_d_secure&pass_through=&return_url=${returnUrl}&amount=${amount}¤cy=
|
||||
${currency}&usage=${usage}`;
|
||||
cy.request(url);
|
||||
})
|
||||
|
@ -82,8 +82,8 @@ export function confirmThreeDSecure(nextActionUrl, withSuccess = true) {
|
|||
form: true,
|
||||
body: {
|
||||
PaRes: "success",
|
||||
MD: ""
|
||||
}
|
||||
MD: "",
|
||||
},
|
||||
});
|
||||
})
|
||||
.then(resp => {
|
||||
|
@ -99,8 +99,8 @@ export function confirmThreeDSecure(nextActionUrl, withSuccess = true) {
|
|||
body: {
|
||||
PaRes: paRes,
|
||||
MD: "",
|
||||
Merchant: merchant
|
||||
}
|
||||
Merchant: merchant,
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue