我試圖讓自適應付款的東西工作(一次支付多個用戶)。我想下面的SOAP請求:如何格式化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":"[email protected]"
},
"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' => '[email protected]',
'amount' => '65.00',
'primary' => 'false',
'paymentType' => 'GOODS'
}
}
]
},
的真正惱人的一部分,如果我改變運輸/總/稅值,它使數不作馬TCH了原來的「支付」的請求......然後我得到一個錯誤:
ERROR: The total invoiced amount for [email protected] does not match the amount in the pay request at test.cgi line 127.
所以它必須是採摘值高達 - 但它只是拒絕向他們展示一個PaymentDetails
請求具有相同payID
請幫助 - 因爲我在我的智慧結束現在這個!
感謝您的指針。我仍然無法使用SOAP工作,所以我最終使用了上面發佈的JSON代碼。不知道您是否知道如何在每人的基礎上通過運輸?我假設這是可能的 - 但我再次找不到任何有關它的文檔:/ –