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

Categories

0 votes
220 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 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...