Skip to content

Commit

Permalink
todopago: Keep customer_id short when using UUIDs
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Osvaldo Barrera committed Apr 13, 2022
1 parent b16eb2e commit e278947
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 e278947

Please # to comment.