Hi All,
Banging my head against a wall here on implementing the SCA verification in the Payment Form.
Using Sandbox, and attempting to verify with the test nonce set as "cnon:card-nonce-requires-verification. Using test card to trigger what I would think would be an authentication step.
Basic javascript is:
cardNonceResponseReceived: function(errors, nonce, cardData, billingContact, shippingContact) {
document.getElementById('card-nonce').value = nonce;
total = document.getElementById('total');
const verificationDetails = {
amount: total,
intent: "CHARGE", //Allowed values: "CHARGE", "STORE"
locationId : locationId,
currencyCode: 'GBP',
billingContact: {
familyName: document.getElementById('familyName').value,
givenName: document.getElementById('givenName').value,
country: document.getElementById('country').value,
city: document.getElementById('city').value,
}
};
try {
nonce= 'cnon:card-nonce-requires-verification';
paymentForm.verifyBuyer( nonce, verificationDetails,
function callback(err,verification) {
if (err == null) {
document.getElementById('buyerVerification-token').value = verification;
}
});
document.getElementById('nonce-form').submit();
Everything seems to proceed until the submit is triggered. Nothing is added to the hidden field byerVerification-token (unsure if Iām meant to pass this at all?).
then I receive the following errors in console:
1: [Error] Failed to load resource: the server responded with a status of 400 () https://connect.squareupsandbox.com/v2/analytics/verifications
2: XMLHttpRequest cannot load https://pci-connect.squareupsandbox.com/v2/v?version=ca1c99ac2e due to access control checks. (repeated 3 times)
Then the form āsubmitsā to the āprocess.phpā page, where it tells me itās failed.
Thereās no verification step, and the transaction fails on the following page (obviously)
Can anyone point me in the direction fo where I may look to fix?
Ben