Skip to content

Conversation

@eddyjaga
Copy link
Collaborator

@eddyjaga eddyjaga commented Nov 4, 2025

Short Description / Link to Ticket

This pull request introduces comprehensive support for batch transactions in the Zai Payment Ruby gem, specifically for the prelive environment. It adds a new resource for managing batch transactions, including methods for exporting, updating states, and triggering webhooks, alongside thorough documentation and test coverage. The implementation also corrects the API response format for state updates and updates all related documentation and specs accordingly.

Batch Transactions Feature Implementation

  • Added new resource class lib/zai_payment/resources/batch_transaction.rb with methods to export transactions, update transaction states between bank_processing (12700) and successful (12000), and convenience methods for these transitions. All methods enforce prelive-only usage, validate parameters, and provide clear error messages.
  • Added accessor method batch_transactions to the main module in lib/zai_payment.rb for easy resource access, along with required file inclusion. [1] [2]

API Response Format Correction

  • Updated all documentation and specs to reflect the correct asynchronous API response format for PATCH /batches/:id/transaction_states, now returning aggregated_jobs_uuid, msg, and errors fields.

Documentation and Testing

  • Added and updated documentation files: docs/batch_transactions.md (technical reference), examples/batch_transactions.md (workflow and usage examples), and readme.md (feature highlights and quick start). All documentation now includes accurate method references, error handling, and API response details. [1] [2]
  • Added comprehensive RSpec tests in spec/zai_payment/resources/batch_transaction_spec.rb covering happy paths, error cases, and integration with the main module.

Response Handling Update

  • Modified lib/zai_payment/response.rb to support the new "batches" response key for batch transaction API calls.

@eddyjaga eddyjaga marked this pull request as ready for review November 4, 2025 22:33
@eddyjaga eddyjaga merged commit e57e094 into main Nov 4, 2025
2 checks passed
@eddyjaga eddyjaga deleted the feature/prelive-batch-transactions branch November 4, 2025 22:34
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