openfun / joanie

👛 A headless ERP for education to manage course enrollment/subscription, payment and certificates delivery.
MIT License
20 stars 2 forks source link

✨(backend) pay failed installment in payment schedule of an order #797

Closed jonathanreveille closed 1 month ago

jonathanreveille commented 1 month ago

Purpose

New endpoint to pay a failed installment payment that was scheduled on an order. If the card_id is given, then the payment will go through the create_one_click_payment. Else, if no card_id is passed in the payload, the endpoint will use create_payment method. In order to simplify our code on the ownership of a credit card, we have decided to add a new Manager class for the CreditCard model. The manager class has one method that retrieves the credit card object if the queryset matches the input card_id and the owner_id.

Proposal