Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPv2 APM: Create referenced PPObjects for APM Orders; enable webhooks to capture them #3958

Merged
merged 2 commits into from
May 27, 2024

Conversation

pc-coholic
Copy link
Member

We are seeing some customers using APMs losing payments and bookings, as they seem to get lost in the process.

  • Customer pays with APM such as giropay or SOFORT
  • Order does not receive any webhook LogEntries for order being captureable
  • pretix doesn't capture anything
  • order expires
  • PayPal refunds the money back after some days

As of right now, the only time a capture is occurring is when a the PayView POSTs (after a successful payment) or if the success-view is hit. This is done through the execute_payment()-function of the payment provider.

We are in the process of researching what the customer is doing exactly to apparently never hit these pages (or if they hit them, why nothing happens).

By manually removing the calls to execute_payment from views.py, I was able to recreate the behavior: An approved payment with no LogEntries for the "Order approved"-webhooks.

The latter is caused by a lack of ReferencedPayPalObject at this point - it also only gets written once the execute_payment() is run and we have something to capture.

This PR changes two things:

  • Creating ReferencedPayPalObjects for orders, if a payment object already exists (aka: for APMs)
  • Add handling logic to the webhook to send a Order approved-payment through the capture-process

Ref: Z#23141601, Z#23146632

@cla-bot cla-bot bot added the cla-signed label Mar 5, 2024
Copy link

codecov bot commented Mar 5, 2024

Codecov Report

Attention: Patch coverage is 46.66667% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 78.11%. Comparing base (3b98d87) to head (3113fdb).
Report is 246 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3958      +/-   ##
==========================================
+ Coverage   78.06%   78.11%   +0.05%     
==========================================
  Files         427      430       +3     
  Lines       59531    60522     +991     
==========================================
+ Hits        46471    47279     +808     
- Misses      13060    13243     +183     
Files Coverage Δ
src/pretix/plugins/paypal2/payment.py 30.02% <30.00%> (-0.09%) ⬇️
src/pretix/plugins/paypal2/views.py 37.53% <55.00%> (-0.24%) ⬇️

... and 95 files with indirect coverage changes

@pc-coholic pc-coholic requested a review from raphaelm May 23, 2024 14:19
@pc-coholic pc-coholic merged commit 5758e0d into master May 27, 2024
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants