paystack_sdk 0.0.8 → 0.0.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1161ca83326adeace91da47a17f4c078cee7f6073b4efda0d0d0e707b9744928
4
- data.tar.gz: 44a2b6e56897e8e3f020705f2b836f6a6172599f43b1c976144a2cab9165616d
3
+ metadata.gz: 49b220e27fe0ec66289af8fbbba9d84e63c3698b5964629293edcc8e31335119
4
+ data.tar.gz: 0df4630d49d761fb99371fb020271c515153dcbf3f784ac6c6bf543dc63a0634
5
5
  SHA512:
6
- metadata.gz: 59fc459f0ca4b103c4815c6523d6a6f6b7bf8088ef391c3d980b829f512aab9e66081796e2713d93d09cfeadb73c6069101ca91ce3b993ccf47389e0d8404df4
7
- data.tar.gz: c4cc838ad71d8a8860b037096db5cf3c8cc55ed73a735eb405b4e81bd065a935de1529aa7e31876c64901c3f8fe973c9b2e7294924c7fd36881668a14297056a
6
+ metadata.gz: 15748f65a44c87b7a2b679642c3a46c8aa9f7db1841f964975e0929d30dfcdf52a4979a74289085717927452b81806c3c364c362a9cf15416db75baf25b5db43
7
+ data.tar.gz: 0e242f0b20e9475d4eb23fff2f6979007d104223f0d681701da99f9aa2635644c9bad41ce23878605dd3583eee38e3535703347a351d7995f078922b1c081798
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.9] - 2025-06-26
4
+
5
+ ### Added
6
+
7
+ - Verification resource with support for:
8
+ - Resolving bank accounts
9
+ - Resolving card BINs
10
+ - Validating accounts (with required and optional fields)
11
+ - Registered `verification` resource in the main client for easy access
12
+ - Regression tests for all Verification resource methods, including required field validation and full parameter support
13
+
14
+ ### Changed
15
+
16
+ - Fix the link for listing banks API
17
+
3
18
  ## [0.0.8] - 2025-06-26
4
19
 
5
20
  ### Added
@@ -5,6 +5,7 @@ require_relative "resources/customers"
5
5
  require_relative "resources/transfer_recipients"
6
6
  require_relative "resources/transfers"
7
7
  require_relative "resources/banks"
8
+ require_relative "resources/verification"
8
9
  require_relative "utils/connection_utils"
9
10
 
10
11
  module PaystackSdk
@@ -106,5 +107,19 @@ module PaystackSdk
106
107
  def banks
107
108
  @banks ||= Resources::Banks.new(@connection)
108
109
  end
110
+
111
+ # Provides access to the `Verification` resource.
112
+ #
113
+ # @return [PaystackSdk::Resources::Verification] An instance of the
114
+ # `Verification` resource.
115
+ #
116
+ # @example
117
+ # ```ruby
118
+ # verification = client.verification
119
+ # response = verification.resolve_account(account_number: ..., bank_code: ...)
120
+ # ```
121
+ def verification
122
+ @verification ||= Resources::Verification.new(@connection)
123
+ end
109
124
  end
110
125
  end
@@ -4,7 +4,7 @@ module PaystackSdk
4
4
  module Resources
5
5
  class Banks < Base
6
6
  # List banks
7
- # @see https://paystack.com/docs/api/bank/#list
7
+ # @see https://paystack.com/docs/api/miscellaneous/#bank
8
8
  def list(query = {})
9
9
  if query.key?(:currency)
10
10
  validate_allowed_values!(
@@ -0,0 +1,36 @@
1
+ require_relative "../validations"
2
+ require_relative "base"
3
+
4
+ module PaystackSdk
5
+ module Resources
6
+ class Verification < Base
7
+ # Resolve Bank Account
8
+ # @see https://paystack.com/docs/api/verification/#resolve-bank-account
9
+ def resolve_account(account_number:, bank_code:)
10
+ validate_presence!(value: account_number, name: "account_number")
11
+ validate_presence!(value: bank_code, name: "bank_code")
12
+ handle_response(@connection.get("/bank/resolve", {account_number: account_number, bank_code: bank_code}))
13
+ end
14
+
15
+ # Resolve Card BIN
16
+ # @see https://paystack.com/docs/api/verification/#resolve-card-bin
17
+ def resolve_card_bin(bin)
18
+ validate_presence!(value: bin, name: "bin")
19
+ handle_response(@connection.get("/decision/bin/#{bin}"))
20
+ end
21
+
22
+ # Validate Account
23
+ # @see https://paystack.com/docs/api/verification/#validate-account
24
+ # Required: account_number, account_name, account_type, bank_code, country_code, document_type
25
+ # Optional: document_number
26
+ def validate_account(params)
27
+ validate_required_params!(
28
+ payload: params,
29
+ required_params: %i[account_number account_name account_type bank_code country_code document_type],
30
+ operation_name: "Validate Account"
31
+ )
32
+ handle_response(@connection.post("/bank/validate", params))
33
+ end
34
+ end
35
+ end
36
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PaystackSdk
4
- VERSION = "0.0.8"
4
+ VERSION = "0.0.9"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paystack_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxwell Nana Forson (theLazyProgrammer)
@@ -121,6 +121,7 @@ files:
121
121
  - lib/paystack_sdk/resources/transactions.rb
122
122
  - lib/paystack_sdk/resources/transfer_recipients.rb
123
123
  - lib/paystack_sdk/resources/transfers.rb
124
+ - lib/paystack_sdk/resources/verification.rb
124
125
  - lib/paystack_sdk/response.rb
125
126
  - lib/paystack_sdk/utils/connection_utils.rb
126
127
  - lib/paystack_sdk/validations.rb