1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Square SCA

This commit is contained in:
David Bomba 2021-10-03 15:01:49 +11:00
parent 0c5b03f080
commit d25927ac8d
3 changed files with 23 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@ -15,7 +15,7 @@
"/js/clients/payments/eway-credit-card.js": "/js/clients/payments/eway-credit-card.js?id=08ea84e9451abd434cff", "/js/clients/payments/eway-credit-card.js": "/js/clients/payments/eway-credit-card.js?id=08ea84e9451abd434cff",
"/js/clients/payments/mollie-credit-card.js": "/js/clients/payments/mollie-credit-card.js?id=73b66e88e2daabcd6549", "/js/clients/payments/mollie-credit-card.js": "/js/clients/payments/mollie-credit-card.js?id=73b66e88e2daabcd6549",
"/js/clients/payments/paytrace-credit-card.js": "/js/clients/payments/paytrace-credit-card.js?id=c2b5f7831e1a46dd5fb2", "/js/clients/payments/paytrace-credit-card.js": "/js/clients/payments/paytrace-credit-card.js?id=c2b5f7831e1a46dd5fb2",
"/js/clients/payments/square-credit-card.js": "/js/clients/payments/square-credit-card.js?id=f2ad31f8372e9ad94b34", "/js/clients/payments/square-credit-card.js": "/js/clients/payments/square-credit-card.js?id=9ab41f132d0c06b1c648",
"/js/clients/payments/stripe-ach.js": "/js/clients/payments/stripe-ach.js?id=81c2623fc1e5769b51c7", "/js/clients/payments/stripe-ach.js": "/js/clients/payments/stripe-ach.js?id=81c2623fc1e5769b51c7",
"/js/clients/payments/stripe-alipay.js": "/js/clients/payments/stripe-alipay.js?id=665ddf663500767f1a17", "/js/clients/payments/stripe-alipay.js": "/js/clients/payments/stripe-alipay.js?id=665ddf663500767f1a17",
"/js/clients/payments/stripe-credit-card.js": "/js/clients/payments/stripe-credit-card.js?id=a30464874dee84678344", "/js/clients/payments/stripe-credit-card.js": "/js/clients/payments/stripe-credit-card.js?id=a30464874dee84678344",

View File

@ -50,13 +50,29 @@ class SquareCreditCard {
let result = await this.card.tokenize(); let result = await this.card.tokenize();
console.log("square token = " + result.token); console.log("square token = " + result.token);
/* SCA */ /* SCA */
let verificationToken; let verificationToken;
verificationToken = await verifyBuyer( // verificationToken = await verifyBuyer(
this.payments, // this.payments,
result.token // result.token
); // );
const verificationDetails = {
amount: document.querySelector('meta[name=amount]').content,
billingContact: document.querySelector('meta[name=contact]').content,
currencyCode: document.querySelector('meta[name=currencyCode]').content,
intent: 'CHARGE'
};
const verificationResults = await this.payments.verifyBuyer(
result.token,
verificationDetails
);
console.log(" verification tokem = " + verificationResults.token);
verificationToken = verificationResults.token;
console.debug('Verification Token:', verificationToken); console.debug('Verification Token:', verificationToken);