I am implementing subscriptions with PayPal and in my code, for the case when the payment fails, I cancel the subscription.
I tried to test the following case:
purchase a subscription with a card with insufficient funds
wait for the payment to fail
retry to pay with the same account with the same card, but with funds
a new subscription plan should be created because the initial one was cancelled
Unfortunately, the payment is not working for the account, even if the card has enough balance.
Why is this happening, why does the payment not work at the second try and how can I manage this case in my code?
Related
On our website we have option to pay using PayPal. At the time of signup our sytem creates recurring profile in users PayPal account and then till the account continue we receive recurring Payments.
On every successful payment PayPal send us the notifications with transaction details and we updates our system.
Sometimes our system miss the IPN notifications due to outage and as a result our system goes out of sync and does not updates the payments.
I would like to know do we have any PayPal API which we can call to get the transaction details of missing IPN notifications?
How to handle these transactions which are not updated in our system and IPN we ave missed?
I'm testing recurring payment on Sandbox of Paypal.
But I find out client's account is not enough money, but their own account is still recieved money.
If client 's account is not enough money, how does the paypal process?
This transaction will be suspend or cancel...
If client'account have enough money then the transaction become activate.
For initial payment, use FAILEDINITAMTACTION, Action you can specify when a payment fails. It is one of the following values:
ContinueOnFailure – By default, PayPal suspends the pending profile in the event that the initial payment amount fails. You can override this default behavior by setting this field to ContinueOnFailure. Then, if the initial payment amount fails, PayPal adds the failed payment amount to the outstanding balance for this recurring payment profile.
When you specify ContinueOnFailure, a success code is returned to you in the CreateRecurringPaymentsProfile response and the recurring payments profile is activated for scheduled billing immediately. You should check your IPN messages or PayPal account for updates of the payment status.
CancelOnFailure – If this field is not set or you set it to CancelOnFailure, PayPal creates the recurring payment profile, but places it into a pending status until the initial payment completes. If the initial payment clears, PayPal notifies you by IPN that the pending profile has been activated. If the payment fails, PayPal notifies you by IPN that the pending profile has been canceled.
Once you are into the regular billing cycle, Be sure to assign a value to MAXFAILEDPAYMENTS, which is the number of scheduled payments that can fail before the profile is automatically suspended. An IPN message is sent to the merchant when the specified number of failed payments is reached.
Then, AUTOBILLOUTAMT Indicates whether you would like PayPal to automatically bill the outstanding balance amount in the next billing cycle. The outstanding balance is the total amount of any previously failed scheduled payments that have yet to be successfully paid. It is one of the following values:
NoAutoBill – PayPal does not automatically bill the outstanding balance.
AddToNextBilling – PayPal automatically bills the outstanding balance.
it is up to you how to handle profiles that suspend.
We're using PayPal Payments Standard and IPN to process payment transactions and enable digital goods download after our IPN listener script recieves notification of a completed transaction.
We've done thorough testing on the PayPal sandbox and made sure our scripts handle different scenarios properly.
Just to be sure, before opening the sales to public, we've done some testing with the PayPal live interface - performed a few small sales using a previously verified PayPal account to pay for the goods.
Our IPN listener script has immediately received notifications, but the payment_status in both of them was 'pending' with pending_reason = 'paymentreview'. After logging to our seller PayPal account a few minutes after making the payment, both transactions have the status 'Completed' and are ready to ship, yet our IPN listener did not receive any further notification updating the status of the transactions.
By checking the IPN history on our seller PayPal account, we can see that only the initial messages for both payments have been sent (with status 'Pending').
The PayPal developer docs are explicit about not allowing the download or shipping goods before the transaction is succesfully completed, yet we do not receive an update via IPN even 48+ hours after the payments.
We did not experience any such problem during testing period on PayPal sandbox interface.
Is this an issue with the IPN interface, or there is something that can be configured through our PayPal account that will resolve this issue and make IPN behaviour consistant with PayPal developer docs?
On recurring paypal payment, what happens when CC expires?
Will it send IPN notification?
Will it send email to seller and buyer?
Will it be stopped till CC is not updated and continues when it get updated?
what exactly will happen, many thing is dependent on payment on sites.
When a credit card is going to expire the buyer needs to update their billing information. They buyer will get an e-mail from PayPal saying it is going to expire and asks the user to update their billing information.
If the buyer does not update their billing details the payment will probably fail. The reason it may not fail is because they may have money in their PayPal account or another funding source. And IPN post would be sent for the failed payment.
If the buyer does update their credit or debit card information before the Recurring Profile bills you should receive the payment successfully.
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.