checkout_sdk 2.3.0 → 2.5.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 (51) hide show
  1. checksums.yaml +4 -4
  2. data/lib/checkout_sdk/api_client.rb +37 -10
  3. data/lib/checkout_sdk/checkout_api.rb +5 -1
  4. data/lib/checkout_sdk/identities/address_document_verification/address_document_verification_client.rb +32 -3
  5. data/lib/checkout_sdk/identities/address_document_verification/address_document_verification_request.rb +13 -3
  6. data/lib/checkout_sdk/identities/face_authentication/face_authentication_attempt_request.rb +13 -2
  7. data/lib/checkout_sdk/identities/face_authentication/face_authentication_client.rb +12 -4
  8. data/lib/checkout_sdk/identities/face_authentication/face_authentication_request.rb +19 -0
  9. data/lib/checkout_sdk/identities/id_document_verification/id_document_verification_client.rb +33 -3
  10. data/lib/checkout_sdk/identities/id_document_verification/id_document_verification_request.rb +30 -0
  11. data/lib/checkout_sdk/identities/identities.rb +8 -0
  12. data/lib/checkout_sdk/identities/identity_verification/identity_verification_attempt_request.rb +13 -3
  13. data/lib/checkout_sdk/identities/identity_verification/identity_verification_client.rb +12 -4
  14. data/lib/checkout_sdk/identities/identity_verification/identity_verification_request.rb +25 -4
  15. data/lib/checkout_sdk/identities/identity_verification/idv_client_information.rb +17 -3
  16. data/lib/checkout_sdk/identities/identity_verification/idv_declared_data.rb +16 -3
  17. data/lib/checkout_sdk/identities/identity_verification/idv_identity_client_information.rb +30 -0
  18. data/lib/checkout_sdk/identities/identity_verification/idv_identity_declared_data.rb +34 -0
  19. data/lib/checkout_sdk/identities/idv_address.rb +48 -0
  20. data/lib/checkout_sdk/identities/idv_attempt_assets_query_filter.rb +24 -0
  21. data/lib/checkout_sdk/identities/idv_attempts_query_filter.rb +24 -0
  22. data/lib/checkout_sdk/identities/idv_phone_number.rb +27 -0
  23. data/lib/checkout_sdk/inventory/inventory.rb +9 -0
  24. data/lib/checkout_sdk/inventory/inventory_adjustment_request.rb +24 -0
  25. data/lib/checkout_sdk/inventory/inventory_client.rb +149 -0
  26. data/lib/checkout_sdk/inventory/inventory_money.rb +19 -0
  27. data/lib/checkout_sdk/inventory/inventory_reservation_item.rb +20 -0
  28. data/lib/checkout_sdk/inventory/inventory_reservation_request.rb +27 -0
  29. data/lib/checkout_sdk/inventory/inventory_set_levels_request.rb +22 -0
  30. data/lib/checkout_sdk/inventory/inventory_set_product_request.rb +139 -0
  31. data/lib/checkout_sdk/issuing/card_update_headers.rb +32 -0
  32. data/lib/checkout_sdk/issuing/issuing.rb +1 -0
  33. data/lib/checkout_sdk/issuing/issuing_client.rb +13 -2
  34. data/lib/checkout_sdk/issuing/update_card_request.rb +37 -5
  35. data/lib/checkout_sdk/payments/accommodation_data.rb +160 -0
  36. data/lib/checkout_sdk/payments/ach_service_type.rb +14 -0
  37. data/lib/checkout_sdk/payments/aggregator.rb +28 -0
  38. data/lib/checkout_sdk/payments/airline_data.rb +37 -3
  39. data/lib/checkout_sdk/payments/flight_leg_details.rb +39 -13
  40. data/lib/checkout_sdk/payments/pan_processed_type.rb +15 -0
  41. data/lib/checkout_sdk/payments/partner_customer_risk_data.rb +23 -0
  42. data/lib/checkout_sdk/payments/passenger.rb +24 -7
  43. data/lib/checkout_sdk/payments/payments.rb +7 -1
  44. data/lib/checkout_sdk/payments/processing_card_type.rb +17 -0
  45. data/lib/checkout_sdk/payments/processing_data.rb +4 -4
  46. data/lib/checkout_sdk/payments/processing_settings.rb +249 -55
  47. data/lib/checkout_sdk/payments/ticket.rb +46 -0
  48. data/lib/checkout_sdk/version.rb +1 -1
  49. data/lib/checkout_sdk.rb +1 -0
  50. metadata +24 -3
  51. data/lib/checkout_sdk/payments/sender/ticket.rb +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10c1640f0771e6b8ad38799a40a00322c5347fdacedce0669c6920b4a4a36199
4
- data.tar.gz: 43d03c65b9a2ecfa94b50116f86db22aa5a86f1698d9bb134c2d5f49bd672d31
3
+ metadata.gz: 1b407e28ff0b39c99b367549f0a8936f08cdab77844dbbaae25120131b7a68fc
4
+ data.tar.gz: a51e29d577617ba5c4a36e288df85b6fd03e2184b0f9a7f85db86455258079a0
5
5
  SHA512:
6
- metadata.gz: 43f590d48d61549fa90ade59902f394efb2c79e06a76775fe531493e275506f665168be87c6aef6947f6664e66b4a3c2c046925ca858a08bc3a5bff8c5c7ac02
7
- data.tar.gz: dd687b3f02bed8008e0ae4aabe23bd948251a78274d71f48da80a657d3c2dd266fcd98eb2bc7a4bebe0dcb21844e61eb2bb222fd5b835cbc5537cca98e895b6b
6
+ metadata.gz: aaf583699b582fdcd33dc32e5178870074b874427ce2a032a0919ef472d8e59ae9627824affffb185a11735607a310a52dabfb5fa52bd10371a715137e128226
7
+ data.tar.gz: 60331bb9c0b309e98f738d1bbc140fa648c6b75c4a75ebc442f5bd406bcca6cfd343c1bbad8817d894ca6657d03c00f08da9a3f7c084a6e3c86caf1dfc8bd3a9
@@ -26,8 +26,8 @@ module CheckoutSdk
26
26
  invoke(:put, path, authorization, request, nil, params: nil, extra_headers: headers)
27
27
  end
28
28
 
29
- def invoke_patch(path, authorization, request = nil)
30
- invoke(:patch, path, authorization, request, nil, params: nil)
29
+ def invoke_patch(path, authorization, request = nil, headers = nil)
30
+ invoke(:patch, path, authorization, request, nil, params: nil, extra_headers: headers)
31
31
  end
32
32
 
33
33
  def invoke_delete(path, authorization)
@@ -66,18 +66,45 @@ module CheckoutSdk
66
66
  Authorization: authorization.authorization_header }
67
67
  end
68
68
 
69
- # Map a typed headers container (e.g. {CheckoutSdk::Common::Headers}) onto the underlying
70
- # HTTP header hash. Each attribute that's set is emitted as the corresponding
71
- # canonical HTTP header.
69
+ # Attribute name to HTTP header name, for every typed headers container the SDK supports.
70
+ #
71
+ # The header names are case sensitive in the spec: return-encrypted-cvv is lower case where a
72
+ # naive conversion would produce Return-Encrypted-Cvv.
73
+ #
74
+ # The values are Strings, not Symbols, and that is load bearing. Faraday::Utils::Headers
75
+ # preserves a String key verbatim but rewrites a Symbol key as
76
+ # `key.to_s.split('_').map(&:capitalize).join('-')`, so :'return-encrypted-cvv' would reach
77
+ # the wire as Return-encrypted-cvv and :'Encryption-Key' as Encryption-key. Strings are the
78
+ # only way to send the spelling the spec asks for. As a side effect this also stops If-Match
79
+ # being sent as If-match, which it was before.
80
+ EXTRA_HEADER_NAMES = {
81
+ if_match: 'If-Match',
82
+ accept: 'Accept',
83
+ return_encrypted_cvv: 'return-encrypted-cvv',
84
+ encryption_key: 'Encryption-Key'
85
+ }.freeze
86
+ private_constant :EXTRA_HEADER_NAMES
87
+
88
+ # Map a typed headers container (e.g. {CheckoutSdk::Common::Headers},
89
+ # {CheckoutSdk::Issuing::CardUpdateHeaders}) onto the underlying HTTP header hash. Each
90
+ # attribute that is set is emitted as the corresponding HTTP header.
91
+ #
92
+ # Previously a hand-written if/return chain. That shape had a latent trap: it ended with
93
+ # `return unless extra_headers.respond_to?(:accept) && extra_headers.accept`, so any header
94
+ # handled after that point was dead code for every container without an `accept` attribute.
95
+ # Iterating an explicit map removes the trap and keeps the existing If-Match and Accept
96
+ # behaviour byte for byte.
72
97
  def apply_extra_headers(http_headers, extra_headers)
73
98
  return if extra_headers.nil?
74
99
 
75
- if extra_headers.respond_to?(:if_match) && extra_headers.if_match
76
- http_headers[:'If-Match'] = extra_headers.if_match
77
- end
78
- return unless extra_headers.respond_to?(:accept) && extra_headers.accept
100
+ EXTRA_HEADER_NAMES.each do |attribute, header_name|
101
+ next unless extra_headers.respond_to?(attribute)
102
+
103
+ value = extra_headers.public_send(attribute)
104
+ next if value.nil? || value.to_s.empty?
79
105
 
80
- http_headers[:Accept] = extra_headers.accept
106
+ http_headers[header_name] = value
107
+ end
81
108
  end
82
109
 
83
110
  def append_params(path, input_params)
@@ -79,6 +79,8 @@ module CheckoutSdk
79
79
  # @return [CheckoutSdk::Payments::ApplePayClient]
80
80
  # @!attribute google_pay
81
81
  # @return [CheckoutSdk::Payments::GooglePayClient]
82
+ # @!attribute inventory
83
+ # @return [CheckoutSdk::Inventory::InventoryClient]
82
84
  class CheckoutApi
83
85
  attr_reader :customers,
84
86
  :disputes,
@@ -118,7 +120,8 @@ module CheckoutSdk
118
120
  :identity_verification,
119
121
  :face_authentication,
120
122
  :apple_pay,
121
- :google_pay
123
+ :google_pay,
124
+ :inventory
122
125
 
123
126
  # @param [CheckoutConfiguration] configuration
124
127
  def initialize(configuration)
@@ -168,6 +171,7 @@ module CheckoutSdk
168
171
  CheckoutSdk::Identities::FaceAuthentication::FaceAuthenticationClient.new(api_client, configuration)
169
172
  @apple_pay = CheckoutSdk::Payments::ApplePayClient.new(api_client, configuration)
170
173
  @google_pay = CheckoutSdk::Payments::GooglePayClient.new(api_client, configuration)
174
+ @inventory = CheckoutSdk::Inventory::InventoryClient.new(api_client, configuration)
171
175
  end
172
176
 
173
177
  private
@@ -9,7 +9,8 @@ module CheckoutSdk
9
9
  ANONYMIZE = 'anonymize'
10
10
  ATTEMPTS = 'attempts'
11
11
  PDF_REPORT = 'pdf-report'
12
- private_constant :ADDRESS_DOCUMENT_VERIFICATIONS, :ANONYMIZE, :ATTEMPTS, :PDF_REPORT
12
+ ASSETS = 'assets'
13
+ private_constant :ADDRESS_DOCUMENT_VERIFICATIONS, :ANONYMIZE, :ATTEMPTS, :PDF_REPORT, :ASSETS
13
14
 
14
15
  # @param [ApiClient] api_client
15
16
  # @param [CheckoutConfiguration] configuration
@@ -49,11 +50,19 @@ module CheckoutSdk
49
50
  )
50
51
  end
51
52
 
53
+ # Get the details of all attempts for a specific address document verification.
54
+ #
55
+ # Results are paginated. Beta.
56
+ #
52
57
  # @param [String] address_document_verification_id
53
- def get_address_document_verification_attempts(address_document_verification_id)
58
+ # @param [Hash, CheckoutSdk::Identities::IdvAttemptsQueryFilter, nil] query pagination
59
+ # query parameters; supports :skip (Integer, default: 0) and :limit (Integer, default: 10)
60
+ # @return [OpenStruct] the paginated attempt list
61
+ def get_address_document_verification_attempts(address_document_verification_id, query = nil)
54
62
  api_client.invoke_get(
55
63
  build_path(ADDRESS_DOCUMENT_VERIFICATIONS, address_document_verification_id, ATTEMPTS),
56
- sdk_authorization
64
+ sdk_authorization,
65
+ query
57
66
  )
58
67
  end
59
68
 
@@ -73,6 +82,26 @@ module CheckoutSdk
73
82
  sdk_authorization
74
83
  )
75
84
  end
85
+
86
+ # Get the assets (the document image) uploaded for a address document verification attempt.
87
+ #
88
+ # Results are paginated. Beta.
89
+ #
90
+ # @param [String] address_document_verification_id
91
+ # @param [String] attempt_id
92
+ # @param [Hash, CheckoutSdk::Identities::IdvAttemptAssetsQueryFilter, nil] query pagination
93
+ # query parameters; supports :skip (Integer, default: 0) and :limit (Integer, default: 10)
94
+ # @return [OpenStruct] the paginated asset list
95
+ def get_address_document_verification_attempt_assets(address_document_verification_id,
96
+ attempt_id,
97
+ query = nil)
98
+ api_client.invoke_get(
99
+ build_path(ADDRESS_DOCUMENT_VERIFICATIONS, address_document_verification_id,
100
+ ATTEMPTS, attempt_id, ASSETS),
101
+ sdk_authorization,
102
+ query
103
+ )
104
+ end
76
105
  end
77
106
  end
78
107
  end
@@ -6,11 +6,21 @@ module CheckoutSdk
6
6
  # Request body for POST /address-document-verifications.
7
7
  #
8
8
  # @!attribute applicant_id
9
- # @return [String] The applicant's unique identifier. [Required] Pattern: ^aplt_\w+$
9
+ # The applicant's unique identifier.
10
+ # [Required]
11
+ # ^aplt_\w+$
12
+ # @return [String]
10
13
  # @!attribute user_journey_id
11
- # @return [String] Your configuration ID. [Required] Pattern: ^usj_[a-z2-7]{26}$
14
+ # Your configuration ID.
15
+ # [Required]
16
+ # ^usj_[a-z2-7]{26}$
17
+ # @return [String]
12
18
  # @!attribute declared_data
13
- # @return [IdvDeclaredData, Hash] The personal details provided by the applicant. [Optional]
19
+ # The personal details provided by the applicant. The address document verification
20
+ # request takes the narrower two field IdvDeclaredData shape, not the identity
21
+ # verification one.
22
+ # [Optional]
23
+ # @return [CheckoutSdk::Identities::IdentityVerification::IdvDeclaredData]
14
24
  class AddressDocumentVerificationRequest
15
25
  attr_accessor :applicant_id,
16
26
  :user_journey_id,
@@ -6,11 +6,22 @@ module CheckoutSdk
6
6
  # Request body for POST /face-authentications/{id}/attempts.
7
7
  #
8
8
  # @!attribute redirect_url
9
- # @return [String] URL to redirect the applicant after the attempt.
9
+ # The URL to redirect the applicant to after the attempt.
10
+ # [Required]
11
+ # Format: uri
12
+ # @return [String]
13
+ # @!attribute phone_number
14
+ # The applicant's mobile phone number, if sharing the attempt URL via SMS.
15
+ # [Optional]
16
+ # @return [CheckoutSdk::Identities::IdvPhoneNumber]
10
17
  # @!attribute client_information
18
+ # The applicant's details. The face authentication attempt takes the narrower
19
+ # FavClientInformation shape, which declares neither document field, so this is
20
+ # deliberately the parent class and not IdvIdentityClientInformation.
21
+ # [Optional]
11
22
  # @return [CheckoutSdk::Identities::IdentityVerification::IdvClientInformation]
12
23
  class FaceAuthenticationAttemptRequest
13
- attr_accessor :redirect_url, :client_information
24
+ attr_accessor :redirect_url, :phone_number, :client_information
14
25
  end
15
26
  end
16
27
  end
@@ -47,11 +47,19 @@ module CheckoutSdk
47
47
  )
48
48
  end
49
49
 
50
+ # Get the details of all attempts for a specific face authentication.
51
+ #
52
+ # Results are paginated. Beta.
53
+ #
50
54
  # @param [String] face_authentication_id
51
- def get_face_authentication_attempts(face_authentication_id)
55
+ # @param [Hash, CheckoutSdk::Identities::IdvAttemptsQueryFilter, nil] query pagination
56
+ # query parameters; supports :skip (Integer, default: 0) and :limit (Integer, default: 10)
57
+ # @return [OpenStruct] the paginated attempt list
58
+ def get_face_authentication_attempts(face_authentication_id, query = nil)
52
59
  api_client.invoke_get(
53
60
  build_path(FACE_AUTHENTICATIONS, face_authentication_id, ATTEMPTS),
54
- sdk_authorization
61
+ sdk_authorization,
62
+ query
55
63
  )
56
64
  end
57
65
 
@@ -67,8 +75,8 @@ module CheckoutSdk
67
75
  # Retrieve the assets (face images and videos) captured during a face authentication attempt.
68
76
  # @param [String] face_authentication_id
69
77
  # @param [String] attempt_id
70
- # @param [Hash, nil] query pagination query parameters; supports :skip (Integer, default: 0)
71
- # and :limit (Integer, default: 10)
78
+ # @param [Hash, CheckoutSdk::Identities::IdvAttemptAssetsQueryFilter, nil] query pagination
79
+ # query parameters; supports :skip (Integer, default: 0) and :limit (Integer, default: 10)
72
80
  def get_face_authentication_attempt_assets(face_authentication_id, attempt_id, query = nil)
73
81
  api_client.invoke_get(
74
82
  build_path(FACE_AUTHENTICATIONS, face_authentication_id, ATTEMPTS, attempt_id, ASSETS),
@@ -5,14 +5,33 @@ module CheckoutSdk
5
5
  module FaceAuthentication
6
6
  # Request body for POST /face-authentications.
7
7
  #
8
+ # Realigned with the spec on 2026-09-21. This class omitted user_journey_id, which
9
+ # FavFaceAuthentication declares and requires, and declared external_reference and
10
+ # redirect_url, which it does not. The two invented attributes are retained rather than
11
+ # removed, so no caller breaks, and are scheduled for removal in a future major; the API
12
+ # ignores them.
13
+ #
8
14
  # @!attribute applicant_id
15
+ # The applicant's unique identifier.
16
+ # [Required]
17
+ # ^aplt_\w+$
18
+ # @return [String]
19
+ # @!attribute user_journey_id
20
+ # Your configuration ID.
21
+ # [Required]
22
+ # ^usj_[a-z2-7]{26}$
9
23
  # @return [String]
10
24
  # @!attribute external_reference
25
+ # @deprecated Not declared by FavFaceAuthentication. Never sent by the API and ignored if
26
+ # supplied. Scheduled for removal in a future major.
11
27
  # @return [String]
12
28
  # @!attribute redirect_url
29
+ # @deprecated Not declared by FavFaceAuthentication. The redirect URL belongs on the
30
+ # attempt request, not the face authentication. Scheduled for removal in a future major.
13
31
  # @return [String]
14
32
  class FaceAuthenticationRequest
15
33
  attr_accessor :applicant_id,
34
+ :user_journey_id,
16
35
  :external_reference,
17
36
  :redirect_url
18
37
  end
@@ -9,7 +9,8 @@ module CheckoutSdk
9
9
  ANONYMIZE = 'anonymize'
10
10
  ATTEMPTS = 'attempts'
11
11
  PDF_REPORT = 'pdf-report'
12
- private_constant :ID_DOCUMENT_VERIFICATIONS, :ANONYMIZE, :ATTEMPTS, :PDF_REPORT
12
+ ASSETS = 'assets'
13
+ private_constant :ID_DOCUMENT_VERIFICATIONS, :ANONYMIZE, :ATTEMPTS, :PDF_REPORT, :ASSETS
13
14
 
14
15
  # @param [ApiClient] api_client
15
16
  # @param [CheckoutConfiguration] configuration
@@ -47,11 +48,19 @@ module CheckoutSdk
47
48
  )
48
49
  end
49
50
 
51
+ # Get the details of all attempts for a specific ID document verification.
52
+ #
53
+ # Results are paginated. Beta.
54
+ #
50
55
  # @param [String] id_document_verification_id
51
- def get_id_document_verification_attempts(id_document_verification_id)
56
+ # @param [Hash, CheckoutSdk::Identities::IdvAttemptsQueryFilter, nil] query pagination
57
+ # query parameters; supports :skip (Integer, default: 0) and :limit (Integer, default: 10)
58
+ # @return [OpenStruct] the paginated attempt list
59
+ def get_id_document_verification_attempts(id_document_verification_id, query = nil)
52
60
  api_client.invoke_get(
53
61
  build_path(ID_DOCUMENT_VERIFICATIONS, id_document_verification_id, ATTEMPTS),
54
- sdk_authorization
62
+ sdk_authorization,
63
+ query
55
64
  )
56
65
  end
57
66
 
@@ -71,6 +80,27 @@ module CheckoutSdk
71
80
  sdk_authorization
72
81
  )
73
82
  end
83
+
84
+ # Get the assets (the front and back images of the document) uploaded for an ID document
85
+ # verification attempt.
86
+ #
87
+ # Results are paginated. Beta.
88
+ #
89
+ # @param [String] id_document_verification_id
90
+ # @param [String] attempt_id
91
+ # @param [Hash, CheckoutSdk::Identities::IdvAttemptAssetsQueryFilter, nil] query pagination
92
+ # query parameters; supports :skip (Integer, default: 0) and :limit (Integer, default: 10)
93
+ # @return [OpenStruct] the paginated asset list
94
+ def get_id_document_verification_attempt_assets(id_document_verification_id,
95
+ attempt_id,
96
+ query = nil)
97
+ api_client.invoke_get(
98
+ build_path(ID_DOCUMENT_VERIFICATIONS, id_document_verification_id,
99
+ ATTEMPTS, attempt_id, ASSETS),
100
+ sdk_authorization,
101
+ query
102
+ )
103
+ end
74
104
  end
75
105
  end
76
106
  end
@@ -5,18 +5,48 @@ module CheckoutSdk
5
5
  module IdDocumentVerification
6
6
  # Request body for POST /id-document-verifications.
7
7
  #
8
+ # Realigned with the spec on 2026-09-21. This class previously declared
9
+ # external_reference, document_type, country and redirect_url, none of which
10
+ # IddvIdDocumentVerification declares, and omitted user_journey_id and declared_data, which
11
+ # it does. The four invented attributes are retained rather than removed, so no caller
12
+ # breaks, and are scheduled for removal in a future major; the API ignores them.
13
+ #
8
14
  # @!attribute applicant_id
15
+ # The applicant's unique identifier.
16
+ # [Required]
17
+ # ^aplt_\w+$
18
+ # @return [String]
19
+ # @!attribute user_journey_id
20
+ # Your configuration ID.
21
+ # [Optional]
22
+ # ^usj_[a-z2-7]{26}$
9
23
  # @return [String]
24
+ # @!attribute declared_data
25
+ # The personal details provided by the applicant. The ID document verification request
26
+ # takes the narrower two field IdvDeclaredData shape.
27
+ # [Optional]
28
+ # @return [CheckoutSdk::Identities::IdentityVerification::IdvDeclaredData]
10
29
  # @!attribute external_reference
30
+ # @deprecated Not declared by IddvIdDocumentVerification. Never sent by the API and
31
+ # ignored if supplied. Scheduled for removal in a future major.
11
32
  # @return [String]
12
33
  # @!attribute document_type
34
+ # @deprecated Not declared by IddvIdDocumentVerification. The document type is chosen by
35
+ # the applicant during the attempt and returned on the response, not sent on the
36
+ # request. Scheduled for removal in a future major.
13
37
  # @return [String]
14
38
  # @!attribute country
39
+ # @deprecated Not declared by IddvIdDocumentVerification. Scheduled for removal in a
40
+ # future major.
15
41
  # @return [String]
16
42
  # @!attribute redirect_url
43
+ # @deprecated Not declared by IddvIdDocumentVerification. The redirect URL belongs on the
44
+ # attempt request, not the verification. Scheduled for removal in a future major.
17
45
  # @return [String]
18
46
  class IdDocumentVerificationRequest
19
47
  attr_accessor :applicant_id,
48
+ :user_journey_id,
49
+ :declared_data,
20
50
  :external_reference,
21
51
  :document_type,
22
52
  :country,
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Shared identities types
4
+ require 'checkout_sdk/identities/idv_phone_number'
5
+ require 'checkout_sdk/identities/idv_address'
6
+ require 'checkout_sdk/identities/idv_attempts_query_filter'
7
+ require 'checkout_sdk/identities/idv_attempt_assets_query_filter'
8
+
3
9
  # Applicants
4
10
  require 'checkout_sdk/identities/applicants/create_applicant_request'
5
11
  require 'checkout_sdk/identities/applicants/update_applicant_request'
@@ -21,7 +27,9 @@ require 'checkout_sdk/identities/address_document_verification/address_document_
21
27
 
22
28
  # Identity Verification
23
29
  require 'checkout_sdk/identities/identity_verification/idv_declared_data'
30
+ require 'checkout_sdk/identities/identity_verification/idv_identity_declared_data'
24
31
  require 'checkout_sdk/identities/identity_verification/idv_client_information'
32
+ require 'checkout_sdk/identities/identity_verification/idv_identity_client_information'
25
33
  require 'checkout_sdk/identities/identity_verification/identity_verification_attempt_request'
26
34
  require 'checkout_sdk/identities/identity_verification/identity_verification_request'
27
35
  require 'checkout_sdk/identities/identity_verification/identity_verification_client'
@@ -6,11 +6,21 @@ module CheckoutSdk
6
6
  # Request body for POST /identity-verifications/{id}/attempts.
7
7
  #
8
8
  # @!attribute redirect_url
9
- # @return [String] URL to redirect the applicant after the attempt.
9
+ # The URL to redirect the applicant to after the attempt.
10
+ # [Required]
11
+ # Format: uri
12
+ # @return [String]
13
+ # @!attribute phone_number
14
+ # The applicant's mobile phone number, if sharing the attempt URL via SMS.
15
+ # [Optional]
16
+ # @return [CheckoutSdk::Identities::IdvPhoneNumber]
10
17
  # @!attribute client_information
11
- # @return [IdvClientInformation]
18
+ # The applicant's details. The identity verification attempt accepts the wider
19
+ # IdvClientInformation shape, unlike the face authentication attempt.
20
+ # [Optional]
21
+ # @return [IdvIdentityClientInformation]
12
22
  class IdentityVerificationAttemptRequest
13
- attr_accessor :redirect_url, :client_information
23
+ attr_accessor :redirect_url, :phone_number, :client_information
14
24
  end
15
25
  end
16
26
  end
@@ -55,11 +55,19 @@ module CheckoutSdk
55
55
  )
56
56
  end
57
57
 
58
+ # Get the details of all attempts for a specific identity verification.
59
+ #
60
+ # Results are paginated. Beta.
61
+ #
58
62
  # @param [String] identity_verification_id
59
- def get_identity_verification_attempts(identity_verification_id)
63
+ # @param [Hash, CheckoutSdk::Identities::IdvAttemptsQueryFilter, nil] query pagination
64
+ # query parameters; supports :skip (Integer, default: 0) and :limit (Integer, default: 10)
65
+ # @return [OpenStruct] the paginated attempt list
66
+ def get_identity_verification_attempts(identity_verification_id, query = nil)
60
67
  api_client.invoke_get(
61
68
  build_path(IDENTITY_VERIFICATIONS, identity_verification_id, ATTEMPTS),
62
- sdk_authorization
69
+ sdk_authorization,
70
+ query
63
71
  )
64
72
  end
65
73
 
@@ -84,8 +92,8 @@ module CheckoutSdk
84
92
  # identity verification attempt.
85
93
  # @param [String] identity_verification_id
86
94
  # @param [String] attempt_id
87
- # @param [Hash, nil] query pagination query parameters; supports :skip (Integer, default: 0)
88
- # and :limit (Integer, default: 10)
95
+ # @param [Hash, CheckoutSdk::Identities::IdvAttemptAssetsQueryFilter, nil] query pagination
96
+ # query parameters; supports :skip (Integer, default: 0) and :limit (Integer, default: 10)
89
97
  def get_identity_verification_attempt_assets(identity_verification_id, attempt_id, query = nil)
90
98
  api_client.invoke_get(
91
99
  build_path(IDENTITY_VERIFICATIONS, identity_verification_id, ATTEMPTS, attempt_id, ASSETS),
@@ -6,15 +6,36 @@ module CheckoutSdk
6
6
  # Request body for POST /identity-verifications and POST /create-and-open-idv.
7
7
  #
8
8
  # @!attribute applicant_id
9
- # @return [String] The applicant's unique identifier (e.g. "aplt_...").
9
+ # The applicant's unique identifier.
10
+ # [Required]
11
+ # ^aplt_\w+$
12
+ # @return [String]
10
13
  # @!attribute user_journey_id
11
- # @return [String] Your configuration ID (e.g. "usj_...").
14
+ # Your configuration ID.
15
+ # [Optional]
16
+ # ^usj_[a-z2-7]{26}$
17
+ # @return [String]
12
18
  # @!attribute declared_data
13
- # @return [IdvDeclaredData]
19
+ # The personal details provided by the applicant. The identity verification requests take
20
+ # the five field IdvIdentityDeclaredData shape.
21
+ # [Required]
22
+ # @return [IdvIdentityDeclaredData]
14
23
  # @!attribute risk_labels
24
+ # One or more codes that provide more information about risks associated with the
25
+ # verification.
26
+ #
27
+ # The request schema declares this readOnly field, so carrying it here is spec faithful.
28
+ # It cannot be sent and will be ignored by the API; read it from the response instead.
29
+ # [Optional]
15
30
  # @return [Array<String>]
31
+ # @!attribute redirect_url
32
+ # The URL to redirect the applicant to after the attempt. Accepted by
33
+ # POST /create-and-open-idv only, which opens the first attempt in the same call.
34
+ # [Optional]
35
+ # Format: uri
36
+ # @return [String]
16
37
  class IdentityVerificationRequest
17
- attr_accessor :applicant_id, :user_journey_id, :declared_data, :risk_labels
38
+ attr_accessor :applicant_id, :user_journey_id, :declared_data, :risk_labels, :redirect_url
18
39
  end
19
40
  end
20
41
  end
@@ -3,12 +3,26 @@
3
3
  module CheckoutSdk
4
4
  module Identities
5
5
  module IdentityVerification
6
- # Pre-populated client information for an identity-verification attempt.
6
+ # The applicant's details for a face authentication attempt.
7
+ #
8
+ # Maps FavClientInformation. Deliberately smaller than
9
+ # {IdvIdentityClientInformation}, which adds the two fields only the identity verification
10
+ # attempt accepts. Shared with the face authentication attempt, so do not add IDV only
11
+ # fields here.
7
12
  #
8
13
  # @!attribute pre_selected_residence_country
9
- # @return [String] ISO alpha-2 country code.
14
+ # The applicant's residence country.
15
+ # [Optional]
16
+ # Standard: ISO 3166-1 alpha-2 country code
17
+ # ^[A-Z]{2}
18
+ # Example: FR
19
+ # @return [String] a value of {CheckoutSdk::Common::Country}
10
20
  # @!attribute pre_selected_language
11
- # @return [String] IETF BCP 47 language tag.
21
+ # The language you want to use for the user interface.
22
+ # [Optional]
23
+ # Format: IETF BCP 47 language tag
24
+ # Example: en-US
25
+ # @return [String]
12
26
  class IdvClientInformation
13
27
  attr_accessor :pre_selected_residence_country, :pre_selected_language
14
28
  end
@@ -3,12 +3,25 @@
3
3
  module CheckoutSdk
4
4
  module Identities
5
5
  module IdentityVerification
6
- # The personal details provided by the applicant for an identity verification.
6
+ # The personal details provided by the applicant.
7
+ #
8
+ # Maps IdvDeclaredData, the shape the address document and ID document verification requests
9
+ # accept. The identity verification requests take the larger {IdvIdentityDeclaredData}.
7
10
  #
8
11
  # @!attribute name
9
- # @return [String] The applicant's name (max 255 characters).
12
+ # The applicant's name.
13
+ # [Required]
14
+ # min 2 characters, max 255 characters
15
+ # Example: Hannah Bret
16
+ # @return [String]
17
+ # @!attribute birth_date
18
+ # The applicant's birth date.
19
+ # [Optional]
20
+ # Format: yyyy-MM-dd
21
+ # Example: 1994-10-15
22
+ # @return [String]
10
23
  class IdvDeclaredData
11
- attr_accessor :name
24
+ attr_accessor :name, :birth_date
12
25
  end
13
26
  end
14
27
  end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Identities
5
+ module IdentityVerification
6
+ # The applicant's details for an identity verification attempt.
7
+ #
8
+ # Maps IdvClientInformation, a strict superset of FavClientInformation, so it inherits from
9
+ # {IdvClientInformation}. The face authentication attempt must keep using the parent: its
10
+ # schema declares neither document field, so sending them there would be a request the API
11
+ # rejects.
12
+ #
13
+ # @!attribute pre_selected_document_issuing_country
14
+ # The country that issued the applicant's identity document.
15
+ # [Optional]
16
+ # Standard: ISO 3166-1 alpha-2 country code
17
+ # ^[A-Z]{2}
18
+ # Example: FR
19
+ # @return [String] a value of {CheckoutSdk::Common::Country}
20
+ # @!attribute pre_selected_document_type
21
+ # The type of identity document the applicant uses for the attempt.
22
+ # [Optional]
23
+ # Enum: "Driving licence" "ID" "Other" "Passport" "Residence Permit" "Travel Document" "Visa"
24
+ # @return [String]
25
+ class IdvIdentityClientInformation < IdvClientInformation
26
+ attr_accessor :pre_selected_document_issuing_country, :pre_selected_document_type
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Identities
5
+ module IdentityVerification
6
+ # The personal details provided by the applicant for an identity verification.
7
+ #
8
+ # Maps IdvIdentityDeclaredData, a strict superset of IdvDeclaredData, so it inherits from it.
9
+ # The address document and ID document verification requests take the smaller
10
+ # {IdvDeclaredData} shape instead: sending these three extra fields there would be a request
11
+ # the API rejects.
12
+ #
13
+ # @!attribute phone_number
14
+ # The applicant's mobile phone number, if sharing the attempt URL via SMS.
15
+ # [Optional]
16
+ # @return [CheckoutSdk::Identities::IdvPhoneNumber]
17
+ # @!attribute email
18
+ # The applicant's email address. Explicitly nullable in the spec, so the API may return
19
+ # null for it rather than omitting it.
20
+ # [Optional]
21
+ # Format: email
22
+ # Nullable: true
23
+ # Example: hannah.bret@example.com
24
+ # @return [String]
25
+ # @!attribute address
26
+ # The applicant's address.
27
+ # [Optional]
28
+ # @return [CheckoutSdk::Identities::IdvAddress]
29
+ class IdvIdentityDeclaredData < IdvDeclaredData
30
+ attr_accessor :phone_number, :email, :address
31
+ end
32
+ end
33
+ end
34
+ end