Credit card issue

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.

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.

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 . The SqPaymentForm should not be relied on. :slightly_smiling_face:

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

1 Like

The easiest and fastest would be to follow our migration guide. :slightly_smiling_face:

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?

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.


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. :slightly_smiling_face:

1 Like

Does the link below provide an updated step by step guide?

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. :slightly_smiling_face:


Did you see the msg sent to your inbox?

Yes, I see the message. However it doesn’t point out what the issue is with the migration to the Web Payments SDK? :slightly_smiling_face:

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.

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. :slightly_smiling_face:


Has the nonce been completely removed with the migrate?

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. :slightly_smiling_face:

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

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.

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. :slightly_smiling_face:

1 Like

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
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!! =))

Yes, that’s correct, onGetCardNonce(event) no longer works. What you’ll pass in the POST request is the results from tokenize. :slightly_smiling_face: