st8st8 / django-oscar-stripe-sca

Stripe checkout for django oscar
MIT License
10 stars 3 forks source link

Bonus question: How to have stripe-sca + another payment method? #6

Closed j2l closed 1 month ago

j2l commented 8 months ago

Hello, I know it's not a bug, django-oscar-stripe-sca sandbox works very well, but you're a django-oscar guru @st8st8, and I didn't find anywhere how to implement 2 payment methods.

Basically, I have 2 working sandboxes, django-oscar-stripe-sca (let's call it doss) and django-oscar-accounts (AKA doa, helpful to do tests for partial payments).

Both claim to supersede checkout name, so I renamed yours to stripescaapps.checkout.apps.StripeSCASandboxCheckoutConfig.

I can go up to payment_details, and I merged the 2 templates, having your payment_details_content block and payment_details block from doa. Since doa was untouched, only payment_details block appears at checkout, doss payment_details_content block is ignored.

I also tried to paste the doss form into the payment_details block, but it misses the stripe key, alerts you, and reverts to pre-2019 form where you enter CC into a pop-in window: image

According to the oscar doc, we can mix payment methods, say partially paying with doa, then the rest with doss. But nowhere I found HOW to have 2 payment methods to pay for the same order.

Do you have any idea?

st8st8 commented 7 months ago

Hey,

That's not something I've done myself, and I suspect it's quite rare, so you may find that you do have to do a chunk of the build yourself. It sounds like you're trying to do the right things.

I've only implemented shops where you select a payment method during checkout (Stripe, PayPal etc) and pay for the whole order using that.

It sounds like you'll need to override one of the views (possibly the PaymentDetailsView) with a view of your own that combines the two elements. That means you'll need to fork the Checkout App if you haven't already.

j2l commented 7 months ago

Thank you so much @st8st8 to share your experience and skills!

you select a payment method

Let's start with this. How to add another payment method to switch next form to the selected one?

st8st8 commented 7 months ago

This is the guide that I used to implement my payment method form:

https://stackoverflow.com/questions/49349883/how-to-add-few-payment-methods-to-django-oscar

j2l commented 7 months ago

Thank you @st8st8 I'll study this ASAP!