AfterPay not working on production

After testing and successfully integrating with AfterPay via the JS and .NET SDK we are getting this error for a user on production. There is no message that helps us diagnose this. We need help.

“errors”: [
{
“code”: “GENERIC_DECLINE”,
“detail”: “Authorization error: ‘GENERIC_DECLINE’”,
“category”: “PAYMENT_METHOD_ERROR”
}

Unfortunately the generic decline is all that we are able to provide. The decline comes from the user’s bank and for fraud protection purposes they do not typically provide a reason. AfterPay charges the user’s card for an initial payment.

In these scenarios it is worthwhile to try:

  1. Retry the payment after a minute or so
  2. Contact the card issuer for more information
  3. If the bank can’t help, try a new card

Unfortunately this is not it. The actually owner tried it themselves and received same message. They had their customer do it from the Square portal with AfterPay and it worked. So this unacceptable that you can’t directly help us verify the request and response to make sure we did everything correctly, especially since Sandbox worked fine.

This is why we direct our customers to use Stripe or PayPal.

@Bryan-Square can you help us?

@BrianSquare can we get some help here. We are working with Mason McMillin who is a Square Account Manager on behalf of a customer of Square. We are getting no help from you guys on this. Sandbox works, afterpay on portal works, after on production does not work. No clear error message. Need you to look at request/response to verify all looks good.

Could you send me your merchant id and application id for sandbox and production? If you have a payment I can check if there is more info on my side.

I dont want to send those in a post? How can I message you directly?

It looks like Afterpay is rejecting the payment because the checkout token was created for a different Square location than the location processing the payment.

The checkout was created for location 1 and create payment attempted to process it for location 2 . (location ids direct messaged)

When you initiate the payments api make sure you use the seller’s production location id and not the developer application’s location id.

const payments = Square.payments(
  '{YOUR_SANDBOX_APPLICATION_ID}',
  '{location 2}'
); 

So when you submit the payment token it should match 1:1

{
  "source_id": "{new Afterpay token}",
  "location_id": "{location 2}",
  "amount_money": {
    "amount": 1111,
    "currency": "USD"
  }
}

Thank you for sending a payment id to trace!

I was able to confirm in our logs that the webpayments sdk was initiated with your applications location and the payment was submitted without a location which defaults to the seller’s. If you could change the code that registers the payment sdk as shown above your issue should be resolved.

That worked! Location ID was the same on both and went through. Please update the response error so we can fix this ourselves.

This has been reported a couple of times recently. I’ll see what I can do. Glad it is working though!