Apple Pay web sdk with auth + deferred capture with different amount

Yes. Its the same Square account to which I have paid with apple pay and also I have logged into it.

If you clear your cache and restart the browser does that work? Also if you inspect the page and load the link are there any console errors or network request failures? :slightly_smiling_face:

Here are the error what i am seeing in the inspect

Are you the owner or an administrator of the account? The error is that you don’t have permissions to see the payments. :slightly_smiling_face:

@Bryan-Square When I checked my Apple Pay transaction in my Apple Pay. It showed Doing Business as NEW MERCHANT. I am not sure if you are sending it. If yes, Could you please let me know how can we change this NEW MERCHANT to our business name?

New Merchant isn’t something thats include with the payment. That looks like something that your bank reports. You’ll want to reach out to them for more information. :slightly_smiling_face:

@Bryan-Square
I am trying with this below code to capture the user email when generating the cnon token

function buildPaymentRequest(payments) {
   return payments.paymentRequest({
    countryCode: 'US',
    currencyCode: 'USD',
    requestBillingContact: true,
    requestShippingContact: true,
    total: {
     amount: '1.00',
     label: 'Total',
pending: true
    },
   });
  }

Please let me know how can I capture user email during the tokenization?

Are you also adding the form fields to collect the buyers email address on the form? :slightly_smiling_face:

This is in Apple pay. We want to capture the user email when we tokenize it

With Apple pay the BillingContact and the ShippingContact will be retuned if it’s part of the Apple Pay profile. If not then its not part of the profile. :slightly_smiling_face:

Hi @Bryan-Square
How can we avoid these error when capturing/completing Apple Pay payment using the verification token?

We are generating verification token by using INTENT OF CHARGE with $1

const verificationDetails = {
          billingContact:  {
            addressLines: ['123 Main Street', 'Apartment 1'],
            familyName: 'Doe',
            givenName: 'John',
            email: '[email protected]',
            country: 'US',
            phone: '8297373475',
            region: 'ny',
            city: 'NewYork',
          },
          amount: '1',
          currencyCode: 'USD',
          intent: 'CHARGE',
        };

And capturing the payment using below payment API

Request: POST /v2/payments

{
  "source_id": "[redacted]",
  "idempotency_key": "cb0f6e04-3fc7-4a2f-97d4-14c8b8a3b819",
  "amount_money": {
    "amount": 450,
    "currency": "USD"
  },
  "customer_id": "",
  "location_id": "",
  "verification_token": ""
}
  

We are receiving multiple error where the payment capture is getting failed. Below are the few error responses:

"errors": [
    {
      "category": "PAYMENT_METHOD_ERROR",
      "code": "GENERIC_DECLINE",
      "detail": "Authorization error: 'GENERIC_DECLINE'"
    },
    {
      "category": "PAYMENT_METHOD_ERROR",
      "code": "ADDRESS_VERIFICATION_FAILURE",
      "detail": "Authorization error: 'ADDRESS_VERIFICATION_FAILURE'"
    }
  ]
"errors": [
    {
      "category": "PAYMENT_METHOD_ERROR",
      "code": "TRANSACTION_LIMIT",
      "detail": "Authorization error: 'TRANSACTION_LIMIT'"
    }
  ],

We are live with Apple Pay AUTHORIZED with a verification_token. Please respond ASAP. How can we prevent errors while capturing the payment using /v2/payments?

Are you getting a lot of these errors? A GENERIC_DECLINE means a customer need to reach out to their bank. An ADDRESS_VERIFICATION_FAILURE means the address provided doesn’t match what the bank was verifying against and the customer needs update the address associated to Apple Pay. Lastly, the TRANSACTION_LIMIT error means that the payment amount exceeded the available balance for that card. :slightly_smiling_face:

@Bryan-Square Yes, I am afraid this number would increase. Are you allowing the verification token generation without proper funds and verification of address? Can’t we prevent these errors at the verification token generation state?

If I increase the INTENT of CHARGE amount from $1 to $5 during token generation. Will it restrict the users with deficit funds?

const verificationDetails = {
          billingContact:  {
            addressLines: ['123 Main Street', 'Apartment 1'],
            familyName: 'Doe',
            givenName: 'John',
            email: '[email protected]',
            country: 'US',
            phone: '8297373475',
            region: 'ny',
            city: 'NewYork',
          },
          amount: '5',
          currencyCode: 'USD',
          intent: 'CHARGE',
        };

Please reply ASAP. It is urgent

No, you can’t prevent the errors at the verification token generation stage. This is because the verification token creation doesn’t do any validation of the information you pass it. It just encrypts the data in the form of a token. You can pass it nothing and it will give you a token. Only when the payment is being processed is when the information that was used to create the token is validated. :slightly_smiling_face:

@Bryan-Square Is there a way to recoup the amount from these transactions which ended up with this kind of errors? Please respond ASAP!

You’ll have to re-process payments with the customers. We can’t re-process any declined payments. Were the customers not prompted to retry or provide another form of payment?

@Bryan-Square Can you please let us know if the updatePayment API will do any AVS verification on our behalf? Please reply ASAP!

I’m not sure what you mean. You can only call UpdatePayment on an AUTHORIZED payment which would have already checked AVS.

@Bryan-Square
Can we reuse the same verification_token & source_id token in following api’s with Apple Pay

When we AUTHORIZE a payment with autocomplete: false, so that it will go through checked AVS. And then if AVS is success, we will use same verification_token & source_id complete payment with autocomplete: true. Will Square allow us to use same token to call update & complete sequentially?

Please reply ASAP!

No, those are one time use tokens. You have to re-generate the source_id and verification_token for any new payments.

When you AUTHORIZE a payment you can check the card_details avs_status if you want to know the status is prior to calling CompletePayment. Also CompletePayment only accepts a payment_id. The verification_token and source_id aren’t passed in that request. :slightly_smiling_face: