ob-dj-store 0.0.21.8__py3-none-any.whl → 0.0.22__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ob_dj_store/core/stores/models/_wallet.py +12 -2
- ob_dj_store/core/stores/receivers.py +14 -4
- {ob_dj_store-0.0.21.8.dist-info → ob_dj_store-0.0.22.dist-info}/METADATA +1 -1
- {ob_dj_store-0.0.21.8.dist-info → ob_dj_store-0.0.22.dist-info}/RECORD +6 -6
- {ob_dj_store-0.0.21.8.dist-info → ob_dj_store-0.0.22.dist-info}/WHEEL +0 -0
- {ob_dj_store-0.0.21.8.dist-info → ob_dj_store-0.0.22.dist-info}/top_level.txt +0 -0
@@ -120,8 +120,18 @@ class Wallet(models.Model):
|
|
120
120
|
method=payment_method,
|
121
121
|
amount=amount,
|
122
122
|
)
|
123
|
-
|
124
|
-
|
123
|
+
|
124
|
+
provider = payment_method.payment_provider
|
125
|
+
if provider == settings.TAP_ALL:
|
126
|
+
return (payment.tap_payment.payment_url, payment.tap_payment.charge_id)
|
127
|
+
elif provider == settings.STRIPE:
|
128
|
+
return (
|
129
|
+
payment.stripe_payment.payment_url,
|
130
|
+
payment.stripe_payment.payment_intent_id,
|
131
|
+
)
|
132
|
+
else:
|
133
|
+
logger.warning(f"Unsupported payment provider: {provider}")
|
134
|
+
return (None, None)
|
125
135
|
|
126
136
|
|
127
137
|
class WalletTransaction(models.Model):
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import logging
|
2
|
+
|
1
3
|
from django.conf import settings
|
2
4
|
from django.db.models.signals import post_save, pre_save
|
3
5
|
from django.dispatch import receiver
|
@@ -15,6 +17,8 @@ from ob_dj_store.core.stores.models import (
|
|
15
17
|
from ob_dj_store.core.stores.utils import get_currency_by_country
|
16
18
|
from ob_dj_store.utils.utils import resize_image
|
17
19
|
|
20
|
+
logger = logging.getLogger(__name__)
|
21
|
+
|
18
22
|
|
19
23
|
@receiver(
|
20
24
|
post_save,
|
@@ -28,10 +32,16 @@ def create_customer_cart_and_wallet_handler(sender, instance, created, **kwargs)
|
|
28
32
|
cart.save()
|
29
33
|
wallet_media = WalletMedia.objects.filter(is_default=True)
|
30
34
|
wallet_currencies = settings.WALLET_CURRENCIES
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
+
country = getattr(instance, "country", None)
|
36
|
+
logger.info("User country :", getattr(instance, "country", ""))
|
37
|
+
|
38
|
+
if country:
|
39
|
+
code = getattr(country, "code", None) or str(country)
|
40
|
+
|
41
|
+
if code:
|
42
|
+
currency = get_currency_by_country(code)
|
43
|
+
if currency not in wallet_currencies:
|
44
|
+
wallet_currencies = settings.US_WALLET_CURRENCIES
|
35
45
|
|
36
46
|
for currency in wallet_currencies:
|
37
47
|
instance.wallets.create(currency=currency, media_image=wallet_media.first())
|
@@ -18,7 +18,7 @@ ob_dj_store/core/stores/admin.py,sha256=aI1t3nIeOw_Vcy2E2LNaAxMRX2GjvVrVeBaH-n4I
|
|
18
18
|
ob_dj_store/core/stores/admin_inlines.py,sha256=9_35VwwRh5w8YU2CRTJ7sENUjF-D-J-o9jXhLEPpS3w,2900
|
19
19
|
ob_dj_store/core/stores/apps.py,sha256=ZadmEER_dNcQTH617b3fAsYZJSyRw0g46Kjp4eOAsOU,498
|
20
20
|
ob_dj_store/core/stores/managers.py,sha256=Q0PUB_LSz0bufJ0OfgHuvSC-5uAGSsDDlhitisFJqw4,10141
|
21
|
-
ob_dj_store/core/stores/receivers.py,sha256=
|
21
|
+
ob_dj_store/core/stores/receivers.py,sha256=EWG04q-QnVB9BvXxWoFy_LTyYQN6UNd09HPzfyZB4LY,4216
|
22
22
|
ob_dj_store/core/stores/settings_validation.py,sha256=eTkRaI6CG5OEJQyI5CF-cNAcvjzXf3GwX5sR97O3v98,3977
|
23
23
|
ob_dj_store/core/stores/utils.py,sha256=r6YdjQu5gsrZmO_qgXb21xcB50tbAI9vffN4Yp6n6iA,3427
|
24
24
|
ob_dj_store/core/stores/gateway/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -167,12 +167,12 @@ ob_dj_store/core/stores/models/_partner.py,sha256=OuYvevUWn1sYHs9PcFf51EUUC1uqyt
|
|
167
167
|
ob_dj_store/core/stores/models/_payment.py,sha256=SfAMVrdP2Hfz604AyO8EOjeiOgGMeJ8My0s5U4GZ7Yc,6650
|
168
168
|
ob_dj_store/core/stores/models/_product.py,sha256=KUi2hkA4VNCrWwWp3AM_tkubFptpOdiFt0Twzi2wW14,18535
|
169
169
|
ob_dj_store/core/stores/models/_store.py,sha256=0K-CNJWuXNqeyULL1J0M9hiNcVla0UNNjdCdN_nzNEE,9833
|
170
|
-
ob_dj_store/core/stores/models/_wallet.py,sha256=
|
170
|
+
ob_dj_store/core/stores/models/_wallet.py,sha256=QktPaDH2gOGDyOqBqY0lXU91gL2_MhHhy2d7GcCO1ZA,6019
|
171
171
|
ob_dj_store/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
172
172
|
ob_dj_store/utils/helpers.py,sha256=o7wgypM7mI2vZqZKkhxnTcnHJC8GMQDOuYMnRwXr6tY,2058
|
173
173
|
ob_dj_store/utils/model.py,sha256=DV7hOhTaZL3gh9sptts2jTUFlTArKG3i7oPioq9HLFE,303
|
174
174
|
ob_dj_store/utils/utils.py,sha256=8UVAFB56qUSjJJ5f9vnermtw638gdFy4CFRCuMbns_M,1342
|
175
|
-
ob_dj_store-0.0.
|
176
|
-
ob_dj_store-0.0.
|
177
|
-
ob_dj_store-0.0.
|
178
|
-
ob_dj_store-0.0.
|
175
|
+
ob_dj_store-0.0.22.dist-info/METADATA,sha256=J2lsAp-0OA0BqNanh5AGAVQIH8HrxC8zvAuHbcDILbk,2848
|
176
|
+
ob_dj_store-0.0.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
177
|
+
ob_dj_store-0.0.22.dist-info/top_level.txt,sha256=CZG3G0ptTkzGnc0dFYN-ZD7YKdJBmm47bsmGwofD_lk,12
|
178
|
+
ob_dj_store-0.0.22.dist-info/RECORD,,
|
File without changes
|
File without changes
|