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

**URL:** <https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560>\
**Category:** Questions\
**Tags:** payments-api, web-payments-sdk\
**Created:** [February 13, 2023, 5:55pm UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560 "2023-02-13T17:55:14Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![anveshtokala](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@anveshtokala](https://developer.squareup.com/forums/u/anveshtokala)\
**Post date:** [April 20, 2023, 7:10pm UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/21 "2023-04-20T19:10:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [April 20, 2023, 7:14pm UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/22 "2023-04-20T19:14:58Z")

</div>

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? 🙂

---

<div class="post-metadata">

**Author:** ![anveshtokala](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@anveshtokala](https://developer.squareup.com/forums/u/anveshtokala)\
**Post date:** [April 20, 2023, 7:22pm UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/23 "2023-04-20T19:22:00Z")

</div>

Here are the error what i am seeing in the inspect

 ![image](https://global.discourse-cdn.com/square/original/2X/8/8dd8198de8af52391ba81794b409ee52ec5115b7.png)

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [April 20, 2023, 8:42pm UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/24 "2023-04-20T20:42:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anveshtokala](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@anveshtokala](https://developer.squareup.com/forums/u/anveshtokala)\
**Post date:** [April 21, 2023, 5:14am UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/25 "2023-04-21T05:14:15Z")

</div>

@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?

 ![image](https://global.discourse-cdn.com/square/original/2X/1/15f226da32804d687f7687ef996e4cff5f32d739.jpeg)

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [April 21, 2023, 4:08pm UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/26 "2023-04-21T16:08:17Z")

</div>

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. 🙂

---

<div class="post-metadata">

**Author:** ![anveshtokala](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@anveshtokala](https://developer.squareup.com/forums/u/anveshtokala)\
**Post date:** [April 25, 2023, 5:52pm UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/27 "2023-04-25T17:52:24Z")

</div>

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

```auto
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?

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [April 25, 2023, 6:16pm UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/28 "2023-04-25T18:16:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anveshtokala](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@anveshtokala](https://developer.squareup.com/forums/u/anveshtokala)\
**Post date:** [April 26, 2023, 8:16am UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/29 "2023-04-26T08:16:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [April 26, 2023, 3:27pm UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/30 "2023-04-26T15:27:38Z")

</div>

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. 🙂

---

<div class="post-metadata">

**Author:** ![anveshtokala](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@anveshtokala](https://developer.squareup.com/forums/u/anveshtokala)\
**Post date:** [May 5, 2023, 6:11pm UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/31 "2023-05-05T18:11:57Z")

</div>

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

```auto
const verificationDetails = {
          billingContact: {
            addressLines: ['123 Main Street', 'Apartment 1'],
            familyName: 'Doe',
            givenName: 'John',
            email: 'jondoe@gmail.com',
            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

```auto
{
  "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:

```auto
"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'"
    }
  ]

```

```auto
"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?

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [May 5, 2023, 6:49pm UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/32 "2023-05-05T18:49:53Z")

</div>

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. 🙂

---

<div class="post-metadata">

**Author:** ![anveshtokala](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@anveshtokala](https://developer.squareup.com/forums/u/anveshtokala)\
**Post date:** [May 5, 2023, 7:04pm UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/33 "2023-05-05T19:04:35Z")

</div>

@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?

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

```

Please reply ASAP. It is urgent

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [May 5, 2023, 7:24pm UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/34 "2023-05-05T19:24:16Z")

</div>

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. 🙂

---

<div class="post-metadata">

**Author:** ![anveshtokala](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@anveshtokala](https://developer.squareup.com/forums/u/anveshtokala)\
**Post date:** [May 5, 2023, 7:27pm UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/35 "2023-05-05T19:27:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [May 5, 2023, 7:29pm UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/36 "2023-05-05T19:29:43Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![anveshtokala](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@anveshtokala](https://developer.squareup.com/forums/u/anveshtokala)\
**Post date:** [May 5, 2023, 7:42pm UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/37 "2023-05-05T19:42:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [May 5, 2023, 7:52pm UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/38 "2023-05-05T19:52:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anveshtokala](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@anveshtokala](https://developer.squareup.com/forums/u/anveshtokala)\
**Post date:** [May 5, 2023, 8:05pm UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/39 "2023-05-05T20:05:58Z")

</div>

@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!

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [May 5, 2023, 9:10pm UTC](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560/40 "2023-05-05T21:10:53Z")

</div>

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](https://developer.squareup.com/reference/square/objects/Payment#definition__property-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. 🙂

[Previous page](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560.md?page=1)

[Next page](https://developer.squareup.com/forums/t/apple-pay-web-sdk-with-auth-deferred-capture-with-different-amount/8560.md?page=3)
