I am trying to simulate a dummy parallel payment to 2 users using curl. I have done everything as per documentation but the problem is I am getting
我尝试用curl模拟一个虚拟的并行支付给2个用户。我已经做了所有的文档,但问题是我得到了。
Getting L_ERRORCODE0=10001& Timeout processing request
获取L_ERRORCODE0=10001&超时处理请求。
I dont know why.
我不知道为什么。
My code is as follows:
我的代码如下:
<?php
$data = array(
'USER'=>urlencode('xxx'),
'PWD'=>urlencode('xxxx'),
'SIGNATURE'=>urlencode('xxxx'),
'VERSION'=>urlencode('86.0'),
'METHOD'=>urlencode('SetExpressCheckout'),
'RETURNURL'=>urlencode('http://75.125.190.162:7132/sample/php_nvp_samples/myCheckout.php'),
'CANCELURL'=>urlencode('http://75.125.190.162:7132/sample/php_nvp_samples/myCheckout.php'),
'PAYMENTREQUEST_0_CURRENCYCODE'=>urlencode('USD'),
'PAYMENTREQUEST_0_AMT'=>urlencode('300'),
'PAYMENTREQUEST_0_ITEMAMT'=>urlencode('200'),
'PAYMENTREQUEST_0_TAXAMT'=>urlencode('100'),
'PAYMENTREQUEST_0_DESC'=>urlencode('Summer Vacation trip'),
'PAYMENTREQUEST_0_SELLERPAYPALACCOUNTID'=>urlencode('himans_1331094418_biz@smartdatainc.net'),
'PAYMENTREQUEST_0_PAYMENTACTION'=>urlencode('Order'),
'PAYMENTREQUEST_0_PAYMENTREQUESTID'=>urlencode('CART26488-PAYMENT0'),
'PAYMENTREQUEST_1_CURRENCYCODE'=>urlencode('USD'),
'PAYMENTREQUEST_1_AMT'=>urlencode('100'),
'PAYMENTREQUEST_1_ITEMAMT'=>urlencode('50'),
'PAYMENTREQUEST_1_TAXAMT'=>urlencode('50'),
'PAYMENTREQUEST_1_DESC'=>urlencode('Dancing class'),
'PAYMENTREQUEST_1_SELLERPAYPALACCOUNTID'=>urlencode('himans_1320303266_biz@smartdatainc.net'),
'PAYMENTREQUEST_1_PAYMENTACTION'=>urlencode('Order'),
'PAYMENTREQUEST_1_PAYMENTREQUESTID'=>urlencode('CART26485-PAYMENT0')
);
$curl = curl_init('https://api-3t.sandbox.paypal.com/nvp');
curl_setopt($curl,CURLOPT_RETURNTRANSFER ,1);
curl_setopt($curl,CURLOPT_HTTPGET ,true);
curl_setopt($curl,CURLOPT_POSTFIELDS ,$data);
$response = curl_exec($curl);
echo $response;
exit;
curl_close($curl);
?>
Here is the vardump of the request:
这里是请求的vardump:
array(15) {
["USER"]=> string(43) "XXX"
["PWD"]=> string(10) "XXX"
["SIGNATURE"]=> string(56) "XXX"
["VERSION"]=> string(4) "56.0"
["METHOD"]=> string(18) "SetExpressCheckout"
["RETURNURL"]=> string(78)
"http%3A%2F%2F75.125.190.162%3A7132%2Fsample%2Fphp_nvp_samples%2FmyCheckout.php"
["CANCELURL"]=> string(78)
"http%3A%2F%2F75.125.190.162%3A7132%2Fsample%2Fphp_nvp_samples%2FmyCheckout.php"
["PAYMENTREQUEST_0_CURRENCYCODE"]=> string(3) "USD"
["PAYMENTREQUEST_0_AMT"]=> string(3) "100"
["PAYMENTREQUEST_0_ITEMAMT"]=> string(2) "50"
["PAYMENTREQUEST_0_TAXAMT"]=> string(2) "20"
["PAYMENTREQUEST_0_DESC"]=> string(13) "Dancing class"
["PAYMENTREQUEST_0_SELLERPAYPALACCOUNTID"]=> string(21) "seller-136@paypal.com"
["PAYMENTREQUEST_0_PAYMENTACTION"]=> string(5) "Order"
["PAYMENTREQUEST_0_PAYMENTREQUESTID"]=> string(18) "CART26485-PAYMENT0"
}
API Credentials removed intentionally.
API凭证故意删除。
And here is the response:
下面是回应:
TIMESTAMP=2012%2d03%2d06T09%3a29%3a41Z
&CORRELATIONID=184b37b1fd85
&ACK=Failure
&L_ERRORCODE0=10001
&L_SHORTMESSAGE0=Internal%20Error
&L_LONGMESSAGE0=Timeout%20processing%20request
3 个解决方案
#1
2
I apologize for my oversight with my other answer. Please look at your code, and you will see that you only have one payment request, 0, but two sellers. You have to increase the 'n' in PAYMENTREQUEST_n_ to send multiple payments using parallel payments.
我对我的疏忽表示歉意。请查看您的代码,您将看到您只有一个付款请求,0,但是两个卖家。您必须在PAYMENTREQUEST_n_中增加“n”,以便使用并行支付发送多个支付。
However, I must admit that whenever I send the same exact data as you, I get a 10400 "order total is missing", so I would look further into your code.
但是,我必须承认,每当我发送与您相同的确切数据时,我就会得到10400“订单总数丢失”,因此我将进一步查看您的代码。
I get a successful response with the following:
我得到了一个成功的回应:
API Request:
API请求:
USER=***************************
PWD=***************************
SIGNATURE=***************************
METHOD=SetExpressCheckout
VERSION=86.0
RETURNURL=http://www.site.com/checkout.php
CANCELURL=http://www.site.com/cancel.php
PAYMENTREQUEST_0_PAYMENTACTION=Sale
PAYMENTREQUEST_0_AMT=524.20
PAYMENTREQUEST_0_ITEMAMT=458.00
PAYMENTREQUEST_0_SHIPPINGAMT=20.00
PAYMENTREQUEST_0_TAXAMT=46.20
PAYMENTREQUEST_0_CURRENCYCODE=USD
PAYMENTREQUEST_0_DESC=test EC payment
PAYMENTREQUEST_0_PAYMENTREQUESTID=111
L_PAYMENTREQUEST_0_NAME0=Books
L_PAYMENTREQUEST_0_AMT0=154.00
L_PAYMENTREQUEST_0_NUMBER0=ABC123
L_PAYMENTREQUEST_0_QTY0=2
L_PAYMENTREQUEST_0_NAME1=CDs
L_PAYMENTREQUEST_0_AMT1=50.00
L_PAYMENTREQUEST_0_NUMBER1=BY-Z4736
L_PAYMENTREQUEST_0_QTY1=3
PAYMENTREQUEST_0_SELLERPAYPALACCOUNTID=seller1@paypal.com
PAYMENTREQUEST_1_PAYMENTACTION=Sale
PAYMENTREQUEST_1_AMT=494.20
PAYMENTREQUEST_1_ITEMAMT=428.00
PAYMENTREQUEST_1_SHIPPINGAMT=20.00
PAYMENTREQUEST_1_TAXAMT=46.20
PAYMENTREQUEST_1_CURRENCYCODE=USD
PAYMENTREQUEST_1_DESC=test EC payment
PAYMENTREQUEST_1_PAYMENTREQUESTID=222
L_PAYMENTREQUEST_1_NAME0=DVDs
L_PAYMENTREQUEST_1_AMT0=154.00
L_PAYMENTREQUEST_1_NUMBER0=ABC123
L_PAYMENTREQUEST_1_QTY0=2
L_PAYMENTREQUEST_1_NAME1=Computers
L_PAYMENTREQUEST_1_AMT1=40.00
L_PAYMENTREQUEST_1_NUMBER1=BY-Z4736
L_PAYMENTREQUEST_1_QTY1=3
PAYMENTREQUEST_1_SELLERPAYPALACCOUNTID=seller2@paypal.com
API Response:
API的回应:
TOKEN=EC-4XP542213W924160A
TIMESTAMP=2012-03-07T05:16:27Z
CORRELATIONID=357d629ee6eda
ACK=Success
VERSION=86.0
BUILD=2571254
#2
0
Are you using a Payflow test credit card?
你使用的是Payflow测试信用卡吗?
Payflow's test credit cards are banned in the sandbox, in a word. You will always get a 10001 response with the below Payflow test credit cards (see page 49 & 50):
在沙箱里,Payflow的测试信用卡是被禁止的。你将会得到一个10001的响应,下面的Payflow测试信用卡(见第49和50页):
- American Express
- 378282246310005
- 378282246310005
- 371449635398431
- 371449635398431
- 美国运通378282246310005 371449635398431
- American Express Corporate
- 378734493671000
- 378734493671000
- 美国运通公司378734493671000
- Diners Club
- 30569309025904
- 30569309025904
- 38520000023237
- 38520000023237
- 大莱卡30569309025904 38520000023237
- Discover
- 6011111111111117
- 6011111111111117
- 6011000990139424
- 6011000990139424
- 发现6011111111111117 6011000990139424
- JCB
- 3530111333300000
- 3530111333300000
- 3566002020360505
- 3566002020360505
- JCB 3530111333300000 3566002020360505
- MasterCard
- 5555555555554444
- 5555555555554444
- 5105105105105100
- 5105105105105100
- 万事达卡5555555555554444 5105105105105100
- Visa
- 4111111111111111
- 4111111111111111
- 4012888888881881
- 4012888888881881
- 4222222222222 -- NOTE: Even though this number has a different character count than the other test numbers, it is the correct and functional number
- 422222222222222——注意:尽管这个数字与其他测试数字有不同的字符计数,但它是正确的和功能的数字。
- 请注意:尽管这个数字与其他测试数字不同,但它是正确的和功能的数字。
#3
0
If you're still seeing an error, remove;
如果你仍然看到一个错误,删除;
["PAYMENTREQUEST_0_PAYMENTREQUESTID"]=> string(18) "CART26485-PAYMENT0"
#1
2
I apologize for my oversight with my other answer. Please look at your code, and you will see that you only have one payment request, 0, but two sellers. You have to increase the 'n' in PAYMENTREQUEST_n_ to send multiple payments using parallel payments.
我对我的疏忽表示歉意。请查看您的代码,您将看到您只有一个付款请求,0,但是两个卖家。您必须在PAYMENTREQUEST_n_中增加“n”,以便使用并行支付发送多个支付。
However, I must admit that whenever I send the same exact data as you, I get a 10400 "order total is missing", so I would look further into your code.
但是,我必须承认,每当我发送与您相同的确切数据时,我就会得到10400“订单总数丢失”,因此我将进一步查看您的代码。
I get a successful response with the following:
我得到了一个成功的回应:
API Request:
API请求:
USER=***************************
PWD=***************************
SIGNATURE=***************************
METHOD=SetExpressCheckout
VERSION=86.0
RETURNURL=http://www.site.com/checkout.php
CANCELURL=http://www.site.com/cancel.php
PAYMENTREQUEST_0_PAYMENTACTION=Sale
PAYMENTREQUEST_0_AMT=524.20
PAYMENTREQUEST_0_ITEMAMT=458.00
PAYMENTREQUEST_0_SHIPPINGAMT=20.00
PAYMENTREQUEST_0_TAXAMT=46.20
PAYMENTREQUEST_0_CURRENCYCODE=USD
PAYMENTREQUEST_0_DESC=test EC payment
PAYMENTREQUEST_0_PAYMENTREQUESTID=111
L_PAYMENTREQUEST_0_NAME0=Books
L_PAYMENTREQUEST_0_AMT0=154.00
L_PAYMENTREQUEST_0_NUMBER0=ABC123
L_PAYMENTREQUEST_0_QTY0=2
L_PAYMENTREQUEST_0_NAME1=CDs
L_PAYMENTREQUEST_0_AMT1=50.00
L_PAYMENTREQUEST_0_NUMBER1=BY-Z4736
L_PAYMENTREQUEST_0_QTY1=3
PAYMENTREQUEST_0_SELLERPAYPALACCOUNTID=seller1@paypal.com
PAYMENTREQUEST_1_PAYMENTACTION=Sale
PAYMENTREQUEST_1_AMT=494.20
PAYMENTREQUEST_1_ITEMAMT=428.00
PAYMENTREQUEST_1_SHIPPINGAMT=20.00
PAYMENTREQUEST_1_TAXAMT=46.20
PAYMENTREQUEST_1_CURRENCYCODE=USD
PAYMENTREQUEST_1_DESC=test EC payment
PAYMENTREQUEST_1_PAYMENTREQUESTID=222
L_PAYMENTREQUEST_1_NAME0=DVDs
L_PAYMENTREQUEST_1_AMT0=154.00
L_PAYMENTREQUEST_1_NUMBER0=ABC123
L_PAYMENTREQUEST_1_QTY0=2
L_PAYMENTREQUEST_1_NAME1=Computers
L_PAYMENTREQUEST_1_AMT1=40.00
L_PAYMENTREQUEST_1_NUMBER1=BY-Z4736
L_PAYMENTREQUEST_1_QTY1=3
PAYMENTREQUEST_1_SELLERPAYPALACCOUNTID=seller2@paypal.com
API Response:
API的回应:
TOKEN=EC-4XP542213W924160A
TIMESTAMP=2012-03-07T05:16:27Z
CORRELATIONID=357d629ee6eda
ACK=Success
VERSION=86.0
BUILD=2571254
#2
0
Are you using a Payflow test credit card?
你使用的是Payflow测试信用卡吗?
Payflow's test credit cards are banned in the sandbox, in a word. You will always get a 10001 response with the below Payflow test credit cards (see page 49 & 50):
在沙箱里,Payflow的测试信用卡是被禁止的。你将会得到一个10001的响应,下面的Payflow测试信用卡(见第49和50页):
- American Express
- 378282246310005
- 378282246310005
- 371449635398431
- 371449635398431
- 美国运通378282246310005 371449635398431
- American Express Corporate
- 378734493671000
- 378734493671000
- 美国运通公司378734493671000
- Diners Club
- 30569309025904
- 30569309025904
- 38520000023237
- 38520000023237
- 大莱卡30569309025904 38520000023237
- Discover
- 6011111111111117
- 6011111111111117
- 6011000990139424
- 6011000990139424
- 发现6011111111111117 6011000990139424
- JCB
- 3530111333300000
- 3530111333300000
- 3566002020360505
- 3566002020360505
- JCB 3530111333300000 3566002020360505
- MasterCard
- 5555555555554444
- 5555555555554444
- 5105105105105100
- 5105105105105100
- 万事达卡5555555555554444 5105105105105100
- Visa
- 4111111111111111
- 4111111111111111
- 4012888888881881
- 4012888888881881
- 4222222222222 -- NOTE: Even though this number has a different character count than the other test numbers, it is the correct and functional number
- 422222222222222——注意:尽管这个数字与其他测试数字有不同的字符计数,但它是正确的和功能的数字。
- 请注意:尽管这个数字与其他测试数字不同,但它是正确的和功能的数字。
#3
0
If you're still seeing an error, remove;
如果你仍然看到一个错误,删除;
["PAYMENTREQUEST_0_PAYMENTREQUESTID"]=> string(18) "CART26485-PAYMENT0"