【发布时间】:2014-05-11 07:46:11
【问题描述】:
我正在尝试让自适应支付功能正常工作(一次支付多个用户)。我正在尝试以下 SOAP 请求:
my $content = sprintf( $format, qq|<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<actionType>PayRequest</actionType>
<PayRequest>
<requestEnvelope>
<errorLanguage>en_US</errorLanguage>
<currencyCode>USD</currencyCode>
<receiverList>
<receiver>
<amount>5</amount>
<email>test email here -but wont let me post it!</email>
</receiver>
</receiverList>
<returnUrl>silly forum wont let me post a test link here???</returnUrl>
<cancelUrl>silly forum wont let me post a test link here???</cancelUrl>
</requestEnvelope>
<payKey>AP-xxxxxxxxxxxxx</payKey>',
</PayRequest>
</soapenv:Body>
</soapenv:Envelope>|);
这给了我很多错误:
'error' => [
{
'parameter' => [
'requestEnvelope',
'null'
],
'domain' => 'PLATFORM',
'category' => 'Application',
'subdomain' => 'Application',
'errorId' => '580022',
'severity' => 'Error',
'message' => 'Invalid request parameter: requestEnvelope cannot be null'
},
{
'parameter' => [
'actionType',
'null'
],
'domain' => 'PLATFORM',
'category' => 'Application',
'subdomain' => 'Application',
'errorId' => '580022',
'severity' => 'Error',
'message' => 'Invalid request parameter: actionType cannot be null'
},
{
'parameter' => [
'cancelUrl',
'null'
],
'domain' => 'PLATFORM',
'category' => 'Application',
'subdomain' => 'Application',
'errorId' => '580022',
'severity' => 'Error',
'message' => 'Invalid request parameter: cancelUrl cannot be null'
},
{
'parameter' => [
'currencyCode',
'null'
],
'domain' => 'PLATFORM',
'category' => 'Application',
'subdomain' => 'Application',
'errorId' => '580022',
'severity' => 'Error',
'message' => 'Invalid request parameter: currencyCode cannot be null'
},
{
'parameter' => [
'receiverList',
'null'
],
'domain' => 'PLATFORM',
'category' => 'Application',
'subdomain' => 'Application',
'errorId' => '580022',
'severity' => 'Error',
'message' => 'Invalid request parameter: receiverList cannot be null'
},
{
'parameter' => [
'returnUrl',
'null'
],
'domain' => 'PLATFORM',
'category' => 'Application',
'subdomain' => 'Application',
'errorId' => '580022',
'severity' => 'Error',
'message' => 'Invalid request parameter: returnUrl cannot be null'
}
],
我有点困惑为什么它说所有这些值都是 undef,即使我清楚地传递了它们?它检测我传入的不同参数,但它似乎不喜欢从它们那里获取值
谁能建议我做错了什么?
更新 2:
我仍然无法让SetPaymentOptions 功能完全为我工作。
这是我正在发出的 JSON 请求示例,用于更新单位/运输等:
{
"receiverOptions": [
{
"receiver":{
"email":"andyxxx@gmail.com"
},
"invoiceData":{
"totalShipping":10,
"totalTax":5,
"item":[
{
"itemPrice":25,
"name":"ITEM1",
"price":50,
"itemCount":2
}
]
},
"SenderOptions":{
"requireShippingAddressSelection":1,
"addressOverride":1
},
"customId":"foo123"
}
],
"requestEnvelope":{
"errorLanguage":"en_US",
"detailLevel":"ReturnAll"
},
"payKey":"AP-8AK803068V089131W"
}
然后,当您使用 PaymentDetails 重新获取交易时,其中没有任何新的运费/税/单位更改:
'paymentInfoList' => {
'paymentInfo' => [
{
'pendingRefund' => 'false',
'receiver' => {
'accountId' => 'AH92SPWMDXTHJ',
'email' => 'andyxxx@gmail.com',
'amount' => '65.00',
'primary' => 'false',
'paymentType' => 'GOODS'
}
}
]
},
真正烦人的部分是,如果我更改运费/总计/税金值,以使数字与原始“付款”请求不匹配...然后我收到一个错误:
ERROR: The total invoiced amount for andyxxx@gmail.com does not match the amount in the pay request at test.cgi line 127.
所以它必须选择这些值 - 但它只是拒绝在 PaymentDetails 请求中显示它们,并使用相同的 payID
请帮忙 - 因为我现在对此束手无策!
【问题讨论】:
标签: api soap paypal paypal-adaptive-payments