checkout_sdk 1.0.0 → 1.0.1

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: b5bbda884a13d07e5623ca6e8bfe89341a423cfb132f0572920aeafa8eccde6f
4
- data.tar.gz: 6b3cdd2cd33a3d55989379c3274d72950af873ca5352763a89f0ea9d38c0ad60
3
+ metadata.gz: 4dbf32713b437c8a46d0d53b7aa9677e086bacba9a420c51469f7a11e4e0db03
4
+ data.tar.gz: f78e849f1a5ec86fc16fb09934d5151aa03bd43dd34b7a8d1da96ca18311154f
5
5
  SHA512:
6
- metadata.gz: efc40dfb03aa542f200f82530b6addbffa6e5afed8c27ac74c59c8dd7dad41c1c6a102ee0de6d556b5585acdb6f28e873f4ecf762ee518210579096650b4e710
7
- data.tar.gz: 37bd641e9b370e799fc2eee037a65f47c7b6bee723195db4d2e9eab6f42641a7303c7a5a82d9bbdd501a6a9b239dae3310e0d81113746f20d7fea0c1bb7fd9b7
6
+ metadata.gz: f163f3cdd0d48d1198c6f914ccc0fc20850f357e79ca5355dc8ddc8931d5cbb255196d822c20c785a2740f53e9b5fbcd71273cf9b1f4e26c526fd937bef2b5f4
7
+ data.tar.gz: 8cee0c1831036c54e8143e33db10495a443ec15b2d564ac246c7c7a81d7f0db2534d77fe151f062b5a1dc717cf185895994e595cb0323475f11462730946c39f
@@ -16,7 +16,7 @@ module CheckoutSdk
16
16
  # @param [ApiClient] files_client
17
17
  # @param [CheckoutConfiguration] configuration
18
18
  def initialize(api_client, files_client, configuration)
19
- super(api_client, configuration, CheckoutSdk::AuthorizationType::OAUTH)
19
+ super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH)
20
20
  @files_client = files_client
21
21
  end
22
22
 
@@ -33,6 +33,8 @@ module CheckoutSdk
33
33
  # @return [CheckoutSdk::Balances::BalancesClient]
34
34
  # @!attribute transfers
35
35
  # @return [CheckoutSdk::Transfers::TransfersClient]
36
+ # @!attribute metadata
37
+ # @return [CheckoutSdk::Metadata::MetadataClient]
36
38
  class CheckoutApi
37
39
  attr_reader :customers,
38
40
  :disputes,
@@ -49,7 +51,8 @@ module CheckoutSdk
49
51
  :workflows,
50
52
  :risk,
51
53
  :balances,
52
- :transfers
54
+ :transfers,
55
+ :metadata
53
56
 
54
57
  # @param [CheckoutConfiguration] configuration
55
58
  def initialize(configuration)
@@ -70,6 +73,7 @@ module CheckoutSdk
70
73
  @risk = CheckoutSdk::Risk::RiskClient.new api_client, configuration
71
74
  @balances = CheckoutSdk::Balances::BalancesClient.new(balances_client(configuration), configuration)
72
75
  @transfers = CheckoutSdk::Transfers::TransfersClient.new(transfers_client(configuration), configuration)
76
+ @metadata = CheckoutSdk::Metadata::MetadataClient.new api_client, configuration
73
77
  end
74
78
 
75
79
  private
@@ -7,7 +7,8 @@ module CheckoutSdk
7
7
  FILES = 'files'
8
8
  ACCEPT = 'accept'
9
9
  EVIDENCE = 'evidence'
10
- private_constant :DISPUTES, :FILES, :ACCEPT, :EVIDENCE
10
+ SCHEME_FILES = 'schemefiles'
11
+ private_constant :DISPUTES, :FILES, :ACCEPT, :EVIDENCE, :SCHEME_FILES
11
12
 
12
13
  # @param [ApiClient] api_client
13
14
  # @param [CheckoutConfiguration] configuration
@@ -46,6 +47,11 @@ module CheckoutSdk
46
47
  api_client.invoke_post(build_path(DISPUTES, dispute_id, EVIDENCE), sdk_authorization)
47
48
  end
48
49
 
50
+ # @param [String] dispute_id
51
+ def get_dispute_scheme_files(dispute_id)
52
+ api_client.invoke_get(build_path(DISPUTES, dispute_id, SCHEME_FILES), sdk_authorization)
53
+ end
54
+
49
55
  # @param [CheckoutSdk::Common::FileRequest] file_request
50
56
  def upload_file(file_request)
