Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Generate nonce string
- $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
- $nonce = '';
- for($i=1; $i <= 32; $i++)
- {
- $pos = mt_rand(0, strlen($chars) - 1);
- $char = $chars[$pos];
- $nonce .= $char;
- }
- $ch = curl_init();
- $timestamp = round(microtime(true) * 1000);
- // Request body
- $request = array(
- "env" => array(
- "terminalType" => "APP"
- ),
- "merchantTradeNo" => mt_rand(982538,9825382937292),
- "orderAmount" => 25.17,
- "currency" => "BUSD",
- "goods" => array(
- "goodsType" => "01",
- "goodsCategory" => "D000",
- "referenceGoodsId" => "7876763A3B",
- "goodsName" => "Ice Cream",
- "goodsDetail" => "Greentea ice cream cone"
- )
- );
- $json_request = json_encode($request);
- ...................................................................
- ......................................
- .....................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement