Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

feat: Handle Stripe webhooks payment received for DPM order fulfillment #4151

Merged
merged 14 commits into from
Apr 15, 2024

Conversation

julianajlk
Copy link
Contributor

@julianajlk julianajlk commented Apr 3, 2024

REV-3973.

Order creation, fulfillment, billing address creation must be addressed via webhook events for Dynamic Payment Methods.
Adding a WebhooksPayment class to handle all that is needed after a payment is successfully received.
Redirect to receipt URL will happen via payment MFE redirect.

This PR also adds/updates the receipt error page to include a message specific for DPM.

@julianajlk julianajlk requested a review from a team as a code owner April 3, 2024 16:37
@julianajlk julianajlk force-pushed the julianajlk/REV-3973/use-webhooks-for-dpm-bnpl branch 16 times, most recently from 481531e to 32d72d2 Compare April 9, 2024 17:57
@julianajlk julianajlk force-pushed the julianajlk/REV-3973/use-webhooks-for-dpm-bnpl branch from 32d72d2 to 901f9bf Compare April 9, 2024 18:02
ecommerce/extensions/api/v2/views/webhooks.py Outdated Show resolved Hide resolved
ecommerce/extensions/api/v2/views/webhooks.py Outdated Show resolved Hide resolved
ecommerce/extensions/checkout/mixins.py Show resolved Hide resolved

@property
def payment_processor(self):
return Stripe(self.site)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repeating back here to make sure I understand what we chatted about, but basically this payment_processor method is here because the payment processor this class uses is Stripe, BUT we don't use the other payment processor class because we we require different functionality than synchronous purchases (and the things that behave differently are overridden below)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I added this here because somewhere in the code it references the same of the processor, which we want it to be Stripe and not the StripeWebhooksPayment. I will get back to you where.

ecommerce/extensions/payment/processors/webhooks.py Outdated Show resolved Hide resolved
ecommerce/management/tests/test_utils.py Outdated Show resolved Hide resolved
ecommerce/management/utils.py Outdated Show resolved Hide resolved
@julianajlk julianajlk force-pushed the julianajlk/REV-3973/use-webhooks-for-dpm-bnpl branch 3 times, most recently from 93705ee to 585d670 Compare April 10, 2024 15:11
@julianajlk julianajlk force-pushed the julianajlk/REV-3973/use-webhooks-for-dpm-bnpl branch 2 times, most recently from ea669c6 to 41ec2ed Compare April 10, 2024 21:38
@julianajlk julianajlk force-pushed the julianajlk/REV-3973/use-webhooks-for-dpm-bnpl branch 4 times, most recently from b8221e0 to 22bc6b7 Compare April 11, 2024 20:48
@julianajlk julianajlk force-pushed the julianajlk/REV-3973/use-webhooks-for-dpm-bnpl branch from 22bc6b7 to e7b43bd Compare April 12, 2024 13:43
@julianajlk julianajlk force-pushed the julianajlk/REV-3973/use-webhooks-for-dpm-bnpl branch from 54a3d5a to 6335635 Compare April 12, 2024 17:53
@julianajlk julianajlk force-pushed the julianajlk/REV-3973/use-webhooks-for-dpm-bnpl branch from 18f27eb to 1abc1ba Compare April 12, 2024 19:31
@julianajlk julianajlk force-pushed the julianajlk/REV-3973/use-webhooks-for-dpm-bnpl branch from 1abc1ba to b51172c Compare April 12, 2024 20:01
@julianajlk julianajlk merged commit 9533cd4 into 2u/main Apr 15, 2024
8 checks passed
@julianajlk julianajlk deleted the julianajlk/REV-3973/use-webhooks-for-dpm-bnpl branch April 15, 2024 13:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants