xendit-client 0.5.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/Gemfile.lock +2 -2
- 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/qr_code.rb +37 -0
- data/lib/xendit/resources/refund.rb +6 -6
- data/lib/xendit/resources.rb +1 -0
- data/lib/xendit/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 948f8999fb1121cb15efbefb86c6900ebe60c60c9fcb01e9dd561a94fdc61b86
|
4
|
+
data.tar.gz: 9db6f7e535e809de0ba44ded59d3eeac7960229c3363871c06ba2ca928b14a40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd281deb34430a1277da6e53e9cd36d4cec66bab09aec7383a11c16529431f500dccca05a4341c0f5f367516fcecc7a15cd34b71c9493bb6a6768b3b2375fd57
|
7
|
+
data.tar.gz: 41fe371c756cee0cea32e72f38cc0adc8d8a84f3f5fe89f402af8cb3bce4dbe016df25f6e52189f27f9df38fe21bae5a680ac8144480c5ff271c0a024fa41fb5
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.6
|
data/Gemfile.lock
CHANGED
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
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require_relative '../api_client'
|
2
|
+
|
3
|
+
module Xendit
|
4
|
+
class QRCode
|
5
|
+
PATH = "qr_codes".freeze
|
6
|
+
|
7
|
+
class << self
|
8
|
+
def create(**opts)
|
9
|
+
ApiClient.post PATH, opts
|
10
|
+
end
|
11
|
+
|
12
|
+
def get(qr_code_id, **opts)
|
13
|
+
ApiClient.get "#{PATH}/#{qr_code_id}", opts
|
14
|
+
end
|
15
|
+
|
16
|
+
def list_payments(qr_code_id, **opts)
|
17
|
+
ApiClient.get "#{PATH}/#{qr_code_id}/payments", opts
|
18
|
+
end
|
19
|
+
|
20
|
+
def refund(qrpy_id, **opts)
|
21
|
+
ApiClient.post "#{PATH}/payments/#{qrpy_id}/refunds", opts
|
22
|
+
end
|
23
|
+
|
24
|
+
def get_refund(qrpy_id, refund_id, **opts)
|
25
|
+
ApiClient.get "#{PATH}/payments/#{qrpy_id}/refunds/#{refund_id}", opts
|
26
|
+
end
|
27
|
+
|
28
|
+
def list_refunds(qrpy_id, **opts)
|
29
|
+
ApiClient.get "#{PATH}/payments/#{qrpy_id}/refunds", opts
|
30
|
+
end
|
31
|
+
|
32
|
+
def simulate_payment(qr_code_id, **opts)
|
33
|
+
ApiClient.post "#{PATH}/#{qr_code_id}/payments/simulate", opts
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
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/resources.rb
CHANGED
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:
|
4
|
+
version: 1.1.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:
|
11
|
+
date: 2025-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -45,6 +45,7 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
+
- ".ruby-version"
|
48
49
|
- CHANGELOG.md
|
49
50
|
- Gemfile
|
50
51
|
- Gemfile.lock
|
@@ -59,6 +60,7 @@ files:
|
|
59
60
|
- lib/xendit/resources/e_wallet.rb
|
60
61
|
- lib/xendit/resources/invoice.rb
|
61
62
|
- lib/xendit/resources/payout.rb
|
63
|
+
- lib/xendit/resources/qr_code.rb
|
62
64
|
- lib/xendit/resources/refund.rb
|
63
65
|
- lib/xendit/response.rb
|
64
66
|
- lib/xendit/version.rb
|