mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Clean up
This commit is contained in:
parent
c97b176171
commit
6711ab71e4
@ -43,28 +43,12 @@ class SquareCreditCard {
|
||||
}
|
||||
}
|
||||
|
||||
// ,
|
||||
// function(err,verification) {
|
||||
// if (err == null) {
|
||||
// console.log("no error");
|
||||
// console.log(verification);
|
||||
// verificationToken = verificationResults.token;
|
||||
|
||||
// }
|
||||
|
||||
// console.log(err);
|
||||
|
||||
// die("verify buyer");
|
||||
// }
|
||||
|
||||
async completePaymentWithoutToken(e) {
|
||||
document.getElementById('errors').hidden = true;
|
||||
e.target.parentElement.disabled = true;
|
||||
|
||||
let result = await this.card.tokenize();
|
||||
|
||||
console.log('square token = ' + result.token);
|
||||
|
||||
/* SCA */
|
||||
let verificationToken;
|
||||
|
||||
@ -79,8 +63,6 @@ class SquareCreditCard {
|
||||
intent: 'CHARGE',
|
||||
};
|
||||
|
||||
console.log(verificationDetails);
|
||||
|
||||
const verificationResults = await this.payments.verifyBuyer(
|
||||
result.token,
|
||||
verificationDetails
|
||||
@ -88,14 +70,8 @@ class SquareCreditCard {
|
||||
|
||||
verificationToken = verificationResults.token;
|
||||
} catch (typeError) {
|
||||
console.error(typeError);
|
||||
e.target.parentElement.disabled = true
|
||||
}
|
||||
// console.log(" verification tokem = " + verificationToken.token);
|
||||
|
||||
// verificationToken = verificationResults.token;
|
||||
|
||||
console.debug('Verification Token:', verificationToken);
|
||||
|
||||
document.querySelector(
|
||||
'input[name="verificationToken"]'
|
||||
@ -131,8 +107,6 @@ class SquareCreditCard {
|
||||
|
||||
/* SCA */
|
||||
async verifyBuyer(token) {
|
||||
console.log('in verify buyer');
|
||||
|
||||
const verificationDetails = {
|
||||
amount: document.querySelector('meta[name=amount]').content,
|
||||
billingContact: document.querySelector('meta[name=square_contact]')
|
||||
@ -147,8 +121,6 @@ class SquareCreditCard {
|
||||
verificationDetails
|
||||
);
|
||||
|
||||
console.log(' verification toke = ' + verificationResults.token);
|
||||
|
||||
return verificationResults.token;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user