Comments (3)
I manually executed the verify()
method on the unflagged, second IPN and now it is correctly marked as duplicate txn_id
.
I also manually executed that on the original IPN and it correctly remains unflagged.
So a workaround would be to call verify()
again on every IPN received and check if it remains unflagged.
from django-paypal.
This sounds like a valid issue. The code here looks buggy for the case when you have out-of-order notification of IPNs:
django-paypal/paypal/standard/helpers.py
Lines 17 to 38 in 24d914b
Could you check for your case that there were other IPNs with the same txn_id but different payment_status? Otherwise, we have to look further for the cause.
We should probably be instead checking for duplicate (txn_id, payment_status)
. I say "probably*, because that would involve trusting that PayPal are doing something sensible with how they send IPNs, or at least documented. Based on experience it's possible that neither are true...
from django-paypal.
Clearly, the code above checks only if the latest similar IPN has the same payment status. If the latest has a different status but the previous has the same, it doesn't recognize it as duplicate.
So the question is why we make this difference and not just this?:
duplicates = (ipn_obj.__class__._default_manager
.filter(txn_id=ipn_obj.txn_id)
.exclude(id=ipn_obj.id)
.exclude(flag=True)
.exclude(payment_status=ipn_obj.payment_status)
return duplicates.exists()
Still, it doesn't seem that that's what's going on here. If you look at the picture above, those are the only IPNs with that txn_id
and all have the same payment_status
. There are no other IPNs. After I ran verify()
again (which calls duplicate_txn_id()
) one that was unflagged (3:01 am) became flagged as duplicate.
So maybe it happened that the first two (3 am and 3:01 am) arrived concurrently?
Here is the picture after running verify()
on them again:
from django-paypal.
Related Issues (20)
- Upgrade or Downgrade subscription plan HOT 1
- PDT payments intermittently broken? HOT 4
- Listing the payments HOT 1
- Paypal notify url webook expecting x-www-form-urlencoded but received application/json from paypal HOT 1
- Testing with paypal sandbox and ngrok resulting in invalid postback HOT 1
- Paying directly with a debit card HOT 1
- Working with react js HOT 1
- version 2.0 - update docs and tag HOT 3
- Encrypted form gives different interface on PayPal HOT 1
- Custom data got truncated HOT 4
- "Things don't appear to be working at the moment. Please try again later." HOT 3
- Add pay now button
- untested warning for is_subscription HOT 4
- How to use this sdk in django-rest-framework HOT 2
- Any pointers on how to integrate with Django Oscar?
- application/json vs application/x-www-form-urlencoded
- Increase the size of the logo HOT 2
- Add `Django 5.0` compatibility. HOT 2
- Outdated package and documentation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-paypal.