batch transactions #27
Merged
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.
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
lib/zai_payment/resources/batch_transaction.rbwith methods to export transactions, update transaction states betweenbank_processing(12700) andsuccessful(12000), and convenience methods for these transitions. All methods enforce prelive-only usage, validate parameters, and provide clear error messages.batch_transactionsto the main module inlib/zai_payment.rbfor easy resource access, along with required file inclusion. [1] [2]API Response Format Correction
PATCH /batches/:id/transaction_states, now returningaggregated_jobs_uuid,msg, anderrorsfields.Documentation and Testing
docs/batch_transactions.md(technical reference),examples/batch_transactions.md(workflow and usage examples), andreadme.md(feature highlights and quick start). All documentation now includes accurate method references, error handling, and API response details. [1] [2]spec/zai_payment/resources/batch_transaction_spec.rbcovering happy paths, error cases, and integration with the main module.Response Handling Update
lib/zai_payment/response.rbto support the new "batches" response key for batch transaction API calls.