xendit-client 0.5.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xendit/api_client.rb +4 -4
- data/lib/xendit/resources/e_wallet.rb +12 -12
- data/lib/xendit/resources/invoice.rb +10 -10
- data/lib/xendit/resources/payout.rb +10 -10
- data/lib/xendit/resources/refund.rb +6 -6
- data/lib/xendit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85d38404db7e7fd54741410bcb7462c1ff25fd3f63a1f7a446e6bab7829936b4
|
4
|
+
data.tar.gz: cbedfe113514988cc5b9eb6d2f3b0bfda351219577af6f26d503d3de6e2224bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bf4ce9102dcbfaefb62ca0a1af3bcf8cc203c6e4f6a88207cc501f7b3b9c279c3ab8661b2ce5bfa8010b65724f52fd2eb3228f587aee297f27aa9f0a7241d32
|
7
|
+
data.tar.gz: e4ec99cd7eeb999d48669f9c8fd6c49b314434143ed94a2836a97f91276eea74371cae22aa12b71114378b996117c310d8f6e9b0ff75c6163a4f206dd181a927
|
data/lib/xendit/api_client.rb
CHANGED
@@ -6,14 +6,14 @@ require_relative 'errors'
|
|
6
6
|
module Xendit
|
7
7
|
class ApiClient
|
8
8
|
class << self
|
9
|
-
def get(url, params
|
10
|
-
conn = create_connection()
|
9
|
+
def get(url, headers: {}, params: nil)
|
10
|
+
conn = create_connection(headers)
|
11
11
|
response = conn.get(url, params)
|
12
12
|
handle_response(response)
|
13
13
|
end
|
14
14
|
|
15
|
-
def post(url, body
|
16
|
-
conn = create_connection()
|
15
|
+
def post(url, headers: {}, body: {})
|
16
|
+
conn = create_connection(headers)
|
17
17
|
response = conn.post(url, JSONSerializer.encode(body))
|
18
18
|
handle_response(response)
|
19
19
|
end
|
@@ -5,28 +5,28 @@ module Xendit
|
|
5
5
|
PATH = "ewallets/charges".freeze
|
6
6
|
|
7
7
|
class << self
|
8
|
-
def get_charge_status(charge_id)
|
9
|
-
ApiClient.get "#{PATH}/#{charge_id}"
|
8
|
+
def get_charge_status(charge_id, **opts)
|
9
|
+
ApiClient.get "#{PATH}/#{charge_id}", opts
|
10
10
|
end
|
11
11
|
|
12
|
-
def charge(
|
13
|
-
ApiClient.post PATH,
|
12
|
+
def charge(**opts)
|
13
|
+
ApiClient.post PATH, opts
|
14
14
|
end
|
15
15
|
|
16
|
-
def void_charge(charge_id)
|
17
|
-
ApiClient.post "#{PATH}/#{charge_id}/void"
|
16
|
+
def void_charge(charge_id, **opts)
|
17
|
+
ApiClient.post "#{PATH}/#{charge_id}/void", opts
|
18
18
|
end
|
19
19
|
|
20
|
-
def refund(charge_id,
|
21
|
-
ApiClient.post "#{PATH}/#{charge_id}/refunds",
|
20
|
+
def refund(charge_id, **opts)
|
21
|
+
ApiClient.post "#{PATH}/#{charge_id}/refunds", opts
|
22
22
|
end
|
23
23
|
|
24
|
-
def get_refund(charge_id, refund_id)
|
25
|
-
ApiClient.get "#{PATH}/#{charge_id}/refunds/#{refund_id}"
|
24
|
+
def get_refund(charge_id, refund_id, **opts)
|
25
|
+
ApiClient.get "#{PATH}/#{charge_id}/refunds/#{refund_id}", opts
|
26
26
|
end
|
27
27
|
|
28
|
-
def list_refunds
|
29
|
-
ApiClient.get "#{PATH}/#{charge_id}/refunds"
|
28
|
+
def list_refunds(**opts)
|
29
|
+
ApiClient.get "#{PATH}/#{charge_id}/refunds", opts
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -1,23 +1,23 @@
|
|
1
1
|
require_relative '../api_client'
|
2
2
|
|
3
3
|
module Xendit
|
4
|
-
class Invoice
|
4
|
+
class Invoice
|
5
5
|
class << self
|
6
|
-
def get(invoice_id)
|
7
|
-
ApiClient.get "v2/invoices/#{invoice_id}"
|
6
|
+
def get(invoice_id, **opts)
|
7
|
+
ApiClient.get "v2/invoices/#{invoice_id}", opts
|
8
8
|
end
|
9
9
|
|
10
|
-
def create(
|
11
|
-
ApiClient.post "v2/invoices/",
|
10
|
+
def create(**opts)
|
11
|
+
ApiClient.post "v2/invoices/", opts
|
12
12
|
end
|
13
13
|
|
14
|
-
def expire(invoice_id)
|
15
|
-
ApiClient.post "invoices/#{invoice_id}/expire!"
|
14
|
+
def expire(invoice_id, **opts)
|
15
|
+
ApiClient.post "invoices/#{invoice_id}/expire!", opts
|
16
16
|
end
|
17
17
|
|
18
|
-
def get_all
|
19
|
-
ApiClient.get "v2/invoices"
|
18
|
+
def get_all(**opts)
|
19
|
+
ApiClient.get "v2/invoices", opts
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
23
|
-
end
|
23
|
+
end
|
@@ -3,24 +3,24 @@ require_relative '../api_client'
|
|
3
3
|
module Xendit
|
4
4
|
class Payout
|
5
5
|
class << self
|
6
|
-
def channels(**
|
7
|
-
ApiClient.get "payouts_channels",
|
6
|
+
def channels(**opts)
|
7
|
+
ApiClient.get "payouts_channels", opts
|
8
8
|
end
|
9
9
|
|
10
|
-
def create(
|
11
|
-
ApiClient.post "v2/payouts",
|
10
|
+
def create(**opts)
|
11
|
+
ApiClient.post "v2/payouts", opts
|
12
12
|
end
|
13
13
|
|
14
|
-
def cancel(id)
|
15
|
-
ApiClient.post "v2/payouts/#{id}/cancel"
|
14
|
+
def cancel(id, **opts)
|
15
|
+
ApiClient.post "v2/payouts/#{id}/cancel", opts
|
16
16
|
end
|
17
17
|
|
18
|
-
def get_by_id(id)
|
19
|
-
ApiClient.get "v2/payouts/#{id}"
|
18
|
+
def get_by_id(id, **opts)
|
19
|
+
ApiClient.get "v2/payouts/#{id}", opts
|
20
20
|
end
|
21
21
|
|
22
|
-
def get_by_reference_id(reference_id)
|
23
|
-
ApiClient.get "v2/payouts", {reference_id: reference_id}
|
22
|
+
def get_by_reference_id(reference_id, **opts)
|
23
|
+
ApiClient.get "v2/payouts", {reference_id: reference_id}, opts
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -3,16 +3,16 @@ require_relative '../api_client'
|
|
3
3
|
module Xendit
|
4
4
|
class Refund
|
5
5
|
class << self
|
6
|
-
def create(
|
7
|
-
ApiClient.post "refunds",
|
6
|
+
def create(**opts)
|
7
|
+
ApiClient.post "refunds", opts
|
8
8
|
end
|
9
9
|
|
10
|
-
def list
|
11
|
-
ApiClient.get "refunds"
|
10
|
+
def list(**opts)
|
11
|
+
ApiClient.get "refunds", opts
|
12
12
|
end
|
13
13
|
|
14
|
-
def get_by_id(id)
|
15
|
-
ApiClient.get "refunds/#{id}"
|
14
|
+
def get_by_id(id, **opts)
|
15
|
+
ApiClient.get "refunds/#{id}", opts
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
data/lib/xendit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xendit-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nasrul Gunawan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|