Repository navigation
fix: correct type divergences (pagination, billing fee, enums, wallet creation, payin tracking) - #37
Merged
Merged
Conversation
…ling fee, enums, wallet creation, payin tracking)
Fixes six live defects surfaced by the api-sync patcher's ledgers, verified against the
current published OpenAPI spec:
- PaginationMetadata.next_page/prev_page are nullable string cursors, not int; the SDK
threw a TypeError on any real paginated response with a next/prev page.
- Payin.billingFeeAmount is a number in the spec; the SDK declared it as string with no
cast, throwing whenever the fee was populated.
- BankAccountType::SAVINGS carried the wrong wire value ('savings' instead of 'saving'),
so a real savings account_type response failed to parse.
- EstimatedAnnualRevenue's top bucket had an extra digit ('2500000000_plus' instead of
'250000000_plus').
- CreateCustodialWalletInput was missing the required `name` field, so every custodial
wallet creation call was rejected by the API.
- Payin and payout shared a single TrackingPayment decoder, but the payin tracking_payment
shape lacks the payout-only fields (provider_transaction_id/provider_status/
estimated_time_of_arrival) that class required as non-nullable strings, throwing a
TypeError on payin fetch. Split into PayinTrackingPayment and PayoutTrackingPayment
matching each spec shape.
Bumps VERSION to 3.2.0. Removes the known-divergences/unmodeled ledger entries these
fixes resolve.
Claude-Session: https://claude.ai/code/session_01F1stiNzuNtJXoXtiW9ZCbs
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes six live defects recorded in
.api-sync/known-divergences.jsonand.api-sync/unmodeled.json, verified against the current published OpenAPI spec:next_page/prev_pageare nullable string cursors in the spec; the SDK declared them asint. Any real paginated response with a next/prev page threw aTypeError. Fixed to?string.number|null; the SDK declared?stringwith no cast. Threw whenever the fee was populated (end of month). Fixed to?floatwith a cast infromArray.saving(singular); the SDK case value wassavings(plural). A realsavingaccount_type response failed to parse via::from(). Fixed the case value.2500000000_plusinstead of250000000_plus). Fixed the case value.nameis required by the spec (required: ["network","name"]) but was missing from the constructor entirely, so every custodial wallet creation call was rejected by the API. Added$nameas a required promoted constructor param (positional shift, endpoint was unusable before this).TrackingPaymentdecoder, but the spec shapes differ. Payin'stracking_paymentlacks the payout-only fields (provider_transaction_id/provider_status/estimated_time_of_arrival) that class declared as non-nullable strings, so decoding a payin's tracking data threw aTypeError. Split intoPayinTrackingPayment(step/provider_name/completed_at) andPayoutTrackingPayment(adds the four payout-only fields, all nullable per spec).Bumps
VERSION(BlindPay::VERSION constant) to 3.2.0. Removes the ledger entries these fixes resolve fromknown-divergences.jsonandunmodeled.json, and updates the correspondingspec-map.jsonnotes.api-sync --audit-types delta
12 mismatches resolved, 0 introduced:
php scripts/api-sync.php --checkpasses clean before and after.composer test(118 tests, 729 assertions),composer run lint:check, andphp scripts/contract-check.phpall pass.Test plan
composer install+composer run test-- 118 passedcomposer run lint:check-- cleanphp scripts/api-sync.php --check-- exit 0php scripts/api-sync.php --audit-typesbefore/after diff captured abovephp scripts/contract-check.php-- OKhttps://claude.ai/code/session_01F1stiNzuNtJXoXtiW9ZCbs