Activating a subscription after capturing outstanding_balance will charge the customer again

alex_novacean
Contributor
Contributor

Hi,

I'm attempting to set up subscription based payments for an application using PayPal's REST API.

These are the payment preferences of the plan:

    "payment_preferences": {        "service_type": "PREPAID",        "auto_bill_outstanding": false,        "setup_fee": {            "currency_code": "EUR",            "value": "0.0"        },        "setup_fee_failure_action": "CANCEL",        "payment_failure_threshold": 1    }

 While testing the payment failure on sandbox i have noticed that after capturing the outstanding balance like described here: Payment failures and recovering balances , when i activate the subscription the next_billing_time will be set at 10:00AM GMT in the current day, and it will end up charging the customer twice.

Expected behavior is after capturing the outstanding balance to be able to activate the subscription and the next_billing_time should be at the end of this billing cycle.

How can i achieve this?

 

Thanks,

Alex [Removed].

Login to Me Too
4 REPLIES 4

mhelmntrs
Contributor
Contributor
To avoid the scenario where the subscription charges the customer twice in a short period, you should set the `auto_bill_outstanding` parameter to `true` when creating or updating the subscription. This will automatically attempt to collect the outstanding balance on the next billing cycle without requiring manual intervention. Here is an example of how you can modify your payment preferences: ```json "payment_preferences": { "service_type": "PREPAID", "auto_bill_outstanding": true, // Set this to true "setup_fee": { "currency_code": "EUR", "value": "0.0" }, "setup_fee_failure_action": "CANCEL", "payment_failure_threshold": 1 } ``` With `auto_bill_outstanding` set to `true`, PayPal will attempt to automatically collect any outstanding balance during the next billing cycle, reducing the chances of double-charging the customer. Make sure to review PayPal's documentation and guidelines regarding subscription creation and payment preferences to ensure that your implementation aligns with best practices and meets your specific requirements.
Login to Me Too

alex_novacean
Contributor
Contributor

Thank you for the reply.

I understand how auto_bill_outstanding works but i don't think is going to help me in the scenario I'm trying to achieve.

 

The subscriptions I want to set up are monthly subscription. This means the customer will be billed each month for the service he is using on our platform.

If the customer does not have enough balance in his PayPal account and he does not have any card or bank account associated with his PayPal account, the payment will fail. With payment_failure_threshold set to 1, PayPal will automatically put the subscription in SUSPENDED status and billing_info.outstanding_balance will reflect the amount of the failed payment.

 

We will allow another X days of usage of our service, during this time we will send the customer notifications via email that his payment failed and his subscription will be canceled, thus also revoking his access to our platform.

When the customer will make sure that his PayPal account has enough founds to perform the payment, from our side we need to execute the Capture authorized payment on subscription request to clear the billing_info.outstanding_balance of the subscription and process the payment.

 

When payment will succeed we have to execute another request to ACTIVATE the subscription again.

Attempting to activate the subscription while it still has outstanding_balance will fail and the subscription does not activate automatically after the outstanding balance was cleared (paid by the customer).

 

And here is the issue I'm facing, because when activating the subscription, the next_billing_time will be set in the same day the request to activate the subscription was executed, and it will end up charging the customer again.

 

If I use the auto_bill_outstanding feature, that means the customer will get an entire month free of service usage without payment and that is not something we can afford.

Login to Me Too

alex_novacean
Contributor
Contributor

Can anyone help me with this issue?

 

Summary:

 

What is the proper way of activating a subscription that was suspended because payment failed?

 

There is no mention about this here: Payment failures and recovering balances 

Login to Me Too

Kavyar
Moderator
Moderator

Good day @alex_novacean 

 

Thank you for posting to the PayPal community.

 

To activate a suspended subscription, please follow the below steps.

  1. Go to your Subscriptions.
  2. Select the subscription profile.
  3. Select the button next to "Active".

 

For more information, please visit the following link - https://www.paypal.com/in/cshelp/article/HELP289#

 

I recommend modifying the "payment_failure_threshold" value to prevent subscription suspension after a single payment failure.

 

The "payment_failure_threshold" refers to the maximum number of payment failures before a subscription is suspended.

 

Here are the steps to follow:

 

Login to Paypal.com >> go to "pay &get Paid" >> click on "subscription" >> select "Manage subscription" >> Locate the desired subscription plan >>Click on "See Details" which can be found under the three dots>> Navigate to "Pricing">> Under "Manage Your Billing Preferences", update the missed billing cycles accordingly.

 

For more information, kindly refer to the provided detailed guide link.

https://developer.paypal.com/docs/api/subscriptions/v1/#plans_create!path=payment_preferences/paymen...

 

If you are still experiencing issues, please create an MTS ticket via the following URL - https://www.paypal-support.com/s/?language=en_US . Please ensure that you provide detailed information and error details when submitting the ticket.

 

Sincerely,

Kavya

PayPal MTS

 

If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.