Advertisement
Guest User

Untitled

a guest
Oct 14th, 2022
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. <?php
  2.  
  3. // Generate nonce string
  4. $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  5. $nonce = '';
  6. for($i=1; $i <= 32; $i++)
  7. {
  8. $pos = mt_rand(0, strlen($chars) - 1);
  9. $char = $chars[$pos];
  10. $nonce .= $char;
  11. }
  12. $ch = curl_init();
  13. $timestamp = round(microtime(true) * 1000);
  14. // Request body
  15. $request = array(
  16. "env" => array(
  17. "terminalType" => "APP"
  18. ),
  19. "merchantTradeNo" => mt_rand(982538,9825382937292),
  20. "orderAmount" => 25.17,
  21. "currency" => "BUSD",
  22. "goods" => array(
  23. "goodsType" => "01",
  24. "goodsCategory" => "D000",
  25. "referenceGoodsId" => "7876763A3B",
  26. "goodsName" => "Ice Cream",
  27. "goodsDetail" => "Greentea ice cream cone"
  28. )
  29. );
  30.  
  31. $json_request = json_encode($request);
  32. ...................................................................
  33. ......................................
  34. .....................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement