想要传输数据的格式:
param = { 'xx' : 'ss', 'xx' : 'ss', 'xx' : 'ss', } 我自己写的:
$params = array( 'param' => array( 'orderSn' => $info['ordersn'], 'returnUrl' => self::RETURN_URL, 'notifyUrl' => self::NOTIFY_URL, 'cancelUrl' => self::CANCEL_URL, 'productInfo' => $info['productname'], 'productCount' => 1, 'productPrice' => $info['total_fee'], 'productDiscountPrice' => '0', 'productPriceCurrency' => 'CNY' ) );
// 获取 Paypal 支付跳转地址 $timout = 300; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, self::REQUIRE_URL ); curl_setopt( $ch, CURLOPT_POST, TRUE ); curl_setopt( $ch, CURLOPT_POSTFIELDS, $params ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, TRUE ); curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, $timout ); 求解!