# Credit card issue

**URL:** <https://developer.squareup.com/forums/t/credit-card-issue/7600>\
**Category:** Questions\
**Created:** [November 15, 2022, 8:09pm UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600 "2022-11-15T20:09:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrea](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@Andrea](https://developer.squareup.com/forums/u/Andrea)\
**Post date:** [November 15, 2022, 8:09pm UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/1 "2022-11-15T20:09:07Z")

</div>

We haven’t had a single order for some time and just realized customers are not even able to enter credit card!  
Even the text “Or pay with your Apple Pay:” that used to only be visible on apple devices are not visible all of the sudden on all devices.

---

<div class="post-metadata">

**Author:** ![Andrea](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@Andrea](https://developer.squareup.com/forums/u/Andrea)\
**Post date:** [November 15, 2022, 8:30pm UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/2 "2022-11-15T20:30:37Z")

</div>

On an iphone, it seems the “Or pay with your Apple Pay:” layer (id=sq-walletbox) is also visible on apple pay…  
BUT, the “\<button id=‘sq-apple-pay’” is however not visible.

---

<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:** [November 15, 2022, 8:42pm UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/3 "2022-11-15T20:42:36Z")

</div>

Is your integration using the `SqPaymentForm`? The `SqPaymentForm` is now retired. It was deprecated as of May 13, 2021, and was scheduled to be retired on July 20, 2022 but that got extended to October 31, 2022. You’ll need to migrate to the [Web Payments SDK](https://developer.squareup.com/docs/web-payments/migrate). The `SqPaymentForm` should not be relied on. 🙂

---

<div class="post-metadata">

**Author:** ![Andrea](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@Andrea](https://developer.squareup.com/forums/u/Andrea)\
**Post date:** [November 15, 2022, 8:44pm UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/4 "2022-11-15T20:44:28Z")

</div>

Yes we currently have `SqPaymentForm` and there’s so much codes it’s a mess.  
Can you kindly advise if we simply can just replace some “commands” ?

---

<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:** [November 15, 2022, 8:46pm UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/5 "2022-11-15T20:46:47Z")

</div>

The easiest and fastest would be to follow our [migration guide](https://developer.squareup.com/docs/web-payments/migrate). 🙂

---

<div class="post-metadata">

**Author:** ![Andrea](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@Andrea](https://developer.squareup.com/forums/u/Andrea)\
**Post date:** [November 15, 2022, 8:50pm UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/6 "2022-11-15T20:50:34Z")

</div>

> **[Take an Apple Pay Payment](https://developer.squareup.com/docs/web-payments/apple-pay)**
>
> Learn how to take Apple Pay payments in a web client with the Web Payments SDK.

This says to put a form id=“payment-form”.

Customers are supposed to be able to pay with credit card so there’s already an existing FORM in the html to submit that. Are we supposed to have an additional FORM for the apple pay?

---

<div class="post-metadata">

**Author:** ![Andrea](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@Andrea](https://developer.squareup.com/forums/u/Andrea)\
**Post date:** [November 15, 2022, 8:58pm UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/7 "2022-11-15T20:58:30Z")

</div>

Also, [https://developer.squareup.com/docs/web-payments/migrate](https://developer.squareup.com/docs/web-payments/migrate)  
is not a good user-friendly guide.

It does not provide step by step guide and it seems it’s still showing code from `SqPaymentForm` that you mentioned is retired.

Can you kindly provide a link that shows from beginning to end with JS samples?  
Thank you very much.

---

<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:** [November 15, 2022, 9:05pm UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/8 "2022-11-15T21:05:44Z")

</div>

The Apple Pay documentation isn’t referencing the `SqPaymentForm`. That’s just the name if your building from the Quickstart.

The migration guide is our step by step guide we recommend following. The guid will show retired code and follow with what needs to be updated. 🙂

---

<div class="post-metadata">

**Author:** ![Andrea](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@Andrea](https://developer.squareup.com/forums/u/Andrea)\
**Post date:** [November 15, 2022, 10:55pm UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/9 "2022-11-15T22:55:24Z")

</div>

Does the link below provide an **updated** step by step guide?  
Thanks.

> **[Take a Card Payment](https://developer.squareup.com/docs/web-payments/take-card-payment)**
>
> Learn how to take card payments in a web client with the Web Payments SDK.

---

<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:** [November 16, 2022, 1:10am UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/10 "2022-11-16T01:10:26Z")

</div>

That guide is if you’re starting from scratch. Yes, it’s the Web Payments SDK however it’s not the migration guide from the Web Payments SDK. If you want to start from scratch you can definitely use that guide. 🙂

---

<div class="post-metadata">

**Author:** ![Andrea](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@Andrea](https://developer.squareup.com/forums/u/Andrea)\
**Post date:** [November 18, 2022, 1:34am UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/11 "2022-11-18T01:34:01Z")

</div>

Bryan,

Did you see the msg sent to your inbox?  
Thanks.

---

<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:** [November 18, 2022, 1:37am UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/12 "2022-11-18T01:37:42Z")

</div>

Yes, I see the message. However it doesn’t point out what the issue is with the migration to the [Web Payments SDK](https://developer.squareup.com/docs/web-payments/migrate)? 🙂

---

<div class="post-metadata">

**Author:** ![Andrea](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@Andrea](https://developer.squareup.com/forums/u/Andrea)\
**Post date:** [November 25, 2022, 4:59pm UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/13 "2022-11-25T16:59:38Z")

</div>

The guide is simply not well done.  
It requires you to remember the structure and entire past code.

For example it provides a function of buildPaymentRequest(payments)  
But there’s absolutely No where on this guide any code that uses this function.

---

<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:** [November 25, 2022, 8:02pm UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/14 "2022-11-25T20:02:02Z")

</div>

We’re constantly working to improve our features based on feedback like this, so I’ll be sure to share your request to the API product team. 🙂

---

<div class="post-metadata">

**Author:** ![Andrea](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@Andrea](https://developer.squareup.com/forums/u/Andrea)\
**Post date:** [March 20, 2023, 5:20pm UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/15 "2023-03-20T17:20:16Z")

</div>

Hi,

Has the nonce been completely removed with the migrate?  
Thanks

---

<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:** [March 20, 2023, 7:33pm UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/16 "2023-03-20T19:33:23Z")

</div>

No, the Web Payments SDK produces a token which is the same as a nonce from the `SqPaymentForm`. The token is what you’ll use to pass as the `source_id` to the `CreatePayment` request. 🙂

---

<div class="post-metadata">

**Author:** ![Andrea](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@Andrea](https://developer.squareup.com/forums/u/Andrea)\
**Post date:** [March 21, 2023, 4:47am UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/17 "2023-03-21T04:47:14Z")

</div>

Hi Bryan.  
So…reading the source\_id in PHP, what variable is it under?

h t t ps:// [web-payments-quickstart/card.html at main · square/web-payments-quickstart · GitHub](http://github.com/square/web-payments-quickstart/blob/main/public/examples/card.html)

The does not have any values so I can’t really do a $source\_id = $\_POST[‘source\_id’];

Can you please advise how I can access the token in PHP after the HTML form has been submitted to make a payment?  
Thanks in advance.

---

<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:** [March 21, 2023, 6:52pm UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/18 "2023-03-21T18:52:30Z")

</div>

The Web Payments SDK returns the entire tokenize result in a single object. Once the object is received the function `/payment` is called and the token is `POST` as the `source_id` to the payment request. 🙂

---

<div class="post-metadata">

**Author:** ![Andrea](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@Andrea](https://developer.squareup.com/forums/u/Andrea)\
**Post date:** [March 21, 2023, 6:53pm UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/19 "2023-03-21T18:53:32Z")

</div>

**Question 1:**  
So this code is not neccecary/won’t work anymore correct? “onGetCardNonce(event)”

**Question 2:**  
Can you kindly advise the name of the variable that will be posted which contains the token?  
$response = $_POST["_\_\_\_\_\_\_\_\_"];

I’m assuming this will turn $response in to an array and that will contain the token

Btw, I tried [https://github.com/square/connect-api-examples/blob/master/connect-examples/v2/php\_payment/process-payment.php](https://github.com/square/connect-api-examples/blob/master/connect-examples/v2/php_payment/process-payment.php)  
And the following code below does not work:

> $json = file\_get\_contents(‘php://input’);  
> $data = json\_decode($json);  
> $token = $data-\>token;  
> print\_r($data); // = gives empty result

Thank you!! =))

---

<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:** [March 22, 2023, 12:07am UTC](https://developer.squareup.com/forums/t/credit-card-issue/7600/20 "2023-03-22T00:07:18Z")

</div>

Yes, that’s correct, `onGetCardNonce(event)` no longer works. What you’ll pass in the POST request is the results from [tokenize](https://developer.squareup.com/reference/sdks/web/payments/card-payments#Payments.card.Promise%3CCard%3E.Card.tokenize). 🙂

[Next page](https://developer.squareup.com/forums/t/credit-card-issue/7600.md?page=2)
