1

I am using SQUARE as my payment gateway but I am having issue that I cannot post transaction description with the Transaction. In Square dashboard, it shows Custom Amount. Is there any way I can send the Buyer Name or any parameter to transaction so I can identify the Transaction in my square dashboard. Here is the snippet of codes to charge the Payment from Card to Square

$access_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';

    $api_config = new \SquareConnect\Configuration();
    $api_config->setHost("https://connect.squareup.com");
    $api_config->setAccessToken($access_token);
    $api_client = new \SquareConnect\ApiClient($api_config);
    
    $payments_api = new \SquareConnect\Api\PaymentsApi($api_client);
    
    $request_body = array (
      "source_id" => $nonce,
      "amount_money" => array (
        "amount" => $amount*100,
        "currency" => "AUD"
      ),
      "idempotency_key" => uniqid()
    );

I tried to add "cardholder_name" => $firstname. " ".$lastname, AND "buyer_email_addres" => $email, But it is not going in Square Dashboard..

$request_body = array (
  "source_id" => $nonce,
  "amount_money" => array (
    "amount" => $TPRICE * 100,
    "cardholder_name" => $firstname. " ".$lastname,
    "buyer_email_addres" => $email,
    
    "currency" => "AUD"
    
  ),
  "idempotency_key" => uniqid()
);

But still I am failed.

I hope someone must can solve my problem

0 Answers0