Skip to content

Commit

Permalink
Merge pull request #313 from jazzband/todopago-cust-id-uuid
Browse files Browse the repository at this point in the history
todopago: Keep customer_id short when using UUIDs
  • Loading branch information
Hugo authored Apr 14, 2022
2 parents b16eb2e + e278947 commit 0d2e38c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion payments/todopago/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ def authorize_operation(self, payment: BasePayment) -> Authorization:
billing_postcode=payment.billing_postcode,
billing_address_1=payment.billing_address_1,
billing_address_2=payment.billing_address_2,
customer_id=payment.pk,
# A UUID won't fit into the maximum length of this field.
# It _will_ fit if the dashes are removed.
# For primary keys of other data types, this has no effect.
customer_id=str(payment.pk).replace("-", ""),
customer_ip_address=payment.customer_ip_address,
items=[
Item(
Expand Down

0 comments on commit 0d2e38c

Please sign in to comment.