PayPal SOAP消息格式

时间:2013-12-07 10:03:18

标签: soap paypal request message

我想了解有关付款的详细信息,但我不知道肥皂信息应该如何。我将向您展示我必须遵循的主要步骤,以便从PaymentDetails API Operation创建消息:

  

使用PaymentDetails API操作获取有关a的信息   付款。您可以通过与之关联的付款密钥来识别付款   付款。

     

PaymentDetailsRequest消息

     

PaymentDetailsRequest消息包含用于的标识符   检索有关付款的信息。

     

PaymentDetailsRequest字段

     
      
  1. payKey(xs:string) - 标识要为其检索详细信息的付款的付款密钥
  2.   
  3. requestEnvelope(common:RequestEnvelope) - 每个API操作的通用信息,例如错误消息所在的语言   返回。
  4.         

    RequestEnvelope字段

         
        
    1. errorLanguage(xs:string) - 返回错误消息的RFC 3066语言;默认情况下它是en_US,这是唯一的   目前支持的语言。
    2.   

这是他们的错误消息之一:

<?xml version='1.0' encoding='UTF-8'?>
<ns3:FaultMessage 
    xmlns:ns3="http://svcs.paypal.com/types/common" 
    xmlns:ns2="http://svcs.paypal.com/types/ap">
    <responseEnvelope>
        <timestamp>2013-12-07T02:08:42.623-08:00</timestamp>
        <ack>Failure</ack>
        <correlationId>3dsfdsfdsfdsf</correlationId>
        <build>1233333</build>
    </responseEnvelope>
    <error>
        <errorId>550001</errorId>
        <domain>PLATFORM</domain>
        <subdomain>Application</subdomain>
        <severity>Error</severity>
        <category>Application</category>
        <message>User is not allowed to perform this action</message>
    </error>
</ns3:FaultMessage>

所以我想创建一个类似的消息:

<?xml version='1.0' encoding='UTF-8'?>
<ns3:PaymentDetailsRequestMessage 
    xmlns:ns3="http://svcs.paypal.com/types/common" 
    xmlns:ns2="http://svcs.paypal.com/types/ap">
    <payKey>AP-123456C</payKey>
    <requestEnvelope>
        <errorLanguage>en_US</errorLanguage>
    </requestEnvelope>
</ns3:PaymentDetailsRequestMessage>

不幸的是,这不起作用。你能帮我创建一下SOAP消息吗?

1 个答案:

答案 0 :(得分:0)

以下是我刚刚发出的成功PaymentDetails请求的示例以及我从中获得的回复。

<?xml version="1.0" encoding="utf-8"?>
<PaymentDetailsRequest xmlns="http://svcs.paypal.com/types/ap">
  <requestEnvelope xmlns="">
    <detailLevel>ReturnAll</detailLevel>
    <errorLanguage>en_US</errorLanguage>
  </requestEnvelope>
  <payKey xmlns="">AP-84R2524843917081W</payKey>
  <transactionId xmlns="">1BM714721N413291D</transactionId>
</PaymentDetailsRequest>



<?xml version='1.0' encoding='UTF-8'?>
<ns2:PaymentDetailsResponse xmlns:ns2="http://svcs.paypal.com/types/ap">
  <responseEnvelope>
    <timestamp>2013-12-08T03:05:51.460-08:00</timestamp>
    <ack>Success</ack>
    <correlationId>c0ea3754bbf7e</correlationId>
    <build>7935900</build>
  </responseEnvelope>
  <cancelUrl>http://paypal.angelleye.com/paypal/class/1.2/Pay_Cancel.php</cancelUrl>
  <currencyCode>USD</currencyCode>
  <paymentInfoList>
    <paymentInfo>
      <transactionId>65A0503076751280F</transactionId>
      <transactionStatus>COMPLETED</transactionStatus>
      <receiver>
        <amount>10.00</amount>
        <email>sandbo_1204199080_biz@angelleye.com</email>
        <primary>false</primary>
        <paymentType>SERVICE</paymentType>
        <accountId>E7BTGVXBFSUAU</accountId>
      </receiver>
      <refundedAmount>0.00</refundedAmount>
      <pendingRefund>false</pendingRefund>
      <senderTransactionId>1BM714721N413291D</senderTransactionId>
      <senderTransactionStatus>COMPLETED</senderTransactionStatus>
    </paymentInfo>
    <paymentInfo>
      <receiver>
        <amount>5.00</amount>
        <email>usb_1329725429_biz@angelleye.com</email>
        <primary>false</primary>
        <invoiceId>123-ABCDEF</invoiceId>
        <paymentType>SERVICE</paymentType>
        <accountId>C9TAVNJFATXCS</accountId>
      </receiver>
      <refundedAmount>0.00</refundedAmount>
      <pendingRefund>false</pendingRefund>
    </paymentInfo>
  </paymentInfoList>
  <returnUrl>http://paypal.angelleye.com/paypal/class/1.2/Pay_Return.php</returnUrl>
  <senderEmail>bogus@domain.com</senderEmail>
  <status>INCOMPLETE</status>
  <payKey>AP-84R2524843917081W</payKey>
  <actionType>PAY</actionType>
  <feesPayer>EACHRECEIVER</feesPayer>
  <reverseAllParallelPaymentsOnError>false</reverseAllParallelPaymentsOnError>
  <sender>
    <email>bogus@domain.com</email>
    <accountId>YW66KXBKJRRES</accountId>
    <useCredentials>false</useCredentials>
  </sender>
</ns2:PaymentDetailsResponse>