51
57
  api_client.submit_file(FILES, sdk_authorization, file_request)
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'checkout_sdk/metadata/metadata_client'
4
+ require 'checkout_sdk/metadata/metadata_format'
5
+ require 'checkout_sdk/metadata/metadata_request'
6
+ require 'checkout_sdk/metadata/source/metadata_source'
7
+ require 'checkout_sdk/metadata/source/bin_metadata_source'
8
+ require 'checkout_sdk/metadata/source/card_metadata_source'
9
+ require 'checkout_sdk/metadata/source/id_metadata_source'
10
+ require 'checkout_sdk/metadata/source/metadata_source_type'
11
+ require 'checkout_sdk/metadata/source/token_metadata_source'
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Metadata
5
+ class MetadataClient < Client
6
+ METADATA = 'metadata'
7
+ CARD = 'card'
8
+ private_constant :METADATA, :CARD
9
+
10
+ # @param [ApiClient] api_client
11
+ # @param [CheckoutConfiguration] configuration
12
+ def initialize(api_client, configuration)
13
+ super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH
14
+ end
15
+
16
+ # @param [MetadataRequest] metadata_request
17
+ def request_card_metadata(metadata_request)
18
+ api_client.invoke_post(build_path(METADATA, CARD), sdk_authorization, metadata_request)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Metadata
5
+ module Format
6
+ BASIC = 'basic'
7
+ CARD_PAYOUTS = 'card_payouts'
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Metadata
5
+ # @!attribute source
6
+ # @return [MetadataSource]
7
+ # @!attribute format
8
+ # @return [String] {Format}
9
+ class MetadataRequest
10
+ attr_accessor :source,
11
+ :format
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Metadata
5
+ # @!attribute bin
6
+ # @return [String]
7
+ class BinMetadataSource < MetadataSource
8
+ attr_accessor :bin
9
+
10
+ def initialize
11
+ super MetadataSourceType::BIN
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Metadata
5
+ # @!attribute number
6
+ # @return [String]
7
+ class CardMetadataSource < MetadataSource
8
+ attr_accessor :number
9
+
10
+ def initialize
11
+ super MetadataSourceType::CARD
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Metadata
5
+ # @!attribute id
6
+ # @return [String]
7
+ class IdMetadataSource < MetadataSource
8
+ attr_accessor :id
9
+
10
+ def initialize
11
+ super MetadataSourceType::ID
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Metadata
5
+ # @!attribute type
6
+ # @return [String] {MetadataSourceType}
7
+ class MetadataSource
8
+ attr_reader :type
9
+
10
+ protected
11
+
12
+ # @abstract
13
+ # @param [String] type {MetadataSourceType}
14
+ def initialize(type)
15
+ @type = type
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Metadata
5
+ module MetadataSourceType
6
+ BIN = 'bin'
7
+ CARD = 'card'
8
+ ID = 'id'
9
+ TOKEN = 'token'
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Metadata
5
+ # @!attribute token
6
+ # @return [String]
7
+ class TokenMetadataSource < MetadataSource
8
+ attr_accessor :token
9
+
10
+ def initialize
11
+ super MetadataSourceType::TOKEN
12
+ end
13
+ end
14
+ end
15
+ end
@@ -20,6 +20,7 @@ module CheckoutSdk
20
20
  DISPUTES_VIEW = 'disputes:view'
21
21
  DISPUTES_PROVIDE_EVIDENCE = 'disputes:provide-evidence'
22
22
  DISPUTES_ACCEPT = 'disputes:accept'
23
+ DISPUTES_SCHEME_FILES = 'disputes:scheme-files'
23
24
  MARKETPLACE = 'marketplace'
24
25
  ACCOUNTS = 'accounts'
25
26
  FLOW = 'flow'
@@ -39,5 +40,6 @@ module CheckoutSdk
39
40
  MIDDLEWARE_MERCHANTS_PUBLIC = 'middleware:merchants-public'
40
41
  REPORTING = 'reporting'
41
42
  REPORTING_VIEW = 'reporting:view'
43
+ CARD_METADATA = 'vault:card-metadata'
42
44
  end
43
45
  end
@@ -8,13 +8,19 @@ module CheckoutSdk
8
8
  # @return [String]
9
9
  # @!attribute zip
10
10
  # @return [String]
11
+ # @!attribute first_name
12
+ # @return [String]
11
13
  # @!attribute last_name
12
14
  # @return [String]
15
+ # @!attribute country
16
+ # @return [String] {CheckoutSdk::Common::Country}
13
17
  class PaymentRecipient
14
18
  attr_accessor :dob,
15
19
  :account_number,
16
20
  :zip,
17
- :last_name
21
+ :first_name,
22
+ :last_name,
23
+ :country
18
24
  end
19
25
  end
20
26
  end
@@ -7,9 +7,15 @@ module CheckoutSdk
7
7
  # @return [String]
8
8
  # @!attribute cvv
9
9
  # @return [String]
10
+ # @!attribute stored
11
+ # @return [TrueClass, FalseClass]
12
+ # @!attribute store_for_future_use
13
+ # @return [TrueClass, FalseClass]
10
14
  class IdSource < PaymentSource
11
15
  attr_accessor :id,
12
- :cvv
16
+ :cvv,
17
+ :stored,
18
+ :store_for_future_use
13
19
 
14
20
  def initialize
15
21
  super CheckoutSdk::Common::PaymentSourceType::ID
@@ -9,12 +9,15 @@ module CheckoutSdk
9
9
  # @return [CheckoutSdk::Common::Address]
10
10
  # @!attribute phone
11
11
  # @return [CheckoutSdk::Common::Phone]
12
+ # @!attribute stored
13
+ # @return [TrueClass, FalseClass]
12
14
  # @!attribute store_for_future_use
13
15
  # @return [TrueClass, FalseClass]
14
16
  class TokenSource < PaymentSource
15
17
  attr_accessor :token,
16
18
  :billing_address,
17
19
  :phone,
20
+ :stored,
18
21
  :store_for_future_use
19
22
 
20
23
  def initialize
@@ -8,10 +8,16 @@ module CheckoutSdk
8
8
  # @return [String]
9
9
  # @!attribute payment_method
10
10
  # @return [String]
11
+ # @!attribute stored
12
+ # @return [TrueClass, FalseClass]
13
+ # @!attribute store_for_future_use
14
+ # @return [TrueClass, FalseClass]
11
15
  class IdSource < PaymentSource
12
16
  attr_accessor :id,
13
17
  :cvv,
14
- :payment_method
18
+ :payment_method,
19
+ :stored,
20
+ :store_for_future_use
15
21
 
16
22
  def initialize
17
23
  super CheckoutSdk::Common::PaymentSourceType::ID
@@ -8,12 +8,15 @@ module CheckoutSdk
8
8
  # @return [CheckoutSdk::Common::Address]
9
9
  # @!attribute phone
10
10
  # @return [CheckoutSdk::Common::Phone]
11
+ # @!attribute stored
12
+ # @return [TrueClass, FalseClass]
11
13
  # @!attribute store_for_future_use
12
14
  # @return [TrueClass, FalseClass]
13
15
  class TokenSource < PaymentSource
14
16
  attr_accessor :token,
15
17
  :billing_address,
16
18
  :phone,
19
+ :stored,
17
20
  :store_for_future_use
18
21
 
19
22
  def initialize
@@ -2,6 +2,8 @@
2
2
 
3
3
  module CheckoutSdk
4
4
  module Risk
5
+ # @deprecated Risk endpoints are no longer supported officially, This module will be removed in a
6
+ # future release.
5
7
  class RiskClient < Client
6
8
  PRE_AUTHENTICATION = 'risk/assessments/pre-authentication'
7
9
  PRE_CAPTURE = 'risk/assessments/pre-capture'
@@ -9,7 +9,7 @@ module CheckoutSdk
9
9
  # @param [ApiClient] api_client
10
10
  # @param [CheckoutConfiguration] configuration
11
11
  def initialize(api_client, configuration)
12
- super(api_client, configuration, CheckoutSdk::AuthorizationType::OAUTH)
12
+ super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH)
13
13
  end
14
14
 
15
15
  # @param [CreateTransfer] create_transfer
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CheckoutSdk
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.1'
5
5
  end
data/lib/checkout_sdk.rb CHANGED
@@ -62,6 +62,7 @@ require 'checkout_sdk/workflows/workflows'
62
62
  require 'checkout_sdk/risk/risk'
63
63
  require 'checkout_sdk/balances/balances'
64
64
  require 'checkout_sdk/transfers/transfers'
65
+ require 'checkout_sdk/metadata/metadata'
65
66
 
66
67
  # Checkout modules (previous)
67
68
  require 'checkout_sdk/sources/sources'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: checkout_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Checkout
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-29 00:00:00.000000000 Z
11
+ date: 2022-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -231,6 +231,16 @@ files:
231
231
  - lib/checkout_sdk/instruments/update/update_instrument_card.rb
232
232
  - lib/checkout_sdk/instruments/update/update_instrument_token.rb
233
233
  - lib/checkout_sdk/json_serializer.rb
234
+ - lib/checkout_sdk/metadata/metadata.rb
235
+ - lib/checkout_sdk/metadata/metadata_client.rb
236
+ - lib/checkout_sdk/metadata/metadata_format.rb
237
+ - lib/checkout_sdk/metadata/metadata_request.rb
238
+ - lib/checkout_sdk/metadata/source/bin_metadata_source.rb
239
+ - lib/checkout_sdk/metadata/source/card_metadata_source.rb
240
+ - lib/checkout_sdk/metadata/source/id_metadata_source.rb
241
+ - lib/checkout_sdk/metadata/source/metadata_source.rb
242
+ - lib/checkout_sdk/metadata/source/metadata_source_type.rb
243
+ - lib/checkout_sdk/metadata/source/token_metadata_source.rb
234
244
  - lib/checkout_sdk/oauth_access_token.rb
235
245
  - lib/checkout_sdk/oauth_scopes.rb
236
246
  - lib/checkout_sdk/oauth_sdk_credentials.rb