feat: Implement Transaction, Transfer, Banking, and Direct Charge APIs#5
Open
YabetsZ wants to merge 10 commits into
Open
feat: Implement Transaction, Transfer, Banking, and Direct Charge APIs#5YabetsZ wants to merge 10 commits into
YabetsZ wants to merge 10 commits into
Conversation
- implemented transaction logs retrieval - added methods for bank transfer and bulk transfer - updated response models to include new transfer data
- Added integration tests inside `tests/` directory and moved some of the tests inside `client.rs` to it since they weren't unit tests anyways. - Removed transaction model and related structures - Added comprehensive tests for transaction and transfer functionalities including initialization, verification, and bulk transfers.
- Added integration tests inside `tests/` directory and moved some of the tests inside `client.rs` to it since they weren't unit tests anyways. - Removed transaction model and related structures - Added comprehensive tests for transaction and transfer functionalities including initialization, verification, and bulk transfers.
- implement get_balances and get_balances_by_currency methods - add swap_currencies method for currency conversion - introduce BalanceData and SwapOptions models - update response types for balances and swaps - add integration tests for new functionalities
- Implement direct charge initiation and verification methods - Add models for direct charge options and responses - Enhance error handling for JSON serialization issues
- add optional encryption key support in configuration - though not implemented fully, made a way for the implementation of 3DES - create encryption utility module - update dependencies for encryption functionality
- added examples for bulk transfer, getting balances, getting transactions and logs, getting transfers, swapping currencies, and transferring with verification - edited and added documentation
- include utility function to generate transaction references - add options struct for customization of generated references - update Cargo.toml and Cargo.lock to include rand dependency - modify documentation generation command in makefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Request
Short description
Here are the list of things changed:
Checklist
Testing
make checkmake checkwill execute the extensive suite of newly added test cases covering all endpoints.@isrugeek
Note
Implements new Banking, Transactions, Transfers, and Direct Charge APIs with models, tests, examples, plus utils (tx_ref), feature flags, and docs/config updates.
banks,balances,balances/{currency},swap;transaction/initialize,transaction/verify/{tx_ref},transactions,transaction/events/{tx_ref};transfers(initiate),transfers/verify/{reference},bulk-transfers,transfers?batch_id=...,transfers(list);charges?type=...,validate?type=....bank::{BalanceData, SwapOptions, SwapData},payment::{VerifyPaymentData, TransactionLog, GetTransactionsData, Transaction, Pagination},direct_charge::{DirectChargeType, DirectChargeOptions, VerifyDirectChargeOption, DirectChargeData},transfer::{TransferOptions, VerifyTransferData, BulkTransferOptions, BulkData, BulkTransferData, TransfersData, TransferMeta}.ChapaResponse,ChapaResponseWithMeta; addDirectChargeVerifyResponse.models/transaction.rs(consolidated intopayment.rs).ChapaConfiggains optionalencryptionsupport (feature-gated), builder env defaults; fields made crate-visible; addMissingEncryptionKey; addJsonError.utilsmodule withgenerate_tx_ref(featureutils).chapa_encrypt::encrypt_databehindencryptionfeature (unimplemented).mockito.chapa_rust; add optional deps (des,base64,rand) and feature flags;.env.exampleaddsENCRYPTION_KEY;makefiledocs with--all-features; README updated.Written by Cursor Bugbot for commit 047e845. This will update automatically on new commits. Configure here.