I have a simple form that processes one-time credit card payments. I'm able to charge a card successfully however I am not sure how to associate their name with the transaction.
I don't want to store or create customers since these are one-time payments. I'm using PHP and process-card.php. How do I send their name so that it shows up in the Square dashboard when I charge the card?
In process-card.php I am wondering if I can just modify this block of code? For example, could I just add "family_name" to the $request_body? I have their name stored in a session as $_SESSION['name']
$request_body = array ( "card_nonce" => $nonce, "amount_money" => array ( "amount" => 100, "currency" => "USD" ), "idempotency_key" => uniqid() );
Hey @gryd. I escalated your post to our API team and currently there isn't a way to save a name like this. You would need to create a customer (using `CreateCustomer` endpoint) and then include the customer_id in the $request_body that you showed. There's more information about linking customers to transactions in the API documentation.
Ok thanks for the reply I'll use the CreateCustomer endpoint and send their ID and name with the transaction.
Square Community