You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The collections client can be created with the following paramaters. Note that the `COLLECTION_USER_ID` and `COLLECTION_API_SECRET` for production are provided on the MTN OVA dashboard.
config.collection_user_id = 'Your Collection User ID'
49
57
config.collection_api_secret = 'Your Collection API Key'
50
-
end
51
58
```
52
59
60
+
*`collection_primary_key`: Primary Key for the `Collection` product on the developer portal.
61
+
*`collection_user_id`: For sandbox, use the one generated with the `momoapi-ruby` command.
62
+
*`collection_api_secret`: For sandbox, use the one generated with the `momoapi-ruby` command.
63
+
64
+
You can create a collection client with the following:
65
+
66
+
```ruby
67
+
require'momoapi-ruby'
68
+
69
+
collection =Momoapi::Collection.new
70
+
```
71
+
72
+
### Methods
73
+
1.`request_to_pay`: This operation is used to request a payment from a consumer (Payer). The payer will be asked to authorize the payment. The transaction is executed once the payer has authorized the payment. The transaction will be in status PENDING until it is authorized or declined by the payer or it is timed out by the system. Status of the transaction can be validated by using `get_transaction_status`.
74
+
75
+
2.`get_transaction_status`: Retrieve transaction information using the `transaction_id` returned by `request_to_pay`. You can invoke it at intervals until the transaction fails or succeeds. If the transaction has failed, it will throw an appropriate error.
An extra argument, `callback_url`, can be passed to this method, denoting the URL to the server where the callback should be sent.
89
+
90
+
## Disbursements
91
+
The disbursements client can be created with the following paramaters. The `DISBURSEMENT_USER_ID` and `DISBURSEMENT_API_SECRET` for production are provided on the MTN OVA dashboard.
config.disbursement_user_id = 'Your Disbursement User ID'
97
+
config.disbursement_api_secret = 'Your Disbursement API Key'
98
+
```
99
+
100
+
*`disbursement_primary_key`: Primary Key for the `Disbursement` product on the developer portal.
101
+
*`disbursement_user_id`: For sandbox, use the one generated with the `momoapi-ruby` command.
102
+
*`disbursement_api_secret`: For sandbox, use the one generated with the `momoapi-ruby` command.
103
+
104
+
You can create a disbursement client with the following:
105
+
106
+
```ruby
107
+
require'momoapi-ruby'
108
+
109
+
disbursement =Momoapi::Disbursement.new
110
+
```
111
+
112
+
### Methods
113
+
1.`transfer`: Used to transfer an amount from the owner’s account to a payee account. Status of the transaction can be validated by using the `get_transaction_status` method.
114
+
115
+
2.`get_transaction_status`: Retrieve transaction information using the `transaction_id` returned by `transfer`. You can invoke it at intervals until the transaction fails or succeeds. If the transaction has failed, it will throw an appropriate error.
An extra argument, `callback_url`, can be passed to this method, denoting the URL to the server where the callback should be sent.
129
+
130
+
## Remittances
131
+
The remittances client can be created with the following paramaters. The `REMITTANCES_USER_ID` and `REMITTANCES_API_SECRET` for production are provided on the MTN OVA dashboard.
config.remittance_user_id = 'Your Remittance User ID'
137
+
config.remittance_api_secret = 'Your Remittance API Key'
138
+
```
139
+
140
+
*`remittance_primary_key`: Primary Key for the `Remittance` product on the developer portal.
141
+
*`remittance_user_id`: For sandbox, use the one generated with the `momoapi-ruby` command.
142
+
*`remittance_api_secret`: For sandbox, use the one generated with the `momoapi-ruby` command.
143
+
144
+
You can create a remittance client with the following:
145
+
146
+
```ruby
147
+
require'momoapi-ruby'
148
+
149
+
remittance =Momoapi::Remittance.new
150
+
```
151
+
152
+
### Methods
153
+
1.`transfer`: Used to transfer an amount from the owner’s account to a payee account. Status of the transaction can be validated by using the `get_transaction_status` method.
154
+
155
+
2.`get_transaction_status`: Retrieve transaction information using the `transaction_id` returned by `transfer`. You can invoke it at intervals until the transaction fails or succeeds. If the transaction has failed, it will throw an appropriate error.
An extra argument, `callback_url`, can be passed to this method, denoting the URL to the server where the callback should be sent.
169
+
170
+
53
171
## Contributing
54
172
55
173
Bug reports and pull requests are welcome on GitHub at https://github.com/sparkplug/momoapi-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
0 commit comments