This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add PaymentIntentId attribute for Basket for use with Stripe (#…
- Loading branch information
1 parent
bec2e2b
commit 481f310
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
TEMPORARY_BASKET_CACHE_KEY = "ecommerce.is_calculate_temporary_basket" | ||
EMAIL_OPT_IN_ATTRIBUTE = "email_opt_in" | ||
PURCHASER_BEHALF_ATTRIBUTE = "purchased_for_organization" | ||
PAYMENT_INTENT_ID_ATTRIBUTE = "payment_intent_id" |
27 changes: 27 additions & 0 deletions
27
ecommerce/extensions/basket/migrations/0015_add_paymentintentid.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import absolute_import, unicode_literals | ||
|
||
from django.db import migrations | ||
|
||
from ecommerce.extensions.basket.constants import PAYMENT_INTENT_ID_ATTRIBUTE | ||
|
||
|
||
def create_attribute(apps, schema_editor): | ||
BasketAttributeType = apps.get_model('basket', 'BasketAttributeType') | ||
BasketAttributeType.objects.create(name=PAYMENT_INTENT_ID_ATTRIBUTE) | ||
|
||
|
||
def delete_attribute(apps, schema_editor): | ||
BasketAttributeType = apps.get_model('basket', 'BasketAttributeType') | ||
BasketAttributeType.objects.get(name=PAYMENT_INTENT_ID_ATTRIBUTE).delete() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('basket', '0014_line_date_updated'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(create_attribute, delete_attribute), | ||
] |