Skip to content

feat(sdk): sync createPayment ABI, export fee types, add merchant/refund/dispute methods#427

Merged
Pvsaint merged 1 commit into
MetroLogic:mainfrom
miss-yusrah:feat/export
Jun 27, 2026
Merged

feat(sdk): sync createPayment ABI, export fee types, add merchant/refund/dispute methods#427
Pvsaint merged 1 commit into
MetroLogic:mainfrom
miss-yusrah:feat/export

Conversation

@miss-yusrah

Copy link
Copy Markdown
Contributor

PR description

Summary

Brings the TypeScript SDK in line with the current FluxaPay contract ABI and adds the missing high-level client methods for merchant management, refunds, and disputes.

Changes

Task 1 — Fix createPayment signature

  • Added CreatePaymentArgs, FeeConfig, and MaybeFeeConfig to contract bindings in sdk/src/contracts/fluxapay/src/index.ts
  • Updated FluxapayClient.createPayment() to accept optional durationSecs, memo, memoType, tokenAddress, and clientToken
  • expiresAt is now optional (matches contract Option<u64>)
  • Contract calls pass a full CreatePaymentArgs object via toCreatePaymentArgs()
  • Exported CreatePaymentArgs, FeeConfig, and MaybeFeeConfig from the SDK index

Task 2 — Export fee types and registerMerchant

  • FeeConfig and MaybeFeeConfig are exported from @fluxapay/sdk
  • FluxapayClient.registerMerchant() accepts an optional feeConfig: FeeConfig
  • README includes register-with-fee and register-without-fee examples

Task 3 — Merchant management methods

  • Added merchantRegistryContractId to FluxapayConfig for a dedicated MerchantRegistry contract
  • FluxapayClient methods:
    • registerMerchant(params) — matches MerchantRegistry.register_merchant
    • updateMerchant(params) — business name, currency, active, payout, bank, fee config
    • getMerchant(merchantId)
    • verifyMerchant(admin, merchantId)
  • Methods delegate to MerchantRegistryClient when merchantRegistryContractId is set; otherwise use the main contract
  • MerchantRegistryClient updated with typed RegisterMerchantParams / UpdateMerchantParams and full fee config support

Task 4 — Refund and dispute methods

Added to FluxapayClient:

Method | Contract call -- | -- processRefund(operator, refundId) | process_refund getRefund(refundId) | get_refund getPaymentRefunds(paymentId) | get_payment_refunds createDispute(...) | create_dispute reviewDispute(operator, disputeId) | review_dispute resolveDisputeWithRefund(operator, disputeId, notes) | resolve_dispute_with_refund rejectDispute(operator, disputeId, notes) | reject_dispute getDispute(disputeId) | get_dispute getPaymentDisputes(paymentId) | get_payment_disputes

closes #382
closes #383
closes #385
closes #386

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@miss-yusrah Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Pvsaint Pvsaint merged commit 7edc902 into MetroLogic:main Jun 27, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants