Skip to content

Use JSONField for BasePayment.attrs#306

Open
WhyNotHugo wants to merge 1 commit intomainfrom
drop-dj22
Open

Use JSONField for BasePayment.attrs#306
WhyNotHugo wants to merge 1 commit intomainfrom
drop-dj22

Conversation

@WhyNotHugo
Copy link
Copy Markdown
Member

Need to wait until Django 2.2 is EOL.

@mariofix
Copy link
Copy Markdown
Member

mariofix commented May 6, 2023

Hi! I'm actually wanting to use this, since 2.2 has already been dropped, can I give you a hand with this?

@WhyNotHugo
Copy link
Copy Markdown
Member Author

I've rebased this, but it would be good to have some more testing before merging it.

@mariofix
Copy link
Copy Markdown
Member

mariofix commented May 25, 2023

I'll start using it right away, and let you know, my system processes a couple thousands purchases a day, so it's a fair trial.

@WhyNotHugo
Copy link
Copy Markdown
Member Author

Tests seem to still be failing on a bunch on combinations of Django + Python, so I'd hold testing it on a production environment for a bit.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2023

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Comparison is base (84b52c9) 78.42% compared to head (2574ae3) 77.95%.

Files Patch % Lines
payments/cybersource/__init__.py 44.44% 3 Missing and 2 partials ⚠️
payments/models.py 50.00% 4 Missing ⚠️
payments/stripe/__init__.py 0.00% 3 Missing ⚠️
payments/paypal/__init__.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #306      +/-   ##
==========================================
- Coverage   78.42%   77.95%   -0.48%     
==========================================
  Files          29       29              
  Lines        1979     1964      -15     
  Branches      244      244              
==========================================
- Hits         1552     1531      -21     
- Misses        310      317       +7     
+ Partials      117      116       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@WhyNotHugo WhyNotHugo changed the title DRAFT: Use JSONField for BasePayment.attrs Use JSONField for BasePayment.attrs Oct 14, 2023
@WhyNotHugo WhyNotHugo marked this pull request as draft October 14, 2023 09:03
@WhyNotHugo
Copy link
Copy Markdown
Member Author

Looks like f4dfa5e is breaking some tests, but it's not clear to me why.

@WhyNotHugo
Copy link
Copy Markdown
Member Author

Split the first commit into #385

@WhyNotHugo WhyNotHugo force-pushed the drop-dj22 branch 2 times, most recently from b77385d to 6082843 Compare October 19, 2023 17:30
@WhyNotHugo WhyNotHugo marked this pull request as ready for review March 29, 2026 14:36
@WhyNotHugo WhyNotHugo force-pushed the drop-dj22 branch 3 times, most recently from af60835 to a18479b Compare March 29, 2026 14:39
@WhyNotHugo WhyNotHugo requested a review from mariofix March 29, 2026 14:39
Comment thread payments/stripe/providers.py Outdated
raise PaymentError(e) from e
else:
payment.attrs.refund = json.dumps(refund)
payment.extra_data["refund"] = json.dumps(refund)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i believe this should be payment.extra_data["refund"] = refund

Copy link
Copy Markdown
Member

@mariofix mariofix left a comment

Choose a reason for hiding this comment

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

A long waited change, line 166 in stripe/providers.py i believe this should be payment.extra_data["refund"] = refund

I just thought... should we include instructions on how to safely apply the migration without losing data?

@WhyNotHugo
Copy link
Copy Markdown
Member Author

Good catch, updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants