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
[x] new endpoint in order viewset
[x] new manager class for credit manager to avoid doing the same queryset everything to check if the credit card is the owners.
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 thecreate_one_click_payment
. Else, if nocard_id
is passed in the payload, the endpoint will usecreate_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 theCreditCard
model. The manager class has one method that retrieves the credit card object if the queryset matches the inputcard_id
and theowner_id
.Proposal