Does anyone know the secret for getting customer information for API transactions into your dashboard. As of now I can only see the transaction and not the customer info like name, email etc.
Hi @jeremyredd, welcome to the forums!
If you’re creating payments via the API, then you would need to pass a customer_id
along with the payment in order to attach a customer object to it. You can either create a customer with the information or retrieve it via the Customers API. The customer_id
is an optional parameter to the CreatePayment
request. Please let me know if you have any additional questions or concerns, I’m happy to help!
Would this be in this area?
$transaction_api = new \SquareConnect\Api\TransactionApi();
$request_body = array (
“card_nonce” => $nonce,
Monetary amounts are specified in the smallest unit of the applicable currency.
This amount is in cents. It’s also hard-coded for $1.00, which isn’t very useful.
“amount_money” => array (
“amount” => (int) $amount,
“currency” => “USD”
),
Every payment you process with the SDK must have a unique idempotency key.
If you’re unsure whether a particular payment succeeded, you can reattempt
it with the same idempotency key without worrying about double charging
the buyer.
“idempotency_key” => uniqid()
);
Note: Transactions API is deprecated, and will be retired next year, so it’s recommend to upgrade to Payments API.
With that said, yes, you could include a “customer_id” in the request_body
, yes. Again, you would need to either create or retrieve a customer to get a valid customer_id
, of course.
Can you tell me if transactions is now dead and charges being denied if a charge is processed on a web site using transactions api?
The Transactions API are removed from Square API version 2021-10-20 and later. These endpoints will work if you are using Square API versions prior to 2021-10-20. However, these endpoints will eventually be retired from all Square versions.
Bryan
ANy idea why mine just stopped working? I didnt update to any new API and I am still using one prior to the 10-20-2021. They no longer return any errors, just fail with a null exception.
Have you checked your API Logs? Also what’s your applicationId?
nothing is showing in the api logs, nothing at all. Just catches null as the exception in the php script. Application ID is: sq0idp-BLVNrrdpwHtor5OD-S7BaQ. It was working fine up until about two months ago, nothing changed on our side.
this is the error I get…
Caught exception!
Response body:
NULL
Response headers:
NULL
I see three successful calls to the Transactions API in your API Logs for that application.
Those were done through the api interface in developer tools. Everything from web fails with that error.
I’m seeing only those successful requests in our logs which means that all the other requests aren’t making it to our servers.
What would stop that from happening?
Did anything change on your server that would be preventing the requests from being sent to Square?
Negative sir, same server same setup. Its a dedicated server so I can do anything I need to. WOuld you like for me to email you my php script that process the charge?
With these failed payments can you confirm you getting the nonce that is returned from the SqPaymentForm? Also if you’d like to send the script I can take a look.
Confirmed on noonce
Script attached as well
(Attachment process-card_membership.zip is missing)
renamed to extension .txt to pass your firewall
(Attachment process-card_membership.txt is missing)
"; print_r("Response body:
"); echo "
"; var_dump($e->getResponseBody()); echo ""; echo "
Response headers:
"; echo "
"; var_dump($e->getResponseHeaders()); echo ""; #header("Location: ../HSV_SOF_Callout.asp?MSG=We are sorry, there is a problem with your card. Please try again.&E=" .$EventID); } ?>