Hello @Bryan-Square ,
Thanks for your response !
I have another question regarding this topics and the Web Payment SDK. I’m going to ask the question here in this topic because it concerns the javascript code and the backend…
If I change the value of ‘intent’ in JavaScript from ‘CHARGE_AND_STORE’ to ‘CHARGE’ the payment not successfull with this error : The verification token provided is invalid.
Response of ERROR
array (size=1)
0 =>
object(Square\Models\Error)[75]
private 'category' => string 'INVALID_REQUEST_ERROR' (length=21)
private 'code' => string 'BAD_REQUEST' (length=11)
private 'detail' => string 'The verification token provided is invalid.' (length=43)
private 'field' => string 'verification_token' (length=18)
My code :
const verificationDetails = {
amount: '32.00',
billingContact: {
addressLines: ['123 Main Street', 'Apartment 1'],
familyName: 'Doe',
givenName: 'John',
email: '[email protected]',
country: 'GB',
phone: '3214563987',
region: 'LND',
city: 'London',
},
currencyCode: 'CAD',
intent: 'CHARGE', //intent: 'CHARGE_AND_STORE',
};
Note that I use this form to create recurring subscriptions for my members.
Also, I do not want to keep the credit card information (card number, expiration date and CVV)
So that’s why I wanted to change the value of ‘intent’ from ‘CHARGE_AND_STORE’ to ‘CHARGE’
Because I saw a warning message that mentions this :
Important
Always ask customers for permission before saving their card information. For example, include a checkbox in your purchase flow that customers can select to specify that they want to save their card information for future purchases.
Linking cards on file without obtaining customer permission can result in your application being disabled without notice.
URL of this important message : https://developer.squareup.com/docs/cards-api/overview
So, I want to respect all the guidelines!
Is it OK to leave the value of ‘intent’ to ‘CHARGE_AND_STORE’ even if I don’t keep credit card information?? Or do I have to modify my code in my backend?
Thank you and have a great day!
Pascal