Skip to content

fix(account): PaymentMethod.credit_card_ends_with should be String, not i32#87

Merged
joshrotenberg merged 1 commit into
mainfrom
fix/payment-method-credit-card-string
May 15, 2026
Merged

fix(account): PaymentMethod.credit_card_ends_with should be String, not i32#87
joshrotenberg merged 1 commit into
mainfrom
fix/payment-method-credit-card-string

Conversation

@joshrotenberg
Copy link
Copy Markdown
Contributor

Summary

PaymentMethod.credit_card_ends_with was typed Option<i32> but the OpenAPI example shows it as a string. Real responses commonly include leading-zero card tails (e.g. "0042") which an i32 would mangle (drop the leading zero) or fail to deserialize.

Changed to Option<String>. Updated the previously vacuous test_get_account_payment_methods to mount a realistic shape including a leading-zero tail and assert it round-trips intact.

Breaking change

Public field type changed. The previous typing silently mis-handled real responses, so no production caller can have been relying on it.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace — all pass; test_get_account_payment_methods now asserts the actual round-trip

Closes #77
Refs #40 (spec deltas)

…ot i32

The OpenAPI example for `PaymentMethod` shows `creditCardEndsWith` as a
string, and real responses commonly include leading-zero card tails
(e.g. `"0042"`) that lose information when typed as `i32` — or fail to
deserialize entirely if the value contains non-numeric formatting.

Strengthens `test_get_account_payment_methods` from a vacuous
`account_id.is_some()` check to a realistic round-trip that includes a
`paymentMethods` array with a leading-zero card tail and asserts the
field comes through intact.

Breaking change to a public field type. The previous typing would
silently mis-handle real responses, so no production caller can have
been relying on the numeric form.

Refs #40 (spec deltas tracking)
Closes #77
@joshrotenberg joshrotenberg merged commit a45c208 into main May 15, 2026
8 checks passed
@joshrotenberg joshrotenberg deleted the fix/payment-method-credit-card-string branch May 15, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(account): PaymentMethod.credit_card_ends_with should be String, not i32

1 participant