paystack-ruby 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/.standard.yml +3 -0
  3. data/CHANGELOG.md +5 -0
  4. data/CODE_OF_CONDUCT.md +132 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.md +153 -0
  7. data/Rakefile +8 -0
  8. data/docs/apple_pay.md +60 -0
  9. data/docs/balance.md +39 -0
  10. data/docs/bank.md +77 -0
  11. data/docs/bulk_charge.md +110 -0
  12. data/docs/charge.md +124 -0
  13. data/docs/customer.md +253 -0
  14. data/docs/dedicated_virtual_account.md +171 -0
  15. data/docs/direct_debit.md +44 -0
  16. data/docs/dispute.md +175 -0
  17. data/docs/integration.md +36 -0
  18. data/docs/miscellaneous.md +52 -0
  19. data/docs/order.md +101 -0
  20. data/docs/page.md +138 -0
  21. data/docs/payment_request.md +182 -0
  22. data/docs/plan.md +99 -0
  23. data/docs/product.md +114 -0
  24. data/docs/refund.md +87 -0
  25. data/docs/settlement.md +43 -0
  26. data/docs/split.md +140 -0
  27. data/docs/storefront.md +205 -0
  28. data/docs/subaccount.md +99 -0
  29. data/docs/subscription.md +132 -0
  30. data/docs/terminal.md +156 -0
  31. data/docs/transaction.md +206 -0
  32. data/docs/transfer.md +183 -0
  33. data/docs/transfer_recipient.md +124 -0
  34. data/docs/virtual_terminal.md +188 -0
  35. data/lib/paystack/base_resource.rb +13 -0
  36. data/lib/paystack/client.rb +146 -0
  37. data/lib/paystack/errors.rb +20 -0
  38. data/lib/paystack/resources/apple_pay.rb +31 -0
  39. data/lib/paystack/resources/balance.rb +24 -0
  40. data/lib/paystack/resources/bank.rb +31 -0
  41. data/lib/paystack/resources/bulk_charge.rb +52 -0
  42. data/lib/paystack/resources/charge.rb +59 -0
  43. data/lib/paystack/resources/customer.rb +94 -0
  44. data/lib/paystack/resources/dedicated_virtual_account.rb +73 -0
  45. data/lib/paystack/resources/direct_debit.rb +24 -0
  46. data/lib/paystack/resources/dispute.rb +66 -0
  47. data/lib/paystack/resources/integration.rb +24 -0
  48. data/lib/paystack/resources/miscellaneous.rb +31 -0
  49. data/lib/paystack/resources/order.rb +45 -0
  50. data/lib/paystack/resources/page.rb +52 -0
  51. data/lib/paystack/resources/payment_request.rb +73 -0
  52. data/lib/paystack/resources/plan.rb +38 -0
  53. data/lib/paystack/resources/product.rb +45 -0
  54. data/lib/paystack/resources/refund.rb +38 -0
  55. data/lib/paystack/resources/settlement.rb +24 -0
  56. data/lib/paystack/resources/split.rb +52 -0
  57. data/lib/paystack/resources/storefront.rb +87 -0
  58. data/lib/paystack/resources/subaccount.rb +38 -0
  59. data/lib/paystack/resources/subscription.rb +59 -0
  60. data/lib/paystack/resources/terminal.rb +66 -0
  61. data/lib/paystack/resources/transaction.rb +75 -0
  62. data/lib/paystack/resources/transfer.rb +87 -0
  63. data/lib/paystack/resources/transfer_recipient.rb +52 -0
  64. data/lib/paystack/resources/virtual_terminal.rb +73 -0
  65. data/lib/paystack/response.rb +40 -0
  66. data/lib/paystack/transport.rb +64 -0
  67. data/lib/paystack/version.rb +6 -0
  68. data/lib/paystack.rb +40 -0
  69. data/sig/paystack/ruby.rbs +6 -0
  70. metadata +110 -0
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+ # Generated by weaver ruby-sdk generator — do not edit manually
3
+
4
+ module Paystack
5
+ module Resources
6
+ class Bank < BaseResource
7
+
8
+ # List Banks
9
+ # GET /bank
10
+ def list(query = {})
11
+ @transport.get("/bank", query: query)
12
+ end
13
+
14
+
15
+ # Resolve Account Number
16
+ # GET /bank/resolve
17
+ def resolve_account_number(query = {})
18
+ @transport.get("/bank/resolve", query: query)
19
+ end
20
+
21
+
22
+ # Validate Bank Account
23
+ # POST /bank/validate
24
+ def validate_account_number(body = {})
25
+ @transport.post("/bank/validate", body: body)
26
+ end
27
+
28
+
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+ # Generated by weaver ruby-sdk generator — do not edit manually
3
+
4
+ module Paystack
5
+ module Resources
6
+ class BulkCharge < BaseResource
7
+
8
+ # List Charges in a Batch
9
+ # GET /bulkcharge/{code}/charges
10
+ def charges(code, query = {})
11
+ @transport.get("/bulkcharge/#{code}/charges", query: query)
12
+ end
13
+
14
+
15
+ # Fetch Bulk Charge Batch
16
+ # GET /bulkcharge/{code}
17
+ def fetch(code)
18
+ @transport.get("/bulkcharge/#{code}")
19
+ end
20
+
21
+
22
+ # Initiate Bulk Charge
23
+ # POST /bulkcharge
24
+ def initiate(body = {})
25
+ @transport.post("/bulkcharge", body: body)
26
+ end
27
+
28
+
29
+ # List Bulk Charge Batches
30
+ # GET /bulkcharge
31
+ def list(query = {})
32
+ @transport.get("/bulkcharge", query: query)
33
+ end
34
+
35
+
36
+ # Pause Bulk Charge Batch
37
+ # GET /bulkcharge/pause/{code}
38
+ def pause(code)
39
+ @transport.get("/bulkcharge/pause/#{code}")
40
+ end
41
+
42
+
43
+ # Resume Bulk Charge Batch
44
+ # GET /bulkcharge/resume/{code}
45
+ def resume(code)
46
+ @transport.get("/bulkcharge/resume/#{code}")
47
+ end
48
+
49
+
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+ # Generated by weaver ruby-sdk generator — do not edit manually
3
+
4
+ module Paystack
5
+ module Resources
6
+ class Charge < BaseResource
7
+
8
+ # Check pending charge
9
+ # GET /charge/{reference}
10
+ def check(reference)
11
+ @transport.get("/charge/#{reference}")
12
+ end
13
+
14
+
15
+ # Create Charge
16
+ # POST /charge
17
+ def create(body = {})
18
+ @transport.post("/charge", body: body)
19
+ end
20
+
21
+
22
+ # Submit Address
23
+ # POST /charge/submit_address
24
+ def submit_address(body = {})
25
+ @transport.post("/charge/submit_address", body: body)
26
+ end
27
+
28
+
29
+ # Submit Birthday
30
+ # POST /charge/submit_birthday
31
+ def submit_birthday(body = {})
32
+ @transport.post("/charge/submit_birthday", body: body)
33
+ end
34
+
35
+
36
+ # Submit OTP
37
+ # POST /charge/submit_otp
38
+ def submit_otp(body = {})
39
+ @transport.post("/charge/submit_otp", body: body)
40
+ end
41
+
42
+
43
+ # Submit Phone
44
+ # POST /charge/submit_phone
45
+ def submit_phone(body = {})
46
+ @transport.post("/charge/submit_phone", body: body)
47
+ end
48
+
49
+
50
+ # Submit PIN
51
+ # POST /charge/submit_pin
52
+ def submit_pin(body = {})
53
+ @transport.post("/charge/submit_pin", body: body)
54
+ end
55
+
56
+
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,94 @@
1
+ # frozen_string_literal: true
2
+ # Generated by weaver ruby-sdk generator — do not edit manually
3
+
4
+ module Paystack
5
+ module Resources
6
+ class Customer < BaseResource
7
+
8
+ # Create Customer
9
+ # POST /customer
10
+ def create(body = {})
11
+ @transport.post("/customer", body: body)
12
+ end
13
+
14
+
15
+ # Deactivate Authorization
16
+ # POST /customer/authorization/deactivate
17
+ def deactivate_authorization(body = {})
18
+ @transport.post("/customer/authorization/deactivate", body: body)
19
+ end
20
+
21
+
22
+ # Direct Debit Activation Charge
23
+ # PUT /customer/{id}/directdebit-activation-charge
24
+ def direct_debit_activation_charge(id, body = {})
25
+ @transport.put("/customer/#{id}/directdebit-activation-charge", body: body)
26
+ end
27
+
28
+
29
+ # Fetch Customer
30
+ # GET /customer/{code}
31
+ def fetch(code)
32
+ @transport.get("/customer/#{code}")
33
+ end
34
+
35
+
36
+ # Fetch Mandate Authorizations
37
+ # GET /customer/{id}/directdebit-mandate-authorizations
38
+ def fetch_mandate_authorizations(id)
39
+ @transport.get("/customer/#{id}/directdebit-mandate-authorizations")
40
+ end
41
+
42
+
43
+ # Initialize Authorization
44
+ # POST /customer/authorization/initialize
45
+ def initialize_authorization(body = {})
46
+ @transport.post("/customer/authorization/initialize", body: body)
47
+ end
48
+
49
+
50
+ # Initialize Direct Debit
51
+ # POST /customer/{id}/initialize-direct-debit
52
+ def initialize_direct_debit(id, body = {})
53
+ @transport.post("/customer/#{id}/initialize-direct-debit", body: body)
54
+ end
55
+
56
+
57
+ # List Customers
58
+ # GET /customer
59
+ def list(query = {})
60
+ @transport.get("/customer", query: query)
61
+ end
62
+
63
+
64
+ # Set Risk Action
65
+ # POST /customer/set_risk_action
66
+ def risk_action(body = {})
67
+ @transport.post("/customer/set_risk_action", body: body)
68
+ end
69
+
70
+
71
+ # Update Customer
72
+ # PUT /customer/{code}
73
+ def update(code, body = {})
74
+ @transport.put("/customer/#{code}", body: body)
75
+ end
76
+
77
+
78
+ # Validate Customer
79
+ # POST /customer/{code}/identification
80
+ def validate(code, body = {})
81
+ @transport.post("/customer/#{code}/identification", body: body)
82
+ end
83
+
84
+
85
+ # Verify Authorization
86
+ # GET /customer/authorization/verify/{reference}
87
+ def verify_authorization(reference)
88
+ @transport.get("/customer/authorization/verify/#{reference}")
89
+ end
90
+
91
+
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+ # Generated by weaver ruby-sdk generator — do not edit manually
3
+
4
+ module Paystack
5
+ module Resources
6
+ class DedicatedVirtualAccount < BaseResource
7
+
8
+ # Split Dedicated Account Transaction
9
+ # POST /dedicated_account/split
10
+ def dedicated_account_add_split(body = {})
11
+ @transport.post("/dedicated_account/split", body: body)
12
+ end
13
+
14
+
15
+ # Assign Dedicated Account
16
+ # POST /dedicated_account/assign
17
+ def dedicated_account_assign(body = {})
18
+ @transport.post("/dedicated_account/assign", body: body)
19
+ end
20
+
21
+
22
+ # Fetch Bank Providers
23
+ # GET /dedicated_account/available_providers
24
+ def dedicated_account_available_providers()
25
+ @transport.get("/dedicated_account/available_providers")
26
+ end
27
+
28
+
29
+ # Create Dedicated Account
30
+ # POST /dedicated_account
31
+ def dedicated_account_create(body = {})
32
+ @transport.post("/dedicated_account", body: body)
33
+ end
34
+
35
+
36
+ # Deactivate Dedicated Account
37
+ # DELETE /dedicated_account/{id}
38
+ def dedicated_account_deactivate(id)
39
+ @transport.delete("/dedicated_account/#{id}")
40
+ end
41
+
42
+
43
+ # Fetch Dedicated Account
44
+ # GET /dedicated_account/{id}
45
+ def dedicated_account_fetch(id)
46
+ @transport.get("/dedicated_account/#{id}")
47
+ end
48
+
49
+
50
+ # List Dedicated Accounts
51
+ # GET /dedicated_account
52
+ def dedicated_account_list(query = {})
53
+ @transport.get("/dedicated_account", query: query)
54
+ end
55
+
56
+
57
+ # Remove Split from Dedicated Account
58
+ # DELETE /dedicated_account/split
59
+ def dedicated_account_remove_split(body = {})
60
+ @transport.delete("/dedicated_account/split", body: body)
61
+ end
62
+
63
+
64
+ # Requery Dedicated Account
65
+ # GET /dedicated_account/requery
66
+ def dedicated_account_requery(query = {})
67
+ @transport.get("/dedicated_account/requery", query: query)
68
+ end
69
+
70
+
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+ # Generated by weaver ruby-sdk generator — do not edit manually
3
+
4
+ module Paystack
5
+ module Resources
6
+ class DirectDebit < BaseResource
7
+
8
+ # List Mandate Authorizations
9
+ # GET /directdebit/mandate-authorizations
10
+ def directdebit_list_mandate_authorizations(query = {})
11
+ @transport.get("/directdebit/mandate-authorizations", query: query)
12
+ end
13
+
14
+
15
+ # Trigger Activation Charge
16
+ # PUT /directdebit/activation-charge
17
+ def directdebit_trigger_activation_charge(body = {})
18
+ @transport.put("/directdebit/activation-charge", body: body)
19
+ end
20
+
21
+
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+ # Generated by weaver ruby-sdk generator — do not edit manually
3
+
4
+ module Paystack
5
+ module Resources
6
+ class Dispute < BaseResource
7
+
8
+ # Export Disputes
9
+ # GET /dispute/export
10
+ def download(query = {})
11
+ @transport.get("/dispute/export", query: query)
12
+ end
13
+
14
+
15
+ # Add Evidence
16
+ # POST /dispute/{id}/evidence
17
+ def evidence(id, body = {})
18
+ @transport.post("/dispute/#{id}/evidence", body: body)
19
+ end
20
+
21
+
22
+ # Fetch Dispute
23
+ # GET /dispute/{id}
24
+ def fetch(id)
25
+ @transport.get("/dispute/#{id}")
26
+ end
27
+
28
+
29
+ # List Disputes
30
+ # GET /dispute
31
+ def list(query = {})
32
+ @transport.get("/dispute", query: query)
33
+ end
34
+
35
+
36
+ # Resolve Dispute
37
+ # PUT /dispute/{id}/resolve
38
+ def resolve(id, body = {})
39
+ @transport.put("/dispute/#{id}/resolve", body: body)
40
+ end
41
+
42
+
43
+ # List Transaction Disputes
44
+ # GET /dispute/transaction/{id}
45
+ def transaction(id)
46
+ @transport.get("/dispute/transaction/#{id}")
47
+ end
48
+
49
+
50
+ # Update Dispute
51
+ # PUT /dispute/{id}
52
+ def update(id, body = {})
53
+ @transport.put("/dispute/#{id}", body: body)
54
+ end
55
+
56
+
57
+ # Fetch Upload URL
58
+ # GET /dispute/{id}/upload_url
59
+ def upload_url(id)
60
+ @transport.get("/dispute/#{id}/upload_url")
61
+ end
62
+
63
+
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+ # Generated by weaver ruby-sdk generator — do not edit manually
3
+
4
+ module Paystack
5
+ module Resources
6
+ class Integration < BaseResource
7
+
8
+ # Fetch Payment Session Timeout
9
+ # GET /integration/payment_session_timeout
10
+ def fetch_payment_session_timeout()
11
+ @transport.get("/integration/payment_session_timeout")
12
+ end
13
+
14
+
15
+ # Update Payment Session Timeout
16
+ # PUT /integration/payment_session_timeout
17
+ def update_payment_session_timeout(body = {})
18
+ @transport.put("/integration/payment_session_timeout", body: body)
19
+ end
20
+
21
+
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+ # Generated by weaver ruby-sdk generator — do not edit manually
3
+
4
+ module Paystack
5
+ module Resources
6
+ class Miscellaneous < BaseResource
7
+
8
+ # List States (AVS)
9
+ # GET /address_verification/states
10
+ def avs(query = {})
11
+ @transport.get("/address_verification/states", query: query)
12
+ end
13
+
14
+
15
+ # List Countries
16
+ # GET /country
17
+ def list_countries()
18
+ @transport.get("/country")
19
+ end
20
+
21
+
22
+ # Resolve Card BIN
23
+ # GET /decision/bin/{bin}
24
+ def resolve_card_bin(bin)
25
+ @transport.get("/decision/bin/#{bin}")
26
+ end
27
+
28
+
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+ # Generated by weaver ruby-sdk generator — do not edit manually
3
+
4
+ module Paystack
5
+ module Resources
6
+ class Order < BaseResource
7
+
8
+ # Create Order
9
+ # POST /order
10
+ def create(body = {})
11
+ @transport.post("/order", body: body)
12
+ end
13
+
14
+
15
+ # Fetch Order
16
+ # GET /order/{id}
17
+ def fetch(id)
18
+ @transport.get("/order/#{id}")
19
+ end
20
+
21
+
22
+ # List Orders
23
+ # GET /order
24
+ def list(query = {})
25
+ @transport.get("/order", query: query)
26
+ end
27
+
28
+
29
+ # Fetch Product Orders
30
+ # GET /order/product/{id}
31
+ def product(id)
32
+ @transport.get("/order/product/#{id}")
33
+ end
34
+
35
+
36
+ # Validate Order
37
+ # GET /order/{code}/validate
38
+ def validate(code)
39
+ @transport.get("/order/#{code}/validate")
40
+ end
41
+
42
+
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+ # Generated by weaver ruby-sdk generator — do not edit manually
3
+
4
+ module Paystack
5
+ module Resources
6
+ class Page < BaseResource
7
+
8
+ # Add Products
9
+ # POST /page/{id}/product
10
+ def add_products(id, body = {})
11
+ @transport.post("/page/#{id}/product", body: body)
12
+ end
13
+
14
+
15
+ # Check Slug Availability
16
+ # GET /page/check_slug_availability/{slug}
17
+ def check_slug_availability(slug)
18
+ @transport.get("/page/check_slug_availability/#{slug}")
19
+ end
20
+
21
+
22
+ # Create Page
23
+ # POST /page
24
+ def create(body = {})
25
+ @transport.post("/page", body: body)
26
+ end
27
+
28
+
29
+ # Fetch Page
30
+ # GET /page/{id}
31
+ def fetch(id)
32
+ @transport.get("/page/#{id}")
33
+ end
34
+
35
+
36
+ # List Pages
37
+ # GET /page
38
+ def list(query = {})
39
+ @transport.get("/page", query: query)
40
+ end
41
+
42
+
43
+ # Update Page
44
+ # PUT /page/{id}
45
+ def update(id, body = {})
46
+ @transport.put("/page/#{id}", body: body)
47
+ end
48
+
49
+
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+ # Generated by weaver ruby-sdk generator — do not edit manually
3
+
4
+ module Paystack
5
+ module Resources
6
+ class PaymentRequest < BaseResource
7
+
8
+ # Archive Payment Request
9
+ # POST /paymentrequest/archive/{id}
10
+ def archive(id)
11
+ @transport.post("/paymentrequest/archive/#{id}")
12
+ end
13
+
14
+
15
+ # Create Payment Request
16
+ # POST /paymentrequest
17
+ def create(body = {})
18
+ @transport.post("/paymentrequest", body: body)
19
+ end
20
+
21
+
22
+ # Fetch Payment Request
23
+ # GET /paymentrequest/{id}
24
+ def fetch(id)
25
+ @transport.get("/paymentrequest/#{id}")
26
+ end
27
+
28
+
29
+ # Finalize Payment Request
30
+ # POST /paymentrequest/finalize/{id}
31
+ def finalize(id)
32
+ @transport.post("/paymentrequest/finalize/#{id}")
33
+ end
34
+
35
+
36
+ # List Payment Request
37
+ # GET /paymentrequest
38
+ def list(query = {})
39
+ @transport.get("/paymentrequest", query: query)
40
+ end
41
+
42
+
43
+ # Send Notification
44
+ # POST /paymentrequest/notify/{id}
45
+ def notify(id)
46
+ @transport.post("/paymentrequest/notify/#{id}")
47
+ end
48
+
49
+
50
+ # Payment Request Total
51
+ # GET /paymentrequest/totals
52
+ def totals()
53
+ @transport.get("/paymentrequest/totals")
54
+ end
55
+
56
+
57
+ # Update Payment Request
58
+ # PUT /paymentrequest/{id}
59
+ def update(id, body = {})
60
+ @transport.put("/paymentrequest/#{id}", body: body)
61
+ end
62
+
63
+
64
+ # Verify Payment Request
65
+ # GET /paymentrequest/verify/{id}
66
+ def verify(id)
67
+ @transport.get("/paymentrequest/verify/#{id}")
68
+ end
69
+
70
+
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+ # Generated by weaver ruby-sdk generator — do not edit manually
3
+
4
+ module Paystack
5
+ module Resources
6
+ class Plan < BaseResource
7
+
8
+ # Create Plan
9
+ # POST /plan
10
+ def create(body = {})
11
+ @transport.post("/plan", body: body)
12
+ end
13
+
14
+
15
+ # Fetch Plan
16
+ # GET /plan/{code}
17
+ def fetch(code)
18
+ @transport.get("/plan/#{code}")
19
+ end
20
+
21
+
22
+ # List Plans
23
+ # GET /plan
24
+ def list(query = {})
25
+ @transport.get("/plan", query: query)
26
+ end
27
+
28
+
29
+ # Update Plan
30
+ # PUT /plan/{code}
31
+ def update(code, body = {})
32
+ @transport.put("/plan/#{code}", body: body)
33
+ end
34
+
35
+
36
+ end
37
+ end
38
+ end