在SandBox模式下不接收PayPal IPN

时间:2015-04-30 20:11:06

标签: paypal paypal-ipn paypal-sandbox

我使用的是PayPal的Express Checkout,并使用Merchant SDK for Java编写了我的代码。

这与SandBox模式下PayPal的IPN机制有关。

我创建了IPN Listener&使用IPN模拟器彻底测试它。我确保我指定的通知网址收到消息&然后使用SandBox URL再次验证IPN验证。

但是当我实际触发正确的支付流程(例如创建结算协议,进行参考交易和放大)时,我没有在SandBox模式下收到任何IPN。取消结算协议。

这是我DoReferenceTransaction时的示例有效负载。我也粘贴了下面的回复。

     <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ed="urn:ebay:apis:EnhancedDataTypes" xmlns:ns="urn:ebay:api:PayPalAPI">
    <soapenv:Header>
    <ns:RequesterCredentials>
<ebl:Credentials>
<ebl:Username>****************</ebl:Username>
<ebl:Password>****************</ebl:Password>
<ebl:Signature>****************</ebl:Signature>
</ebl:Credentials>
</ns:RequesterCredentials>
</soapenv:Header>
<soapenv:Body>
<ns:DoReferenceTransactionReq>
<ns:DoReferenceTransactionRequest>
<ebl:Version>119.0</ebl:Version>
<ebl:DoReferenceTransactionRequestDetails>
<ebl:ReferenceID>B-XXXXXXXXXXXXXX</ebl:ReferenceID>
<ebl:PaymentAction>Sale</ebl:PaymentAction>
<ebl:PaymentDetails>
<ebl:OrderTotal currencyID="USD">0.49</ebl:OrderTotal>
<ebl:ItemTotal currencyID="USD">0.49</ebl:ItemTotal>
<ebl:TaxTotal currencyID="USD">0.0</ebl:TaxTotal>
<ebl:OrderDescription>
test Daily plan: test daily subscription plan description
</ebl:OrderDescription>
<ebl:Custom>****************</ebl:Custom>
<ebl:InvoiceID>****************</ebl:InvoiceID>
<ebl:ButtonSource>PayPal_SDK</ebl:ButtonSource>
<ebl:NotifyURL>
https://staging.example.com/apis/payments/notifications/paypal
</ebl:NotifyURL>
<ebl:PaymentDetailsItem>
<ebl:Name>test Daily plan</ebl:Name>
<ebl:Quantity>1</ebl:Quantity>
<ebl:Tax currencyID="USD">0.0</ebl:Tax>
<ebl:Amount currencyID="USD">0.49</ebl:Amount>
<ebl:Description>
test Daily plan: test daily subscription plan description
</ebl:Description>
<ebl:ItemCategory>Digital</ebl:ItemCategory>
</ebl:PaymentDetailsItem>
<ebl:SellerDetails>
<ebl:PayPalAccountID>chintan+cf.pa.s@coolflix.com</ebl:PayPalAccountID>
</ebl:SellerDetails>
<ebl:PaymentAction>Sale</ebl:PaymentAction>
</ebl:PaymentDetails>
</ebl:DoReferenceTransactionRequestDetails>
</ns:DoReferenceTransactionRequest>
</ns:DoReferenceTransactionReq>
</soapenv:Body>
</soapenv:Envelope>

响应

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ed="urn:ebay:apis:EnhancedDataTypes" xmlns:ns="urn:ebay:api:PayPalAPI" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header>
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"/>
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType">
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType">
<Username xsi:type="xs:string"/>
<Password xsi:type="xs:string"/>
<Signature xsi:type="xs:string"/>
<Subject xsi:type="xs:string"/>
</Credentials>
</RequesterCredentials>
</SOAP-ENV:Header>
<SOAP-ENV:Body id="_0">
<DoReferenceTransactionResponse xmlns="urn:ebay:api:PayPalAPI">
<Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2015-04-30T19:47:48Z</Timestamp>
<Ack xmlns="urn:ebay:apis:eBLBaseComponents">Success</Ack>
<CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">bc041a43ee4a7</CorrelationID>
<Version xmlns="urn:ebay:apis:eBLBaseComponents">119.0</Version>
<Build xmlns="urn:ebay:apis:eBLBaseComponents">16474106</Build>
<DoReferenceTransactionResponseDetails xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:DoReferenceTransactionResponseDetailsType">
<BillingAgreementID xsi:type="xs:string">B-9PX106033L488773A</BillingAgreementID>
<PaymentInfo xsi:type="ebl:PaymentInfoType">
<TransactionID>xxxxxxxxxxxxxxxx</TransactionID>
<ParentTransactionID xsi:type="ebl:TransactionId"/>
<ReceiptID/>
<TransactionType xsi:type="ebl:PaymentTransactionCodeType">mercht-pmt</TransactionType>
<PaymentType xsi:type="ebl:PaymentCodeType">instant</PaymentType>
<PaymentDate xsi:type="xs:dateTime">2015-04-30T19:47:47Z</PaymentDate>
<GrossAmount xsi:type="cc:BasicAmountType" currencyID="USD">0.49</GrossAmount>
<FeeAmount xsi:type="cc:BasicAmountType" currencyID="USD">0.07</FeeAmount>
<TaxAmount xsi:type="cc:BasicAmountType" currencyID="USD">0.00</TaxAmount>
<ExchangeRate xsi:type="xs:string"/>
<PaymentStatus xsi:type="ebl:PaymentStatusCodeType">Completed</PaymentStatus>
<PendingReason xsi:type="ebl:PendingStatusCodeType">none</PendingReason>
<ReasonCode xsi:type="ebl:ReversalReasonCodeType">none</ReasonCode>
<ProtectionEligibility xsi:type="xs:string">Ineligible</ProtectionEligibility>
<ProtectionEligibilityType xsi:type="xs:string">None</ProtectionEligibilityType>
</PaymentInfo>
</DoReferenceTransactionResponseDetails>
</DoReferenceTransactionResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

1 个答案:

答案 0 :(得分:0)

在为特定沙箱企业帐户启用IPN后,IPN开始显示。

我希望他们更新文档以明确说明沙箱中使用的企业帐户还需要启用IPN。要做到这一点,你需要去sandbox.paypal.com&amp;登录。