diff --git a/payments/stripe/providers.py b/payments/stripe/providers.py index 8f37d18b3..330975fd7 100644 --- a/payments/stripe/providers.py +++ b/payments/stripe/providers.py @@ -130,7 +130,7 @@ def create_session(self, payment): if payment.billing_first_name or payment.billing_last_name: session_data.update( { - "customer_data": { + "metadata": { "customer_name": f"{payment.billing_first_name} " f"{payment.billing_last_name}" } diff --git a/payments/stripe/test_stripev3.py b/payments/stripe/test_stripev3.py index ea3c7a506..d219a6360 100644 --- a/payments/stripe/test_stripev3.py +++ b/payments/stripe/test_stripev3.py @@ -107,6 +107,12 @@ def test_provider_create_session_failure_with_transaction_id(self): with patch("stripe.checkout.Session.create"), self.assertRaises(PaymentError): provider.create_session(payment) + def test_provider_create_session_success_with_billing_name(self): + payment = Payment() + payment.billing_name = "Billy Ngname" + provider = StripeProviderV3(api_key=API_KEY) + provider.create_session(payment) + def test_provider_status(self): payment = Payment() provider = StripeProviderV3(api_key=API_KEY)