Whitelabel Error Page displayed upon payment

Error: This application has no explicit mapping for /error, so you are seeing this as a fallback.

This occurs whenever I attempt to create a payment via API with Sandbox credentials using endpoint: paymentsApi.createPayment (NodeJS)

Internal 500 status code from Square

What are the steps to replicate this? Are you able to replicate this a lot? :slightly_smiling_face:

From your Web Payments Quick Start example:

async function verifyBuyer(payments, token) {
const verificationDetails = {
amount: ‘1.00’,
billingContact: {
givenName: ‘John’,
familyName: ‘Doe’,
email: ‘[email protected]’,
phone: ‘3214563987’,
addressLines: [‘123 Main Street’, ‘Apartment 1’],
city: ‘London’,
state: undefined,
countryCode: ‘GB’,
},
currencyCode: ‘GBP’,
intent: ‘STORE’,
};
—> it appears to be at this point that it stops proceeding. Verification details appear to be correct and I have the token and payment parameters.
const verificationResults = await payments.verifyBuyer(
token,
verificationDetails,
);
return verificationResults.token;
}

Note: After some time the Error warning and the Verification modal close and then the payments.verifyBuyer method resolves returning with a token

The intent is set to STORE so a token with that intent can’t be used to charge. You save the card with the Cards API then charge the stored card on file. :slightly_smiling_face:

I am storing the card then using the card ID like so to create a charge:

const paymentResponse = await squareClient.paymentsApi.createPayment({
sourceId: cardId,
locationId: locationId,

,
customerDetails: {
customerInitiated: false,
sellerKeyedIn: false
}
});

This approach has worked up until this error from the verification modal

Are you calling verifyBuyer again with the intent set to CHARGE? If not that would be why it’s failing at when trying to charge it. Also have you seen our charge and store card on file? :slightly_smiling_face:

I have implemented the code with CHARGE_AND_STORE and amended my server side code to accommodate. Results in the exact same error - is there an error path implemented for SANDBOX Verification window as that appears to be where the error is occuring and not determined by code that I can affect…?

error-screenshot

Is this happening within an iframe or are you using a modal? :slightly_smiling_face:

Neither. The verification window launches of it’s own accord at around the VerifyBuyer point

I am loading the squarecdn via <script type="text/javascript" src="//sandbox.web.squarecdn.com/v1/square.js"></script>

This first began when I requested a payment but my SSL certificate had expired. This has since been renewed with no changes to the domains that it secures…

Is your page hosted? If so what’s the page address? :slightly_smiling_face:

I would be happy to disclose this however as this appears to be nuanced can we take this into my direct messages? Or email?

Yeah, of course. Feel free to reach out in this form and it will get to me. :slightly_smiling_face:

am also seeing this same error on a new laravel dvelopment project currently being run on localhost - my set-up appears identical to @lmitchsmith so would appreciate any updates/advise being posted here