Skip to content

add all simulate APIs - #8

Merged
adrian-y1 merged 2 commits into
mainfrom
feature/simulation-apis
Sep 9, 2026
Merged

add all simulate APIs#8
adrian-y1 merged 2 commits into
mainfrom
feature/simulation-apis

Conversation

@adrian-y1

@adrian-y1 adrian-y1 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds full coverage of Airwallex's sandbox Simulation API — the endpoints that stand in for a bank, card network, issuing bank, or shopper so async/manual lifecycles (deposits clearing, disputes escalating, KYC review outcomes, etc.) can be driven and tested without waiting on real-world events. Bumps the gem to 0.9.0.

What's new

New resources (sandbox Simulation only, no live create/retrieve/list yet):

  • Deposit.create/.retrieve/.list for real Direct Debit deposits, plus .simulate_create, .simulate_settle, .simulate_reject, .simulate_reverse
  • IssuingTransaction.simulate_create (with single_phase), .simulate_capture, .simulate_reverse, .simulate_refund, .simulate_notify_three_ds
  • Cardholder.simulate_pass_review
  • LinkedAccount.simulate_accept_mandate, .simulate_reject_mandate, .simulate_cancel_mandate, .simulate_fail_microdeposits
  • AccountOffboarding.simulate_complete, .simulate_cancel (nested under a parent ConnectedAccount)
  • RFI.simulate_create, .simulate_close, .simulate_follow_up (+ instance equivalents)
  • POSTerminal.simulate_turn_on, .simulate_turn_off, .simulate_generate_activation_code, .simulate_confirm_payment_intent, .simulate_payment_scenarios

Extended existing resources:

  • Transfer.simulate_transition/#simulate_transition
  • Dispute.simulate_create, .simulate_escalate/#simulate_escalate, .simulate_resolve/#simulate_resolve
  • ConnectedAccount.simulate_update_status/#simulate_update_status, #simulate_complete_offboarding, #simulate_cancel_offboarding
  • AccountAmendment.simulate_approve/#simulate_approve, .simulate_reject/#simulate_reject
  • PaymentIntent#simulate_shopper_pay, #simulate_shopper_reject
  • PaymentConsent#simulate_shopper_verify

Fixed

  • RFI question answer.type corrected to the real uppercase enum ("TEXT", not "text") — confirmed against the live sandbox

Verified against the live sandbox

  • Deposit.simulate_create, Transfer.simulate_transition, Dispute.simulate_create, RFI.simulate_create/#simulate_close, IssuingTransaction.simulate_create/.simulate_refund all confirmed working end-to-end
  • IssuingTransaction.simulate_capture/.simulate_reverse and AccountAmendment.simulate_approve reach the correct endpoint (accepted, not 404) but couldn't be fully exercised on this sandbox account — both require Admin-level API key permissions this key doesn't have
  • Identified (not fixed here) a pre-existing bug in Client's Faraday retry config: retry_options[:exceptions] doesn't include Faraday::RetriableResponse, so a POST that gets a retry_statuses code (429/500/502/503/504) raises uncaught instead of surfacing as a normal Airwallex::Error

Docs

  • README's "Sandbox Simulations" section expanded to include a runnable example for every one of the 36 simulate_* methods added/touched in this PR, grouped into 10 subsections by resource
  • CHANGELOG updated with the [0.9.0] entry

Test plan

  • bundle exec rspec — 440 examples, 0 failures
  • Live smoke test against sandbox (local_tests/smoke_test.rb) — read-only endpoints pass end-to-end
  • Live simulation smoke test against sandbox (local_tests/simulation_smoke_test.rb) — exercises the new Simulation endpoints against real sandbox fixtures

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@adrian-y1
adrian-y1 merged commit d5e6124 into main Sep 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants