How do I get the cnon:card-nonce-ok Token on the PHP side (SOLVED)

I’m coding in php and javascript, using codeigniter, I’m building everything from scratch because the migration is very complicated.

I’m trying to consume the data supplied by the form | | that is submitted, but I can’t get the cnon:card-nonce-ok token that should go in
| $uid = uniqid();
$body = new \Square\Models\CreatePaymentRequest(
‘cnon:card-nonce-ok’, <-HERE
$uid,
$amount_money
); |

Please, how do I get the necessary data on the php side to be able to use them? please do not send me to read the guides here, I already read the entire forum and the guides in every possible way

Recibí en php con esto correctamente extraje el Nonce

$json = file_get_contents(‘php://input’);
$data = json_decode($json);
$cnon = $data->sourceId;

Hi,

The same issue is coming to my website when a plugin is deprecated.
squareInit() function is not loaded and card form input is invisible.

Please guide us on how to get nonce-value for when we added a new card to the form.
JS issue
Technology:
Backend: PHP Laravel
Frontend: VueJS

hola, estas usando el nuevo sdk de square ? o SqPayments ?

You’ll need to use the Web Payments SDK to get the source_id that’s passed to the server side payment request. :slightly_smiling_face:

$json = json_decode(file_get_contents(‘php://input’));
$cnon = $json->sourceId;

used this working.

how do i send additional variables example i want to pass from javascript to my php the name and a birthday of the client, it is stored in a variable

how do i get this? the documentation says nothing.

I tried sending a form by POST but it interferes with what I read in php with

$json = json_decode(file_get_contents(‘php://input’));
$cnon = $json->sourceId;

aid ! This update really complicated everything.