Skip to content

feat(payments): expand SDK to cover Crowdsplit staging endpoints#114

Merged
fahmidareem3 merged 19 commits intomainfrom
develop
Apr 29, 2026
Merged

feat(payments): expand SDK to cover Crowdsplit staging endpoints#114
fahmidareem3 merged 19 commits intomainfrom
develop

Conversation

@fahmidareem3
Copy link
Copy Markdown
Contributor

Summary

This PR brings the @oaknetwork/payments-sdk in full alignment with the Crowdsplit staging API by closing the service and type gaps identified during the audit.

New Services

  • DisputeService – list disputes, update evidence, submit, and close
  • PayoutService – create outbound payments
  • SubscriptionService – subscribe, cancel, list, get, and pay subscriptions
  • FileService – upload, list, get, and delete files
  • TaxService – calculate taxes

Extended Existing Services

  • CustomerService – added uploadFiles, getFiles, populatePlatform; fixed balance endpoint from /balance/balances
  • PaymentService – added capture, sandboxPaid, sandboxSettle
  • PaymentMethodService – added update method; tightened type fields to use MethodType union; added PlaidResponseData, TradingWallet, and TradingWalletResponseData
  • TransferService – added sendWebhook

Type Improvements

  • Payment – added PagarMePixRequest, broadened capture_method to include "manual", widened type response field, updated FraudCheckConfig.action_on_fail values
  • Transaction – expanded Status, SubStatus, and TransactionType enums; added Installment model; renamed dateFrom/dateTodate_from/date_to; added provider and strict filter fields
  • Webhook – added full EventType and Category enums; added ListNotificationsQuery interface
  • Transfer – tightened payment_method.type to "customer_wallet" | "bank" and chain to "polygon" | "celo"
  • Buy – added Brla request variant; added celo chain option; added provider_data to Bridge
  • Customer – added Status enum; added additional_info, synced, synced_at fields; fixed BalanceResponse.amountavailable
  • Plan – added overridden_price, campaign_id, campaign_name, active, expired fields/filters
  • Provider – added brla, facilita_pay, inter_bank, wallet_service, crowd_split, konduto, cel_coin, cel_baas; added PlatformStatus and KycLevel types
  • Sell – added bank payment method variant
  • New type namespaces: Dispute, File, Payout, Subscription, Tax

Infrastructure

  • httpClient – added postMultipart for file uploads; updated mergeHeaders to omit Content-Type for multipart requests; extended get to support a request body (used by subscription list)
  • webhookVerification – updated signature verification to parse the t=<timestamp>,v1=<sig> header format used by Crowdsplit

Tests

  • Added integration test suites: disputeService, payoutService, subscriptionService, missingServices, paymentServiceCapture
  • Fixed unit test expectation for /balance/balances endpoint

Notes

  • No breaking changes to existing public APIs
  • All new services follow the established withAuth + buildUrl pattern
  • Changeset bumps @oaknetwork/payments-sdk as a minor release

@fahmidareem3 fahmidareem3 requested review from 0xrafasec, andrefelizardo, lucasvinhas and rayedsikder and removed request for 0xrafasec April 29, 2026 14:53
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0d051818a0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/payments/src/utils/httpClient.ts
@fahmidareem3 fahmidareem3 merged commit 908d9fa into main Apr 29, 2026
12 checks passed
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.

3 participants