Closed thenewguy closed 7 months ago
@thenewguy this is expected as we currently check for existence of basket_payment
or order_payment
to determine if PaymentMethod supports paying for basket/order.
So the method needs to be defined in the class registered in SALESMAN_PAYMENT_METHODS
.
What you did in PayOnDelivery3
should do it:
def basket_payment(self, *args, **kwargs):
return super().basket_payment(*args, **kwargs)
I've been working my way through a proof of concept. I really like how you've put this together! It offers enough to be very useful without getting in the way =)
However, this issue is not super intuitive and there is no error message or indication of why the payment method isn't shown. It took me a fair amount of time to track down the cause. It certainly wasn't expected that typical class inheritance would be unsupported and I would imagine that I will not be the only one to stumble here.
Is that the only way for the existence check to work? If so, what about a boolean flag instead?
I was refactoring a payment method and noticed that when I used a base class to hold common method that the payment method choices were no longer presented.
Here is a simple example using the documented payment methods:
Payment Methods:
Setting:
When selected the payment method, PayOnDelivery2 is not presented as a choice.