orchard-api-client-anm 0.1.8 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/orchard/api/base.rb +10 -4
- data/lib/orchard/api/customer_debit_activation.rb +12 -0
- data/lib/orchard/api/customer_debit_deactivation.rb +12 -0
- data/lib/orchard/api/customer_debit_information.rb +12 -0
- data/lib/orchard/api_client.rb +12 -0
- data/lib/orchard/constants.rb +3 -0
- data/lib/orchard/version.rb +1 -1
- data/lib/orchard.rb +3 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b863d46441447a38bd375939be58694361aa9d2693accd46257300cd437a077d
|
4
|
+
data.tar.gz: c0325ea8724cffd613ab59ad8701aee496b9b457c41e5f6962929e6e3faf52b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fdff9fd96e0c69cf541be12685d189a92186dc6f613aefe454e13c9d5ad137ada45efd0a8ee1e383fa3f7614c349438157670e1a62715287572089b1a577b6e
|
7
|
+
data.tar.gz: 5d821dde0aabdbbbeb0b6bb712bc1a5b7c367cde320cc1c4c943173a8aff4d1bedc4e3546d6ee29928e6d8d66c1b7db11d4049348ac84956e7417513d8977000
|
data/lib/orchard/api/base.rb
CHANGED
@@ -21,14 +21,18 @@ module Orchard
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def make_request(method)
|
24
|
-
response = @connection.send(method) do |request|
|
24
|
+
@response = @connection.send(method) do |request|
|
25
25
|
request.url @endpoint
|
26
26
|
request.options.timeout = @timeout
|
27
|
-
request.body = @payload.to_json
|
28
27
|
request["Authorization"] = "#{@client_token}:#{compute_signature}"
|
28
|
+
if method.eql?(:get)
|
29
|
+
request.params = @payload
|
30
|
+
else
|
31
|
+
request.body = @payload.to_json
|
32
|
+
end
|
29
33
|
end
|
30
34
|
|
31
|
-
JSON.parse(response.body)
|
35
|
+
JSON.parse(@response.body)
|
32
36
|
rescue StandardError => e
|
33
37
|
error_response(e)
|
34
38
|
end
|
@@ -36,7 +40,9 @@ module Orchard
|
|
36
40
|
def error_response(error)
|
37
41
|
{
|
38
42
|
"res_code" => "999",
|
39
|
-
"res_desc" =>
|
43
|
+
"res_desc" => @response&.reason_phrase,
|
44
|
+
"error_message" => error.message,
|
45
|
+
"error_class" => error.class
|
40
46
|
}
|
41
47
|
end
|
42
48
|
end
|
data/lib/orchard/api_client.rb
CHANGED
@@ -29,6 +29,18 @@ module Orchard
|
|
29
29
|
Orchard::API::CheckWalletBalance.call(payload_with_client_data(payload), request_configurations)
|
30
30
|
end
|
31
31
|
|
32
|
+
def customer_debit_information(payload, request_configurations = {})
|
33
|
+
Orchard::API::CustomerDebitInformation.call(payload_with_client_data(payload), request_configurations)
|
34
|
+
end
|
35
|
+
|
36
|
+
def customer_debit_activation(payload, request_configurations = {})
|
37
|
+
Orchard::API::CustomerDebitActivation.call(payload_with_client_data(payload), request_configurations)
|
38
|
+
end
|
39
|
+
|
40
|
+
def customer_debit_deactivation(payload, request_configurations = {})
|
41
|
+
Orchard::API::CustomerDebitDeactivation.call(payload_with_client_data(payload), request_configurations)
|
42
|
+
end
|
43
|
+
|
32
44
|
private
|
33
45
|
|
34
46
|
def create_connection
|
data/lib/orchard/constants.rb
CHANGED
@@ -8,6 +8,9 @@ module Orchard
|
|
8
8
|
SERVICE_LOOKUP_REQUEST_ENDPOINT = "/get_service_lookup_req"
|
9
9
|
CHECK_TRANSACTION_STATUS_ENDPOINT = "/checkTransaction"
|
10
10
|
CHECK_WALLET_BALANCE = "/check_wallet_balance"
|
11
|
+
CUSTOMER_DEBIT_INFORMATION_ENDPOINT = "/get_cust_recur_debit_info"
|
12
|
+
CUSTOMER_DEBIT_ACTIVATION_ENDPOINT = "/cust_recur_debit_activation"
|
13
|
+
CUSTOMER_DEBIT_DEACTIVATION_ENDPOINT = "/cancel_cust_auto_debit_subscrip"
|
11
14
|
end
|
12
15
|
end
|
13
16
|
end
|
data/lib/orchard/version.rb
CHANGED
data/lib/orchard.rb
CHANGED
@@ -10,5 +10,8 @@ require_relative "orchard/api/send_sms"
|
|
10
10
|
require_relative "orchard/api/service_lookup_request"
|
11
11
|
require_relative "orchard/api/check_transaction_status"
|
12
12
|
require_relative "orchard/api/check_wallet_balance"
|
13
|
+
require_relative "orchard/api/customer_debit_information"
|
14
|
+
require_relative "orchard/api/customer_debit_activation"
|
15
|
+
require_relative "orchard/api/customer_debit_deactivation"
|
13
16
|
|
14
17
|
require_relative "orchard/api_client"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orchard-api-client-anm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sydney Dapilah
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -86,6 +86,9 @@ files:
|
|
86
86
|
- lib/orchard/api/base.rb
|
87
87
|
- lib/orchard/api/check_transaction_status.rb
|
88
88
|
- lib/orchard/api/check_wallet_balance.rb
|
89
|
+
- lib/orchard/api/customer_debit_activation.rb
|
90
|
+
- lib/orchard/api/customer_debit_deactivation.rb
|
91
|
+
- lib/orchard/api/customer_debit_information.rb
|
89
92
|
- lib/orchard/api/send_payment_request.rb
|
90
93
|
- lib/orchard/api/send_sms.rb
|
91
94
|
- lib/orchard/api/service_lookup_request.rb
|