I am using PayPal's Express Checkout and have written my code using Merchant SDK for Java.
This relates to PayPal's IPN mechanism in SandBox mode.
I have created the IPN Listener & tested it thoroughly using the IPN Simulator. I have made sure that the Notification URL I specify receives the message & then verifies that again with SandBox URL for IPN verification.
But I am not receiving any IPN in SandBox mode when I actually trigger proper payment flows like creating a billing agreement, doing a reference transaction & cancelling a billing agreement.
This is a sample payload when I DoReferenceTransaction. I have also pasted the response from this below.
<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>[email protected]</ebl:PayPalAccountID>
</ebl:SellerDetails>
<ebl:PaymentAction>Sale</ebl:PaymentAction>
</ebl:PaymentDetails>
</ebl:DoReferenceTransactionRequestDetails>
</ns:DoReferenceTransactionRequest>
</ns:DoReferenceTransactionReq>
</soapenv:Body>
</soapenv:Envelope>
Response
<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>
After I enabled the IPN for the particular sandbox business account then the IPNs started showing up.
I wish they would update their documentation to explicitly state that the business account that is used in sandbox needs to also have it's IPN enabled. And to do that you need to go to sandbox.paypal.com & sign in.