Paypal recurring payment IPN messages - paypal

I'm unsure as to what IPN messages I should be expecting when a recurring payment is setup through the Express Checkout API.
The period is three months with the first three months free.
When the customer signs up, I expect an IPN message with transaction type (txn_type) recurring_payment_profile_created.
After three months, I expect a message with txn_type = recurring_payment and a payment_status. As far as I can tell, I should not be receiving one of these until after the end of the trial period.
But what message will I receive when a customer cancels the recurring payment? The only likely candidate for txn_type I can see is subscr_cancel, but this is listed with other subscr_x types, and I understand that subscriptions are distinct from recurring payments.
Will I receive an IPN with txn_type = subscr_cancel when a customer cancels are recurring payment, or will I receive something else (and if so, what will I receive)?

You will receive an IPN for the profile creation when the user signs up. You will also receive an IPN for each recurring payment when they are processed. When the profile is cancelled, you will receive another IPN for this. You will get an IPN with txn_type=recurring_payment_profile_cancel.

Related

PayPal recurring payment verification

After one has created a monthly billing agreement with a customer; how do I verify that the customer has paid (and not cancelled the agreement) at the next bill statement?
Would I use GetRecurringPaymentsProfileDetails for this information? Basically, I want to automate cancellations/etc.
In your ipn end point a subscr_cancel txn_type is sent when this happens. Then you can update a record in your database to account for this.
Ipn messages when enabled send post requests for all kinds of actions such when a Payment is made or a subscription is cancelled. When you receive a message you need to validate the message, determine what message it is, and then perform an action in your application
Ipn info
https://developer.paypal.com/docs/classic/products/instant-payment-notification/

After setting up PayPal Instant Payment Notification, can I resend the IPN for historic transactions retroactively?

I have just set up PayPal IPN for my website.
https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNSetup/
Unfortunately, someone bought my product before the IPN was set up correctly.
Is there a way to apply the IPN notification to a historic transaction from yesterday that did not originally send an IPN?
Login to your account at PayPal, find IPN History, find the transaction: you can resend it from there.
Of course if IPN wasn't enabled when they bought, there is nothing to resend.

Delays in CC payment processing by paypal?

I am working on a subscription system that integrates payments through CC and paypal account, the problem happens in delay in activating the recurring profile of subscribers paying through CC.
I am using "CreateRecurringPaymentsProfile" API call for creating recurring profile. Initially I relied solely on IPN messages for payment confirmation, but there are delays in receiving these sometimes for few hours, for some users, but since IPN messages are only initiated with changes made in merchant's account, i believe the transfer of money could take time, and thus the delay.
I then thought of momentarily activating the profile based on instant responses from "CreateRecurringPaymentsProfile" and then the account is deactivated if we subsequently receive a IPN messages of txn_type payment skipped. My question is how most sites implement instant activating recurring payments using paypal api and is SUCCESS response from "CreateRecurringPaymentsProfile" is reliable to indicate that payment has happened?

Paypal IPN - Differentiating between Recurring Payment and Initial Payment

I've created a recurring payments profile on Paypal setting an initial payment.
When I receive the IPN, the txn_id is the same for both the initial payment and the recurring payment. I would like to know if there's a way of differentiating between them.
I've noticed that when I receive the recurring payment, there's this variable "period_type= Regular". This doesn't appear in the initial payment IPN. Is this a good way to make the distinction?
Thanks
I think you might be getting confused with what you're getting in the IPN's.
When the profile is first created, you'll get an IPN with the profile ID of the profile that was just created, and you would only get a transaction ID if you included the original amount to be charged. The transaction ID here is only for that original amount. If you didn't have that all you would get is the profile ID.
If your recurring payments are scheduled to start on the same day as well you will get an additional IPN for the recurring payment and that will have its own transaction ID.

PayPal Subscription Payment Failed

When a subscription payment fails, PayPal will retry for n times.
What transaction type (subscr_cancel or subscr_eot) is sent back via IPN, after all retries fail?
The specifics depend on the PayPal product you're using, although the logic works similar(`ish) across both Website Payments Standard subscription buttons and Express Checkout Recurring Payments (via the CreateRecurringPaymentsProfile API):
This depends on whether you've set MAXFAILEDPAYMENTS or not. If MAXFAILEDPAYMENTS > 0 is set, it will cancel the subscription after n number of attempts and you'll receive a subscr_cancel. If you have it set to MAXFAILEDPAYMENTS=0, you'll get recurring_payment_skipped and the recurring payment will be marked as having an outstanding balance. If you specify AUTOBILLOUTAMT=AutoBillAmt, the outstanding balance will be added to the next billing cycle.
I would suggest taking a look at https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables#id091EB0901HT which lists all IPN variables, including the ones for recurring payments.
Paypal returns subscr_failed for this case, and the possible return values are:
subscr_signup: subscription sign-up.
subscr_cancel: subscription cancellation.
subscr_failed: subscription payment failure.
subscr_payment: subscription payment.
subscr_eot: subscription’s end-of-term.
subscr_modify: subscription modification.
Please click here for further clarification.