我尝试使用Salesforce apex代码向Paypal express checkout API进行SOAP调用, 但是我面对这个问题缺少订单总数,我也确定我把订单总数放在我的SOAP调用中,这是我的SOAP调用表单:
<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Header>
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI">
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents">
<Username>xxx</Username>
<Password>xxx</Password>
<Signature>xxx</Signature>
</Credentials>
</RequesterCredentials>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<SetExpressCheckoutReq xmlns="urn:ebay:api:PayPalAPI">
<SetExpressCheckoutRequest>
<Version xmlns="urn:ebay:apis:eBLBaseComponents">78</Version>
<SetExpressCheckoutRequestDetails>
<ReturnURL>www.success.com</ReturnURL>
<CancelURL>www.cancel.com</CancelURL>
<OrderTotal currencyID="USD">1</OrderTotal>
</SetExpressCheckoutRequestDetails>
</SetExpressCheckoutRequest>
</SetExpressCheckoutReq>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
&#13;
答案 0 :(得分:0)
我发现了问题,它在SOAP
中 string doExpressCheckout = '';
doExpressCheckout += '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:ebay:api:PayPalAPI" xmlns:urn1="urn:ebay:apis:eBLBaseComponents">';
doExpressCheckout += '<soapenv:Header>';
doExpressCheckout += '<urn:RequesterCredentials>';
doExpressCheckout += '<urn1:Credentials>';
doExpressCheckout += '<urn1:Username>'+un+'</urn1:Username>';
doExpressCheckout += '<urn1:Password>'+pw+'</urn1:Password>';
doExpressCheckout += '<urn1:Signature>'+sig+'</urn1:Signature>';
doExpressCheckout += '</urn1:Credentials>';
doExpressCheckout += '</urn:RequesterCredentials>';
doExpressCheckout += '</soapenv:Header>';
doExpressCheckout += '<soapenv:Body>';
doExpressCheckout += '<urn:DoExpressCheckoutPaymentReq>';
doExpressCheckout += '<urn:DoExpressCheckoutPaymentRequest>';
doExpressCheckout += '<urn1:Version>'+version+'</urn1:Version>';
doExpressCheckout += '<urn1:DoExpressCheckoutPaymentRequestDetails>';
doExpressCheckout += '<urn1:Token>'+token+'</urn1:Token>';
doExpressCheckout += '<urn1:PayerID>'+payerID+'</urn1:PayerID>';
doExpressCheckout += '<urn1:PaymentDetails>';
doExpressCheckout += '<urn1:OrderTotal currencyID="'+UsedCurrency+'">'+amount+'</urn1:OrderTotal>';
doExpressCheckout += '</urn1:PaymentDetails>';
doExpressCheckout += '</urn1:DoExpressCheckoutPaymentRequestDetails>';
doExpressCheckout += '</urn:DoExpressCheckoutPaymentRequest>';
doExpressCheckout += '</urn:DoExpressCheckoutPaymentReq>';
doExpressCheckout += '</soapenv:Body>';
doExpressCheckout += '</soapenv:Envelope>';