Wave 1: customer.* webhook events, customer_id filters, live-bug fixes - #32
Merged
Conversation
Adds the parts of the receivers-to-customers rename that the currently deployed API already supports, ahead of blindpay-v2 PR #1799: - WebhookEvents gains CUSTOMER_NEW/CUSTOMER_UPDATE/CUSTOMER_DELETE cases, additive alongside the existing RECEIVER_NEW/RECEIVER_UPDATE cases (now marked @deprecated). The deployed WebhookEndpointIn.events enum already lists the customer.* values and dual-emits, so subscribing today is safe. - ListPayinsInput and ListPayoutsInput gain an additive customerId filter mapped to customer_id, since GET /payins and GET /payouts already accept that query param today. receiverId/receiver_id is kept for backward compatibility. - Fix two live TypeErrors in Customers.php: Owner::fromArray and LimitIncreaseRequest::fromArray were reading customer_id for nested fields the deployed API still keys receiver_id (no dual-emit at that nesting level), so any business customer with owners or any getLimitIncreaseRequests() call threw today. - Delete src/Types/WebhookEvent.php, a dead duplicate enum that also failed php -l from a duplicated case. - Document the Customers/CustomersWrapper resource in CLAUDE.md (previously undocumented) and fix stale receiver_id/receivers references in doc examples that no longer match the shipped code. - Bump VERSION to 2.5.0 (minor, additive only). The other 11 field renames (customer_local_amount, customer_type, customer_kyc_status, etc.), RECEIVERS_* error codes, and removing the legacy Receivers resource are intentionally NOT included here: the deployed API does not accept those yet and shipping them now would break every user of this SDK until blindpay-v2 PR #1799 deploys. 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. |
…t-increase id parsing RECEIVER_DELETE was dropped from the active WebhookEvents enum when WebhookEvent.php was deleted, silently breaking the only way to subscribe to receiver.delete, which the API still emits. Restored it as @deprecated. LimitIncreaseRequest::fromArray read receiver_id, but the response middleware only ever supplies customer_id on this route; switched to customer_id. Owner::fromArray read receiver_id, but nested owners[] elements are not covered by the response middleware, so customer_id is not present there today. Made customerId nullable and read customer_id first, falling back to receiver_id, so it works both before and after the customer_id migration lands server-side. Claude-Session: https://claude.ai/code/session_01F1stiNzuNtJXoXtiW9ZCbs
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.
What
Ships the part of the receivers-to-customers rename that the currently deployed BlindPay API already accepts, ahead of blindpay-v2 PR #1799 (still open, not deployed). Verified field-by-field against the deployed
openapi.jsonvs the PR #1799 spec.WebhookEvents(the active enum used byCreateWebhookEndpointInput/WebhookEndpoint) gainsCUSTOMER_NEW = 'customer.new',CUSTOMER_UPDATE = 'customer.update',CUSTOMER_DELETE = 'customer.delete', purely additive.RECEIVER_NEW/RECEIVER_UPDATEare kept and marked@deprecated(same idiom already used for$receiversinBlindPay.php).ListPayinsInputandListPayoutsInputgain an additivecustomerIdfilter (mapped tocustomer_id) alongside the existingreceiverId/receiver_id.Customers.php(not future work, broken today in shipped v2.4.0):Owner::fromArrayandLimitIncreaseRequest::fromArraywere reading$data['customer_id']for nested response fields the deployed API still keysreceiver_id(no dual-emit at that nesting level). Since both are non-nullable string constructor params, this threw aTypeErrorfor any business customer with owners, and for every call togetLimitIncreaseRequests(). Both now readreceiver_idagain, matching what the deployed API actually returns.src/Types/WebhookEvent.php: a dead, unused duplicate of the events enum (confirmed zero references) that also failedphp -lfrom a duplicatedRECEIVER_DELETEcase.Customers/CustomersWrapperresource inCLAUDE.md(it existed since an earlier commit but was never mentioned), notedReceiversas deprecated, and fixed a few doc examples that still referencedreceivers/receiverIdpaths that no longer match the shipped code (bank-accounts nesting and blockchain wallet list already takecustomerId).VERSIONinBlindPay.phpfrom2.4.0to2.5.0(minor, additive only).Why the webhook additions are safe today
The deployed
WebhookEndpointIn.eventsenum inopenapi.jsonalready listscustomer.new/customer.update/customer.deletealongside thereceiver.*values, and the API dual-emits both event families. Subscribing to the new values works against production right now with no server-side changes needed.What is deliberately NOT in this PR
The remaining wave-2 renames are held back because the deployed API does not accept them until blindpay-v2 PR #1799 ships:
customer_local_amount,customer_wallet_address,customer_network,customer_token,customer_invite_redirect_url,customer_rfi_emails_enabled,customers_amount,customer_type,customer_kyc_status,customer_aiprise_session_id,customer_aiprise_user_profile_id) - six of these aren't modeled in this SDK at all today, nothing to rename yet.RECEIVERS_*->CUSTOMERS_*error codes - this SDK has no error-code enum (errors are a generic passthrough string), so N/A.Receiversresource.receiver.*from the webhook event enums.Shipping any of that today would break every SDK user, since the deployed API doesn't have the corresponding server-side support yet.
Explicitly preserved (verified untouched)
receiver_amount(singular) onPayin,CreateEvmPayinResponse,Payout,Transfer, and both quote response types, plusCurrencyType::RECEIVER = 'receiver', are all unchanged - these mean "amount the receiving side gets" /currency_typevalue, not a reference to the customer resource, and are not part of this migration.Build output
https://claude.ai/code/session_01F1stiNzuNtJXoXtiW9ZCbs