Divide the amount received from Stripe by 100.0 #40

Merged
valberg merged 1 commit from benjaoming/membersystem:fix-payment into main 2024-08-04 07:34:51 +00:00

View file

@ -168,7 +168,7 @@ def stripe_webhook(request: HttpRequest) -> HttpResponse:
if not models.Payment.objects.filter(order=order).exists(): if not models.Payment.objects.filter(order=order).exists():
models.Payment.objects.create( models.Payment.objects.create(
order=order, order=order,
amount=Money(event["data"]["object"]["amount_total"], event["data"]["object"]["currency"]), amount=Money(event["data"]["object"]["amount_total"] / 100.0, event["data"]["object"]["currency"]),
description="Paid via Stripe", description="Paid via Stripe",
payment_type=models.PaymentType.objects.get_or_create(name="Stripe")[0], payment_type=models.PaymentType.objects.get_or_create(name="Stripe")[0],
external_transaction_id=event["id"], external_transaction_id=event["id"],