Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Stripe : move customer_data field to metadata #407

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion payments/stripe/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
Expand Down
6 changes: 6 additions & 0 deletions payments/stripe/test_stripev3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
fabienheureux marked this conversation as resolved.
Show resolved Hide resolved
provider = StripeProviderV3(api_key=API_KEY)
provider.create_session(payment)

def test_provider_status(self):
payment = Payment()
provider = StripeProviderV3(api_key=API_KEY)
Expand Down
Loading