我想在不向用戶顯示萬事達(dá)卡界面的情況下集成支付部分,只會(huì)在我的網(wǎng)站上填寫他們的信息我的門戶而不是在這里萬事達(dá)卡門戶我正在嘗試使用 curl 在我的 PHP 站點(diǎn)上實(shí)現(xiàn) CommWeb。它不工作。我收到以下錯(cuò)誤消息:if ($_SERVER["REQUEST_METHOD"] == "GET") { if (!isset($_GET['id']) || !isset($_GET['motif']) || !isset($_GET['code'])){ die("Invalid request"); } $amount = 10000; $id = 2; $motif = 'save'; $action_code = 'ookkk'; $orderInfo = 'fhhsd'.$id; $MerchTxnRef = $orderInfo.'-'.generateMerchTxnRef(); $accountData = array( 'merchant_id' => 'TESTID', // for test card 'access_code' => '77867878', // for test card 'secret' => 'TYUJHGFDFGHJ87654567GFDFGHGF' // for test card ); $currency_str = "USD"; $mult = 100; $queryData = array( 'vpc_AccessCode' => $accountData['access_code'], 'vpc_Merchant' => $accountData['merchant_id'], 'vpc_Amount' => 1000000, // Multiplying by 100 to convert to the smallest unit 'vpc_OrderInfo' => $orderInfo, 'vpc_MerchTxnRef' => $MerchTxnRef, 'vpc_Command' => 'pay', 'vpc_Currency' => $currency_str, 'vpc_Locale' => 'en', 'vpc_Version' => 2, 'vpc_ReturnURL' => ('http://theeventsfactory.biz/the_events_factory/logics/payment_return.php?id='.$id.'&motif='.$motif.'&code='.$action_code), 'vpc_SecureHashType' => 'SHA256', 'vpc_CardNum' => '5123456789012346', 'vpc_CardExp' => '0521', 'vpc_CardSecurityCode'=> '123' ); // Add secure secret after hashing // $queryData['vpc_SecureHash'] = generateSecureHash($accountData['secret'], $queryData); // $migsUrl = 'https://migs.mastercard.com.au/vpcpay?'.http_build_query($queryData);}這是我收到的回復(fù)vpc_Amount=0&vpc_BatchNo=0&vpc_Locale=en&vpc_Message=Required+field+vpc_Merchant+was+not+present+in+the+request&vpc_TransactionNo=0&vpc_TxnResponseCode=7 我將如何解決這個(gè)問題
1 回答

四季花海
TA貢獻(xiàn)1811條經(jīng)驗(yàn) 獲得超5個(gè)贊
您需要使用 http_build_query 將數(shù)組轉(zhuǎn)換為 url 編碼的字符串
設(shè)置 queryData 數(shù)組后,添加
$queryData_string = http_build_query($queryData);
然后 curlpost 將設(shè)置為
CURLOPT_POSTFIELDS => $queryData_string,
- 1 回答
- 0 關(guān)注
- 200 瀏覽
添加回答
舉報(bào)
0/150
提交
取消