Help with Subscription Process

minyov
New Community Member

On my platform clients have the following process:

  1. Create subscription (+ free trial for 3 days and then 29.90$/m)
  2. Cancel subscription (it should be active until the paid month is over)
  3. Resume subscription (if sub was cancelled but paid month isn't over)

I have some questions:

  1. How do I need to process 2,3?
  2. Which event should I track to catch payment status every month?
  3. What is the difference between final_payment_due_date and next_billing_date

Here you may see the billing plan description:

billing_plan = paypal.BillingPlan({
            'name': self.name,
            'description': self.description,
            'merchant_preferences': {
                'auto_bill_amount': 'YES',
                'cancel_url': f'{settings.FRONT_END_HOST_URL}/settings/billing',
                'initial_fail_amount_action': 'CANCEL',
                'max_fail_attempts': '3',
                'return_url': f'{settings.FRONT_END_HOST_URL}/subscriptions/process',
                'setup_fee': {
                    'currency': 'USD',
                    'value': '0.00'
                }
            },
            'payment_definitions': [
                {
                    'name': 'Trial',
                    'type': 'TRIAL',
                    'frequency_interval': '1',
                    'frequency': 'DAY',
                    'cycles': '3',
                    'amount': {
                        'currency': 'USD',
                        'value': '0.00'
                    },
                    'charge_models': [
                        {
                            'type': 'TAX',
                            'amount': {
                                'currency': 'USD',
                                'value': '0.00'
                            }
                        },
                        {
                            'type': 'SHIPPING',
                            'amount': {
                                'currency': 'USD',
                                'value': '0.00'
                            }
                        }
                    ],
                },
                {
                    'cycles': '0',
                    'frequency': 'MONTH',
                    'frequency_interval': '1',
                    'name': 'Regular',
                    'type': 'REGULAR',
                    'amount': {
                        'currency': 'USD',
                        'value': str(self.price)
                    },
                    'charge_models': [
                        {
                            'type': 'TAX',
                            'amount': {
                                'currency': 'USD',
                                'value': '0.00'
                            }
                        },
                        {
                            'type': 'SHIPPING',
                            'amount': {
                                'currency': 'USD',
                                'value': '0.00'
                            }
                        }
                    ],
                }
            ],
            'type': 'INFINITE'
        }) 

 

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

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