Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
201 views
in Technique[技术] by (71.8m points)

php - Description of Transaction in Square not working

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 SquareConnectConfiguration();
    $api_config->setHost("https://connect.squareup.com");
    $api_config->setAccessToken($access_token);
    $api_client = new SquareConnectApiClient($api_config);
    
    $payments_api = new SquareConnectApiPaymentsApi($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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...