Paypal Subscription not cancelled when payment fails

Laraship QuestionsCategory: TechnicalPaypal Subscription not cancelled when payment fails
jean.painter asked 5 years ago
Hi there, I'm busy writing a custom module that uses subscription functionality. 1) The problem I have has to do with the HandleInvoicePaymentFailed Job. As the implementation stands currently, a webhook call gets received and an Invoice(existing or not) is marked as failed only. No other logic happens. Is this to be expected as per LaraShip design? It doesn't seem like the Subscription status column gets changed from 'active' or the 'ends_a' updated with the failed date.   2) When a Paypal subscription is created the 'ends_at' and 'next_billing_at' are not filled. I need to use the info from 'next_billing_at' specifically and I'd like to know how to automatically fill this column as webhook success payments get processed. I kind of expected this to be part of a standard subscription library but it doesn't seem to be included.
1 Answers
laraship Staff answered 5 years ago

Hello Jean,

1) Invoice Payment failed does not mean that subscription has to be cancelled, there usually should be a nother webhook call called SubscriptionDeleted and SubscriptionCancelled.

2) Paypal Handles the payment and it manages the next billing date, the fielld in Laraship are for handling Manual Payments like Bank Payment and Cash on Delivery, however these are not needed for Paypal.

jean.painter replied 5 years ago

1) Ok, that clears it up for me.

2) Understood. I managed to extract the next billing date with another API call.