bitpesa-sdk 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +1 -0
- data/Gemfile.lock +5 -4
- data/README.md +19 -7
- data/docs/Sender.md +1 -0
- data/docs/SenderResponse.md +1 -0
- data/docs/SenderResponseExisting.md +8 -0
- data/docs/SenderResponseMeta.md +8 -0
- data/docs/SendersApi.md +2 -0
- data/docs/Transaction.md +1 -0
- data/docs/TransactionResponse.md +1 -0
- data/docs/TransactionResponseExisting.md +9 -0
- data/docs/TransactionResponseMeta.md +8 -0
- data/docs/TransactionsApi.md +2 -0
- data/example/client.rb +47 -9
- data/lib/bitpesa-sdk.rb +4 -0
- data/lib/bitpesa-sdk/api/senders_api.rb +3 -0
- data/lib/bitpesa-sdk/api/transactions_api.rb +3 -0
- data/lib/bitpesa-sdk/api_client.rb +1 -1
- data/lib/bitpesa-sdk/models/sender.rb +12 -2
- data/lib/bitpesa-sdk/models/sender_response.rb +13 -4
- data/lib/bitpesa-sdk/models/sender_response_existing.rb +195 -0
- data/lib/bitpesa-sdk/models/sender_response_meta.rb +195 -0
- data/lib/bitpesa-sdk/models/transaction.rb +11 -1
- data/lib/bitpesa-sdk/models/transaction_response.rb +13 -4
- data/lib/bitpesa-sdk/models/transaction_response_existing.rb +204 -0
- data/lib/bitpesa-sdk/models/transaction_response_meta.rb +195 -0
- data/lib/bitpesa-sdk/version.rb +1 -1
- data/spec/api/account_debits_api_spec.rb +17 -15
- data/spec/api/account_validation_api_spec.rb +10 -10
- data/spec/api/accounts_api_spec.rb +13 -13
- data/spec/api/api_logs_api_spec.rb +15 -11
- data/spec/api/currency_info_api_spec.rb +13 -13
- data/spec/api/documents_api_spec.rb +16 -14
- data/spec/api/logs_api_spec.rb +15 -11
- data/spec/api/payment_methods_api_spec.rb +11 -11
- data/spec/api/payout_methods_api_spec.rb +55 -11
- data/spec/api/recipients_api_spec.rb +23 -18
- data/spec/api/senders_api_spec.rb +26 -21
- data/spec/api/transactions_api_spec.rb +48 -22
- data/spec/api/webhooks_api_spec.rb +20 -20
- data/spec/api_client_spec.rb +52 -90
- data/spec/configuration_spec.rb +13 -13
- data/spec/models/account_meta_spec.rb +5 -6
- data/spec/models/api_log_spec.rb +16 -17
- data/spec/models/currency_spec.rb +27 -16
- data/spec/models/debit_request_spec.rb +9 -34
- data/spec/models/debit_spec.rb +42 -13
- data/spec/models/document_request_spec.rb +9 -56
- data/spec/models/document_spec.rb +71 -8
- data/spec/models/pagination_spec.rb +33 -10
- data/spec/models/payin_method_details_mobile_spec.rb +6 -7
- data/spec/models/payin_method_details_ngn_bank_spec.rb +5 -6
- data/spec/models/payment_method_spec.rb +19 -14
- data/spec/models/payout_method_details_balance_spec.rb +5 -6
- data/spec/models/payout_method_details_ghs_bank_spec.rb +8 -9
- data/spec/models/payout_method_details_iban_spec.rb +9 -10
- data/spec/models/payout_method_details_mad_cash_spec.rb +15 -24
- data/spec/models/payout_method_details_mobile_spec.rb +7 -8
- data/spec/models/payout_method_details_ngn_bank_spec.rb +9 -14
- data/spec/models/payout_method_details_xof_mobile_spec.rb +8 -13
- data/spec/models/payout_method_request_spec.rb +6 -19
- data/spec/models/payout_method_response_spec.rb +6 -19
- data/spec/models/payout_method_spec.rb +18 -19
- data/spec/models/recipient_request_spec.rb +6 -25
- data/spec/models/recipient_response_spec.rb +6 -103
- data/spec/models/recipient_spec.rb +127 -8
- data/spec/models/sender_request_spec.rb +9 -104
- data/spec/models/sender_response_existing_spec.rb +41 -0
- data/spec/models/sender_response_meta_spec.rb +41 -0
- data/spec/models/sender_response_spec.rb +8 -103
- data/spec/models/sender_spec.rb +167 -8
- data/spec/models/transaction_request_spec.rb +9 -16
- data/spec/models/transaction_response_existing_spec.rb +47 -0
- data/spec/models/transaction_response_meta_spec.rb +41 -0
- data/spec/models/transaction_response_spec.rb +8 -75
- data/spec/models/transaction_spec.rb +84 -13
- data/spec/models/transaction_traits_spec.rb +6 -7
- data/spec/models/webhook_definition_request_spec.rb +6 -19
- data/spec/models/webhook_log_metadata_request_spec.rb +10 -11
- data/spec/models/webhook_log_metadata_response_spec.rb +10 -11
- data/spec/models/webhook_log_metadata_spec.rb +17 -18
- data/spec/models/webhook_log_spec.rb +13 -14
- data/spec/models/webhook_spec.rb +7 -8
- data/spec/spec_helper.rb +4 -4
- metadata +19 -309
- data/example/.LICENSE.un~ +0 -0
- data/example/.client.rb.un~ +0 -0
- data/spec/api/transaction_requests_api_spec.rb +0 -76
- data/spec/models/account_base_spec.rb +0 -48
- data/spec/models/api_log_base_spec.rb +0 -90
- data/spec/models/body_spec.rb +0 -58
- data/spec/models/currency_base_spec.rb +0 -84
- data/spec/models/debit_base_spec.rb +0 -66
- data/spec/models/debit_error_response_spec.rb +0 -72
- data/spec/models/debit_valid_response_spec.rb +0 -72
- data/spec/models/default_document_spec.rb +0 -94
- data/spec/models/default_recipient_spec.rb +0 -60
- data/spec/models/default_sender_spec.rb +0 -142
- data/spec/models/default_webhook_spec.rb +0 -60
- data/spec/models/document_base_spec.rb +0 -88
- data/spec/models/document_error_response_spec.rb +0 -94
- data/spec/models/document_valid_response_spec.rb +0 -94
- data/spec/models/full_invalid_transaction_request_spec.rb +0 -78
- data/spec/models/full_invalid_transaction_spec.rb +0 -66
- data/spec/models/full_valid_transaction_request_spec.rb +0 -66
- data/spec/models/full_valid_transaction_spec.rb +0 -60
- data/spec/models/inline_response_200_10_spec.rb +0 -42
- data/spec/models/inline_response_200_11_spec.rb +0 -48
- data/spec/models/inline_response_200_12_spec.rb +0 -42
- data/spec/models/inline_response_200_13_spec.rb +0 -48
- data/spec/models/inline_response_200_14_spec.rb +0 -42
- data/spec/models/inline_response_200_15_spec.rb +0 -48
- data/spec/models/inline_response_200_16_spec.rb +0 -48
- data/spec/models/inline_response_200_17_spec.rb +0 -48
- data/spec/models/inline_response_200_18_spec.rb +0 -42
- data/spec/models/inline_response_200_19_spec.rb +0 -48
- data/spec/models/inline_response_200_1_spec.rb +0 -48
- data/spec/models/inline_response_200_20_spec.rb +0 -42
- data/spec/models/inline_response_200_21_object_spec.rb +0 -42
- data/spec/models/inline_response_200_21_spec.rb +0 -42
- data/spec/models/inline_response_200_22_object_spec.rb +0 -42
- data/spec/models/inline_response_200_22_spec.rb +0 -42
- data/spec/models/inline_response_200_23_object_spec.rb +0 -42
- data/spec/models/inline_response_200_23_spec.rb +0 -48
- data/spec/models/inline_response_200_24_spec.rb +0 -42
- data/spec/models/inline_response_200_25_spec.rb +0 -42
- data/spec/models/inline_response_200_26_spec.rb +0 -42
- data/spec/models/inline_response_200_27_spec.rb +0 -48
- data/spec/models/inline_response_200_28_spec.rb +0 -42
- data/spec/models/inline_response_200_29_spec.rb +0 -48
- data/spec/models/inline_response_200_2_object_spec.rb +0 -42
- data/spec/models/inline_response_200_2_spec.rb +0 -42
- data/spec/models/inline_response_200_30_spec.rb +0 -42
- data/spec/models/inline_response_200_31_spec.rb +0 -48
- data/spec/models/inline_response_200_32_spec.rb +0 -42
- data/spec/models/inline_response_200_33_spec.rb +0 -48
- data/spec/models/inline_response_200_34_spec.rb +0 -42
- data/spec/models/inline_response_200_35_spec.rb +0 -48
- data/spec/models/inline_response_200_36_spec.rb +0 -48
- data/spec/models/inline_response_200_37_spec.rb +0 -48
- data/spec/models/inline_response_200_38_spec.rb +0 -42
- data/spec/models/inline_response_200_39_spec.rb +0 -48
- data/spec/models/inline_response_200_3_spec.rb +0 -48
- data/spec/models/inline_response_200_40_spec.rb +0 -42
- data/spec/models/inline_response_200_4_object_spec.rb +0 -42
- data/spec/models/inline_response_200_4_spec.rb +0 -42
- data/spec/models/inline_response_200_5_spec.rb +0 -42
- data/spec/models/inline_response_200_6_spec.rb +0 -42
- data/spec/models/inline_response_200_7_spec.rb +0 -48
- data/spec/models/inline_response_200_8_spec.rb +0 -42
- data/spec/models/inline_response_200_9_spec.rb +0 -48
- data/spec/models/inline_response_200_spec.rb +0 -48
- data/spec/models/inline_response_201_10_spec.rb +0 -42
- data/spec/models/inline_response_201_11_spec.rb +0 -42
- data/spec/models/inline_response_201_1_spec.rb +0 -42
- data/spec/models/inline_response_201_2_spec.rb +0 -42
- data/spec/models/inline_response_201_3_spec.rb +0 -42
- data/spec/models/inline_response_201_4_spec.rb +0 -42
- data/spec/models/inline_response_201_5_spec.rb +0 -42
- data/spec/models/inline_response_201_6_spec.rb +0 -42
- data/spec/models/inline_response_201_7_spec.rb +0 -42
- data/spec/models/inline_response_201_8_spec.rb +0 -42
- data/spec/models/inline_response_201_9_spec.rb +0 -42
- data/spec/models/inline_response_201_spec.rb +0 -42
- data/spec/models/inline_response_400_1_spec.rb +0 -48
- data/spec/models/inline_response_400_spec.rb +0 -48
- data/spec/models/inline_response_422_10_spec.rb +0 -42
- data/spec/models/inline_response_422_11_spec.rb +0 -42
- data/spec/models/inline_response_422_12_spec.rb +0 -42
- data/spec/models/inline_response_422_13_spec.rb +0 -42
- data/spec/models/inline_response_422_14_spec.rb +0 -42
- data/spec/models/inline_response_422_1_meta_spec.rb +0 -42
- data/spec/models/inline_response_422_1_object_spec.rb +0 -42
- data/spec/models/inline_response_422_1_spec.rb +0 -42
- data/spec/models/inline_response_422_2_spec.rb +0 -42
- data/spec/models/inline_response_422_3_spec.rb +0 -42
- data/spec/models/inline_response_422_4_spec.rb +0 -42
- data/spec/models/inline_response_422_5_spec.rb +0 -42
- data/spec/models/inline_response_422_6_spec.rb +0 -42
- data/spec/models/inline_response_422_7_meta_spec.rb +0 -42
- data/spec/models/inline_response_422_7_spec.rb +0 -42
- data/spec/models/inline_response_422_8_meta_spec.rb +0 -42
- data/spec/models/inline_response_422_8_object_spec.rb +0 -42
- data/spec/models/inline_response_422_8_spec.rb +0 -48
- data/spec/models/inline_response_422_9_spec.rb +0 -42
- data/spec/models/inline_response_422_meta_spec.rb +0 -42
- data/spec/models/inline_response_422_object_spec.rb +0 -42
- data/spec/models/inline_response_422_spec.rb +0 -48
- data/spec/models/invalid_debit_spec.rb +0 -78
- data/spec/models/invalid_document_spec.rb +0 -100
- data/spec/models/invalid_recipient_spec.rb +0 -66
- data/spec/models/invalid_sender_spec.rb +0 -148
- data/spec/models/invalid_webhook_spec.rb +0 -60
- data/spec/models/meta_2_pagination_spec.rb +0 -66
- data/spec/models/meta_2_spec.rb +0 -42
- data/spec/models/meta_pagination_spec.rb +0 -66
- data/spec/models/meta_spec.rb +0 -42
- data/spec/models/object_spec.rb +0 -48
- data/spec/models/opposite_payment_method_base_spec.rb +0 -72
- data/spec/models/opposite_payment_method_spec.rb +0 -72
- data/spec/models/pagination_pagination_spec.rb +0 -66
- data/spec/models/payin_method_base_spec.rb +0 -66
- data/spec/models/payin_method_details_base_spec.rb +0 -36
- data/spec/models/payin_method_type_base_spec.rb +0 -42
- data/spec/models/payin_method_type_spec.rb +0 -42
- data/spec/models/payment_method_base_spec.rb +0 -66
- data/spec/models/payout_method_base_spec.rb +0 -54
- data/spec/models/payout_method_details_base_spec.rb +0 -36
- data/spec/models/payout_method_error_response_spec.rb +0 -60
- data/spec/models/payout_method_valid_response_spec.rb +0 -60
- data/spec/models/recipient_base_spec.rb +0 -54
- data/spec/models/recipient_error_response_spec.rb +0 -60
- data/spec/models/recipient_valid_response_spec.rb +0 -60
- data/spec/models/sender_base_spec.rb +0 -136
- data/spec/models/sender_error_response_spec.rb +0 -142
- data/spec/models/sender_existing_request_spec.rb +0 -42
- data/spec/models/sender_full_request_spec.rb +0 -136
- data/spec/models/sender_valid_response_spec.rb +0 -142
- data/spec/models/transaction_base_spec.rb +0 -60
- data/spec/models/transaction_error_response_spec.rb +0 -66
- data/spec/models/transaction_request_base_spec.rb +0 -48
- data/spec/models/transaction_request_error_response_spec.rb +0 -54
- data/spec/models/transaction_request_request_spec.rb +0 -48
- data/spec/models/transaction_request_valid_response_spec.rb +0 -54
- data/spec/models/transaction_valid_response_spec.rb +0 -66
- data/spec/models/valid_debit_spec.rb +0 -90
- data/spec/models/webhook_base_spec.rb +0 -54
- data/spec/models/webhook_definition_base_spec.rb +0 -54
- data/spec/models/webhook_definition_error_response_spec.rb +0 -60
- data/spec/models/webhook_definition_valid_response_spec.rb +0 -60
- data/spec/models/webhook_error_response_spec.rb +0 -60
- data/spec/models/webhook_log_base_metadata_params_spec.rb +0 -42
- data/spec/models/webhook_log_base_metadata_request_spec.rb +0 -54
- data/spec/models/webhook_log_base_metadata_response_spec.rb +0 -54
- data/spec/models/webhook_log_base_metadata_spec.rb +0 -96
- data/spec/models/webhook_log_base_spec.rb +0 -72
- data/spec/models/webhook_log_metadata_params_spec.rb +0 -42
- data/spec/models/webhook_request_spec.rb +0 -54
- data/spec/models/webhook_valid_response_spec.rb +0 -60
@@ -1,25 +1,25 @@
|
|
1
1
|
=begin
|
2
2
|
#BitPesa API
|
3
3
|
|
4
|
-
#
|
4
|
+
#Reference documentation for the BitPesa API V1
|
5
5
|
|
6
6
|
OpenAPI spec version: 1.0
|
7
7
|
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-beta2
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'spec_helper'
|
14
14
|
require 'json'
|
15
15
|
|
16
|
-
# Unit tests for
|
17
|
-
# Automatically generated by
|
16
|
+
# Unit tests for Bitpesa::PaymentMethodsApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
18
|
# Please update as you see appropriate
|
19
19
|
describe 'PaymentMethodsApi' do
|
20
20
|
before do
|
21
21
|
# run before each test
|
22
|
-
@instance =
|
22
|
+
@instance = Bitpesa::PaymentMethodsApi.new
|
23
23
|
end
|
24
24
|
|
25
25
|
after do
|
@@ -28,7 +28,7 @@ describe 'PaymentMethodsApi' do
|
|
28
28
|
|
29
29
|
describe 'test an instance of PaymentMethodsApi' do
|
30
30
|
it 'should create an instance of PaymentMethodsApi' do
|
31
|
-
expect(@instance).to be_instance_of(
|
31
|
+
expect(@instance).to be_instance_of(Bitpesa::PaymentMethodsApi)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -36,9 +36,9 @@ describe 'PaymentMethodsApi' do
|
|
36
36
|
# This method returns possible payin methods.
|
37
37
|
# Fetching possible payin methods.
|
38
38
|
# @param [Hash] opts the optional parameters
|
39
|
-
# @return [
|
39
|
+
# @return [PaymentMethodListResponse]
|
40
40
|
describe 'payment_methods_in test' do
|
41
|
-
it
|
41
|
+
it 'should work' do
|
42
42
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
43
43
|
end
|
44
44
|
end
|
@@ -47,9 +47,9 @@ describe 'PaymentMethodsApi' do
|
|
47
47
|
# This method returns possible payout methods.
|
48
48
|
# Fetching possible payout methods.
|
49
49
|
# @param [Hash] opts the optional parameters
|
50
|
-
# @return [
|
50
|
+
# @return [PaymentMethodListResponse]
|
51
51
|
describe 'payment_methods_out test' do
|
52
|
-
it
|
52
|
+
it 'should work' do
|
53
53
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
54
54
|
end
|
55
55
|
end
|
@@ -1,25 +1,25 @@
|
|
1
1
|
=begin
|
2
2
|
#BitPesa API
|
3
3
|
|
4
|
-
#
|
4
|
+
#Reference documentation for the BitPesa API V1
|
5
5
|
|
6
6
|
OpenAPI spec version: 1.0
|
7
7
|
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-beta2
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'spec_helper'
|
14
14
|
require 'json'
|
15
15
|
|
16
|
-
# Unit tests for
|
17
|
-
# Automatically generated by
|
16
|
+
# Unit tests for Bitpesa::PayoutMethodsApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
18
|
# Please update as you see appropriate
|
19
19
|
describe 'PayoutMethodsApi' do
|
20
20
|
before do
|
21
21
|
# run before each test
|
22
|
-
@instance =
|
22
|
+
@instance = Bitpesa::PayoutMethodsApi.new
|
23
23
|
end
|
24
24
|
|
25
25
|
after do
|
@@ -28,7 +28,19 @@ describe 'PayoutMethodsApi' do
|
|
28
28
|
|
29
29
|
describe 'test an instance of PayoutMethodsApi' do
|
30
30
|
it 'should create an instance of PayoutMethodsApi' do
|
31
|
-
expect(@instance).to be_instance_of(
|
31
|
+
expect(@instance).to be_instance_of(Bitpesa::PayoutMethodsApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for delete_payout_method
|
36
|
+
# Deleting a payout method
|
37
|
+
# Deletes a single payout method by the Payout Method ID
|
38
|
+
# @param payout_method_id ID of the payout method to delete. Example: `/v1/payout_methods/bf9ff782-e182-45ac-abea-5bce83ad6670`
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @return [PayoutMethodResponse]
|
41
|
+
describe 'delete_payout_method test' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
32
44
|
end
|
33
45
|
end
|
34
46
|
|
@@ -37,9 +49,9 @@ describe 'PayoutMethodsApi' do
|
|
37
49
|
# Show a payout method by id
|
38
50
|
# @param payout_method_id ID of the payout method to get. Example: `/v1/payout_methods/bf9ff782-e182-45ac-abea-5bce83ad6670`
|
39
51
|
# @param [Hash] opts the optional parameters
|
40
|
-
# @return [
|
52
|
+
# @return [PayoutMethodResponse]
|
41
53
|
describe 'get_payout_method test' do
|
42
|
-
it
|
54
|
+
it 'should work' do
|
43
55
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
56
|
end
|
45
57
|
end
|
@@ -48,9 +60,41 @@ describe 'PayoutMethodsApi' do
|
|
48
60
|
# Listing payout methods
|
49
61
|
# List available payout methods
|
50
62
|
# @param [Hash] opts the optional parameters
|
51
|
-
# @
|
63
|
+
# @option opts [Array<String>] :state Allows filtering results by `state` of the payout method. Example: `/v1/payout_methods?state[]=enabled`
|
64
|
+
# @option opts [Array<String>] :type Allows filtering results by the specified type. Example: `/v1/payout_methods?type[]=NGN::Bank`
|
65
|
+
# @option opts [String] :sender_id Allows filtering results by the specified sender id. Example: `/v1/payout_methods?sender_id=bf9ff782-e182-45ac-abea-5bce83ad6670`
|
66
|
+
# @option opts [Integer] :page The page number to request (defaults to 1)
|
67
|
+
# @option opts [Integer] :per The number of results to load per page (defaults to 10)
|
68
|
+
# @option opts [String] :created_at_from Start date to filter recipients by created_at range Allows filtering results by the specified `created_at` timeframe. Example: `/v1/recipients?created_at_from=2018-06-06&created_at_to=2018-06-08`
|
69
|
+
# @option opts [String] :created_at_to End date to filter recipients by created_at range Allows filtering results by the specified `created_at` timeframe. Example: `/v1/recipients?created_at_from=2018-06-06&created_at_to=2018-06-08`
|
70
|
+
# @return [PayoutMethodListResponse]
|
52
71
|
describe 'get_payout_methods test' do
|
53
|
-
it
|
72
|
+
it 'should work' do
|
73
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# unit tests for patch_payout_method
|
78
|
+
# Updating a payout method
|
79
|
+
# Updates the payout method specified in the URL path.
|
80
|
+
# @param payout_method_id ID of the payout method to get. Example: `/v1/payout_methods/bf9ff782-e182-45ac-abea-5bce83ad6670`
|
81
|
+
# @param payout_method
|
82
|
+
# @param [Hash] opts the optional parameters
|
83
|
+
# @return [PayoutMethodResponse]
|
84
|
+
describe 'patch_payout_method test' do
|
85
|
+
it 'should work' do
|
86
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# unit tests for post_payout_methods
|
91
|
+
# Creating a payout method
|
92
|
+
# Creates a new payout method in our system.
|
93
|
+
# @param payout_method_request
|
94
|
+
# @param [Hash] opts the optional parameters
|
95
|
+
# @return [PayoutMethodResponse]
|
96
|
+
describe 'post_payout_methods test' do
|
97
|
+
it 'should work' do
|
54
98
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
55
99
|
end
|
56
100
|
end
|
@@ -1,25 +1,25 @@
|
|
1
1
|
=begin
|
2
2
|
#BitPesa API
|
3
3
|
|
4
|
-
#
|
4
|
+
#Reference documentation for the BitPesa API V1
|
5
5
|
|
6
6
|
OpenAPI spec version: 1.0
|
7
7
|
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-beta2
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'spec_helper'
|
14
14
|
require 'json'
|
15
15
|
|
16
|
-
# Unit tests for
|
17
|
-
# Automatically generated by
|
16
|
+
# Unit tests for Bitpesa::RecipientsApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
18
|
# Please update as you see appropriate
|
19
19
|
describe 'RecipientsApi' do
|
20
20
|
before do
|
21
21
|
# run before each test
|
22
|
-
@instance =
|
22
|
+
@instance = Bitpesa::RecipientsApi.new
|
23
23
|
end
|
24
24
|
|
25
25
|
after do
|
@@ -28,18 +28,18 @@ describe 'RecipientsApi' do
|
|
28
28
|
|
29
29
|
describe 'test an instance of RecipientsApi' do
|
30
30
|
it 'should create an instance of RecipientsApi' do
|
31
|
-
expect(@instance).to be_instance_of(
|
31
|
+
expect(@instance).to be_instance_of(Bitpesa::RecipientsApi)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
35
|
# unit tests for delete_recipient
|
36
36
|
# Cancelling a recipient
|
37
|
-
# Cancels the recipient specified in the URL path.
|
37
|
+
# Cancels the payment to the recipient specified in the URL path. Please note only recipients where the `may_cancel` attribute is true can be cancelled.
|
38
38
|
# @param recipient_id ID of recipient to cancel. Example: `/v1/recipients/9d4d7b73-a94c-4979-ab57-09074fd55d33`
|
39
39
|
# @param [Hash] opts the optional parameters
|
40
|
-
# @return [
|
40
|
+
# @return [RecipientResponse]
|
41
41
|
describe 'delete_recipient test' do
|
42
|
-
it
|
42
|
+
it 'should work' do
|
43
43
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
44
|
end
|
45
45
|
end
|
@@ -48,25 +48,30 @@ describe 'RecipientsApi' do
|
|
48
48
|
# Getting a list of recipients with filtering
|
49
49
|
# Fetches details of all recipients.
|
50
50
|
# @param [Hash] opts the optional parameters
|
51
|
+
# @option opts [Integer] :page The page number to request (defaults to 1)
|
52
|
+
# @option opts [Integer] :per The number of results to load per page (defaults to 10)
|
53
|
+
# @option opts [String] :created_at_from Start date to filter recipients by created_at range Allows filtering results by the specified `created_at` timeframe. Example: `/v1/recipients?created_at_from=2018-06-06&created_at_to=2018-06-08`
|
54
|
+
# @option opts [String] :created_at_to End date to filter recipients by created_at range Allows filtering results by the specified `created_at` timeframe. Example: `/v1/recipients?created_at_from=2018-06-06&created_at_to=2018-06-08`
|
55
|
+
# @option opts [String] :amount_from Minimum amount to filter recipients by amount range. Allows filtering results by the specified `amount` range. When using this filter, the `currency` should also be specified. Example: `/v1/recipients?currency=NGN&amount_from=83.76672339&amount_to=83.76672339`
|
56
|
+
# @option opts [String] :amount_to Max amount to filter recipients by amount range. Allows filtering results by the specified `amount` range. When using this filter, the `currency` should also be specified. Example: `/v1/recipients?currency=NGN&amount_from=83.76672339&amount_to=83.76672339`
|
51
57
|
# @option opts [Array<String>] :state Allows filtering results by `state` of recipient. See [API Documentation - Recipient state](https://github.com/bitpesa/api-documentation/blob/master/transaction-flow.md#state-1) for possible states. Example: `/v1/recipients?state[]=error&state[]=initial`
|
52
|
-
# @option opts [Array<String>] :currency Allows filtering results by `input_currency`. Example: `/v1/recipients?currency[]=KES&currency[]=NGN`
|
53
|
-
# @
|
54
|
-
# @option opts [String] :amount Allows filtering results by the specified `amount` range. When using this filter, the `currency` should also be specified. Example: `/v1/recipients?currency=BTC&amount_from=83.76672339&amount_to=83.76672339`
|
55
|
-
# @return [InlineResponse20013]
|
58
|
+
# @option opts [Array<String>] :currency Allows filtering results by `input_currency`. Additionally required when filtering by an amount range Example: `/v1/recipients?currency[]=KES&currency[]=NGN`
|
59
|
+
# @return [RecipientListResponse]
|
56
60
|
describe 'get_recipients test' do
|
57
|
-
it
|
61
|
+
it 'should work' do
|
58
62
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
59
63
|
end
|
60
64
|
end
|
61
65
|
|
62
66
|
# unit tests for patch_recipient
|
63
67
|
# Updating a recipient
|
64
|
-
# Updates the recipient specified in the URL path.
|
68
|
+
# Updates the recipient specified in the URL path. Please note that only recipients where the `editable` field is true can be modified. Once the recipient is modified any subsequent payout tries will be sent to the updated details.
|
65
69
|
# @param recipient_id ID of recipient to update. Example: `/v1/recipients/9d4d7b73-a94c-4979-ab57-09074fd55d33`
|
70
|
+
# @param recipient_request
|
66
71
|
# @param [Hash] opts the optional parameters
|
67
|
-
# @return [
|
72
|
+
# @return [RecipientResponse]
|
68
73
|
describe 'patch_recipient test' do
|
69
|
-
it
|
74
|
+
it 'should work' do
|
70
75
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
71
76
|
end
|
72
77
|
end
|
@@ -1,25 +1,25 @@
|
|
1
1
|
=begin
|
2
2
|
#BitPesa API
|
3
3
|
|
4
|
-
#
|
4
|
+
#Reference documentation for the BitPesa API V1
|
5
5
|
|
6
6
|
OpenAPI spec version: 1.0
|
7
7
|
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-beta2
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'spec_helper'
|
14
14
|
require 'json'
|
15
15
|
|
16
|
-
# Unit tests for
|
17
|
-
# Automatically generated by
|
16
|
+
# Unit tests for Bitpesa::SendersApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
18
|
# Please update as you see appropriate
|
19
19
|
describe 'SendersApi' do
|
20
20
|
before do
|
21
21
|
# run before each test
|
22
|
-
@instance =
|
22
|
+
@instance = Bitpesa::SendersApi.new
|
23
23
|
end
|
24
24
|
|
25
25
|
after do
|
@@ -28,18 +28,18 @@ describe 'SendersApi' do
|
|
28
28
|
|
29
29
|
describe 'test an instance of SendersApi' do
|
30
30
|
it 'should create an instance of SendersApi' do
|
31
|
-
expect(@instance).to be_instance_of(
|
31
|
+
expect(@instance).to be_instance_of(Bitpesa::SendersApi)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
35
|
# unit tests for delete_sender
|
36
36
|
# Deleting a sender
|
37
37
|
# Deletes a single sender by the Sender ID
|
38
|
-
# @param sender_id ID of the sender to
|
38
|
+
# @param sender_id ID of the sender to delete. Example: `/v1/senders/bf9ff782-e182-45ac-abea-5bce83ad6670`
|
39
39
|
# @param [Hash] opts the optional parameters
|
40
|
-
# @return [
|
40
|
+
# @return [SenderResponse]
|
41
41
|
describe 'delete_sender test' do
|
42
|
-
it
|
42
|
+
it 'should work' do
|
43
43
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
44
|
end
|
45
45
|
end
|
@@ -49,9 +49,9 @@ describe 'SendersApi' do
|
|
49
49
|
# Returns a single sender by the Sender ID
|
50
50
|
# @param sender_id ID of the sender to get. Example: `/v1/senders/bf9ff782-e182-45ac-abea-5bce83ad6670`
|
51
51
|
# @param [Hash] opts the optional parameters
|
52
|
-
# @return [
|
52
|
+
# @return [SenderResponse]
|
53
53
|
describe 'get_sender test' do
|
54
|
-
it
|
54
|
+
it 'should work' do
|
55
55
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
56
56
|
end
|
57
57
|
end
|
@@ -60,9 +60,14 @@ describe 'SendersApi' do
|
|
60
60
|
# Listing senders
|
61
61
|
# Get a list of available senders
|
62
62
|
# @param [Hash] opts the optional parameters
|
63
|
-
# @
|
63
|
+
# @option opts [Integer] :page The page number to request (defaults to 1)
|
64
|
+
# @option opts [Integer] :per The number of results to load per page (defaults to 10)
|
65
|
+
# @option opts [String] :created_at_from Start date to filter recipients by created_at range Allows filtering results by the specified `created_at` timeframe. Example: `/v1/recipients?created_at_from=2018-06-06&created_at_to=2018-06-08`
|
66
|
+
# @option opts [String] :created_at_to End date to filter recipients by created_at range Allows filtering results by the specified `created_at` timeframe. Example: `/v1/recipients?created_at_from=2018-06-06&created_at_to=2018-06-08`
|
67
|
+
# @option opts [String] :external_id Allows filtering results by `external_id`. Example: `/v1/senders?external_id=26ec8517-2f0d-48c0-b74f-0bccb9ab3a87`
|
68
|
+
# @return [SenderListResponse]
|
64
69
|
describe 'get_senders test' do
|
65
|
-
it
|
70
|
+
it 'should work' do
|
66
71
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
67
72
|
end
|
68
73
|
end
|
@@ -71,23 +76,23 @@ describe 'SendersApi' do
|
|
71
76
|
# Updating a sender
|
72
77
|
# Updates the sender specified in the URL path.
|
73
78
|
# @param sender_id ID of the sender to get. Example: `/v1/senders/bf9ff782-e182-45ac-abea-5bce83ad6670`
|
74
|
-
# @param
|
79
|
+
# @param sender_request
|
75
80
|
# @param [Hash] opts the optional parameters
|
76
|
-
# @return [
|
81
|
+
# @return [SenderResponse]
|
77
82
|
describe 'patch_sender test' do
|
78
|
-
it
|
83
|
+
it 'should work' do
|
79
84
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
80
85
|
end
|
81
86
|
end
|
82
87
|
|
83
88
|
# unit tests for post_senders
|
84
89
|
# Creating a sender
|
85
|
-
# Creates a new sender
|
86
|
-
# @param
|
90
|
+
# Creates a new sender in our system.
|
91
|
+
# @param sender_request
|
87
92
|
# @param [Hash] opts the optional parameters
|
88
|
-
# @return [
|
93
|
+
# @return [SenderResponse]
|
89
94
|
describe 'post_senders test' do
|
90
|
-
it
|
95
|
+
it 'should work' do
|
91
96
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
92
97
|
end
|
93
98
|
end
|
@@ -1,25 +1,25 @@
|
|
1
1
|
=begin
|
2
2
|
#BitPesa API
|
3
3
|
|
4
|
-
#
|
4
|
+
#Reference documentation for the BitPesa API V1
|
5
5
|
|
6
6
|
OpenAPI spec version: 1.0
|
7
7
|
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-beta2
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'spec_helper'
|
14
14
|
require 'json'
|
15
15
|
|
16
|
-
# Unit tests for
|
17
|
-
# Automatically generated by
|
16
|
+
# Unit tests for Bitpesa::TransactionsApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
18
|
# Please update as you see appropriate
|
19
19
|
describe 'TransactionsApi' do
|
20
20
|
before do
|
21
21
|
# run before each test
|
22
|
-
@instance =
|
22
|
+
@instance = Bitpesa::TransactionsApi.new
|
23
23
|
end
|
24
24
|
|
25
25
|
after do
|
@@ -28,18 +28,44 @@ describe 'TransactionsApi' do
|
|
28
28
|
|
29
29
|
describe 'test an instance of TransactionsApi' do
|
30
30
|
it 'should create an instance of TransactionsApi' do
|
31
|
-
expect(@instance).to be_instance_of(
|
31
|
+
expect(@instance).to be_instance_of(Bitpesa::TransactionsApi)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
35
|
# unit tests for calculate_transactions
|
36
36
|
# Calculates transaction amounts for a transaction payload
|
37
37
|
# Calculates the input, output and fee amounts for the recipients in a transaction payload
|
38
|
-
# @param
|
38
|
+
# @param transaction_request
|
39
39
|
# @param [Hash] opts the optional parameters
|
40
|
-
# @return [
|
40
|
+
# @return [TransactionResponse]
|
41
41
|
describe 'calculate_transactions test' do
|
42
|
-
it
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# unit tests for get_transaction
|
48
|
+
# Fetch a single transaction
|
49
|
+
# Finds and returns a Transaction created by the requesting API key, using the provided Transaction ID.
|
50
|
+
# @param transaction_id ID of the transaction. Example: `/v1/transactions/bf9ff782-e182-45ac-abea-5bce83ad6670`
|
51
|
+
# @param [Hash] opts the optional parameters
|
52
|
+
# @return [TransactionResponse]
|
53
|
+
describe 'get_transaction test' do
|
54
|
+
it 'should work' do
|
55
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# unit tests for get_transactions
|
60
|
+
# Get a list of transactions
|
61
|
+
# Retrieves a paginated list of the Transactions created by your API key.
|
62
|
+
# @param [Hash] opts the optional parameters
|
63
|
+
# @option opts [Integer] :page The page number to request (defaults to 1)
|
64
|
+
# @option opts [Integer] :per The number of results to load per page (defaults to 10)
|
65
|
+
# @option opts [String] :external_id Allows filtering results by `external_id`. Example: `/v1/senders?external_id=26ec8517-2f0d-48c0-b74f-0bccb9ab3a87`
|
66
|
+
# @return [TransactionListResponse]
|
67
|
+
describe 'get_transactions test' do
|
68
|
+
it 'should work' do
|
43
69
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
70
|
end
|
45
71
|
end
|
@@ -48,11 +74,11 @@ describe 'TransactionsApi' do
|
|
48
74
|
# Creates a fake payin for transaction
|
49
75
|
# This method is available only in sandbox environment and is supposed to be used only for testing integration. It allows you to emulate a payin without paying actual money.
|
50
76
|
# @param transaction_id ID of the transaction to payin. Example: `/v1/transactions/bf9ff782-e182-45ac-abea-5bce83ad6670/payin`
|
51
|
-
# @param
|
77
|
+
# @param payin_method_request
|
52
78
|
# @param [Hash] opts the optional parameters
|
53
|
-
# @return [
|
79
|
+
# @return [TransactionResponse]
|
54
80
|
describe 'payin_transaction test' do
|
55
|
-
it
|
81
|
+
it 'should work' do
|
56
82
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
57
83
|
end
|
58
84
|
end
|
@@ -62,21 +88,21 @@ describe 'TransactionsApi' do
|
|
62
88
|
# This method is available only in sandbox environment and is supposed to be used only for testing. It allows you to emulate the payout of a transaction after payin.
|
63
89
|
# @param transaction_id ID of the transaction to payout. Example: `/v1/transactions/bf9ff782-e182-45ac-abea-5bce83ad6670/payout`
|
64
90
|
# @param [Hash] opts the optional parameters
|
65
|
-
# @return [
|
91
|
+
# @return [TransactionResponse]
|
66
92
|
describe 'payout_transaction test' do
|
67
|
-
it
|
93
|
+
it 'should work' do
|
68
94
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
69
95
|
end
|
70
96
|
end
|
71
97
|
|
72
98
|
# unit tests for post_transactions
|
73
99
|
# Creates a new transaction
|
74
|
-
# Transactions are the main objects in the BitPesa API, so it's important to understand how to create and manage them. Transactions facilitate money movement from one Sender in a specific currency to one or multiple Recipients in another currency. The main flow of a successful transaction flow is the following - - Transaction is created linking the Sender to the Recipient(s) with the requested amounts. - Once the sender is KYC'd and approved the transaction can be funded. - Once the transaction is funded, we will initiate the payout to the recipient(s). - After the recipient (or all recipients) has received the money, the transaction is finished.
|
75
|
-
# @param
|
100
|
+
# Transactions are the main objects in the BitPesa API, so it's important to understand how to create and manage them. Transactions facilitate money movement from one Sender in a specific currency to one or multiple Recipients in another currency. The main flow of a successful transaction flow is the following - - Transaction is created linking the Sender to the Recipient(s) with the requested amounts. - Once the sender is KYC'd and approved the transaction can be funded. - Once the transaction is funded, we will initiate the payout to the recipient(s). - After the recipient (or all recipients) has received the money, the transaction is finished.
|
101
|
+
# @param transaction_request
|
76
102
|
# @param [Hash] opts the optional parameters
|
77
|
-
# @return [
|
103
|
+
# @return [TransactionResponse]
|
78
104
|
describe 'post_transactions test' do
|
79
|
-
it
|
105
|
+
it 'should work' do
|
80
106
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
81
107
|
end
|
82
108
|
end
|
@@ -84,11 +110,11 @@ describe 'TransactionsApi' do
|
|
84
110
|
# unit tests for validate_transactions
|
85
111
|
# Validates a transaction payload
|
86
112
|
# Validates fields in a transaction payload and displays invalid or missing fields
|
87
|
-
# @param
|
113
|
+
# @param transaction_request
|
88
114
|
# @param [Hash] opts the optional parameters
|
89
|
-
# @return [
|
115
|
+
# @return [TransactionResponse]
|
90
116
|
describe 'validate_transactions test' do
|
91
|
-
it
|
117
|
+
it 'should work' do
|
92
118
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
93
119
|
end
|
94
120
|
end
|