在 SandBox 模式下未收到 PayPal IPN

Not receiving PayPal IPN when in SandBox mode

我正在使用 PayPal 的 Express Checkout 并使用 Merchant SDK 为 Java 编写了我的代码。

这涉及PayPal在SandBox模式下的IPN机制。

我已经创建了 IPN 侦听器并使用 IPN 模拟器对其进行了全面测试。我已确保我指定的通知 URL 收到消息,然后使用 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>

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

我希望他们能更新他们的文档以明确说明沙盒中使用的企业帐户也需要启用 IPN。为此,您需要前往 sandbox.paypal.com 并登录。