From 51ffc3f09421d1a936a222bc511d0df37888a231 Mon Sep 17 00:00:00 2001 From: david ruiz Date: Mon, 22 Jun 2026 11:42:04 +0200 Subject: [PATCH 1/4] GetFaceAuthenticationAttemptAssets + PaymentPlan updates --- .../face_authentication_client.rb | 15 ++++++++++++++- .../identity_verification_client.rb | 16 +++++++++++++++- .../payments/hosted/hosted_payments_session.rb | 9 ++++++++- lib/checkout_sdk/payments/links/payment_link.rb | 9 ++++++++- lib/checkout_sdk/payments/processing_settings.rb | 5 ++++- .../sessions/payment_sessions_request.rb | 9 ++++++++- .../face_authentication_client_spec.rb | 15 +++++++++++++++ .../face_authentication_integration_spec.rb | 9 +++++++++ .../identity_verification_client_spec.rb | 15 +++++++++++++++ .../identity_verification_integration_spec.rb | 9 +++++++++ 10 files changed, 105 insertions(+), 6 deletions(-) diff --git a/lib/checkout_sdk/identities/face_authentication/face_authentication_client.rb b/lib/checkout_sdk/identities/face_authentication/face_authentication_client.rb index a64d657..05d17fb 100644 --- a/lib/checkout_sdk/identities/face_authentication/face_authentication_client.rb +++ b/lib/checkout_sdk/identities/face_authentication/face_authentication_client.rb @@ -8,7 +8,8 @@ class FaceAuthenticationClient < Client FACE_AUTHENTICATIONS = 'face-authentications' ANONYMIZE = 'anonymize' ATTEMPTS = 'attempts' - private_constant :FACE_AUTHENTICATIONS, :ANONYMIZE, :ATTEMPTS + ASSETS = 'assets' + private_constant :FACE_AUTHENTICATIONS, :ANONYMIZE, :ATTEMPTS, :ASSETS # @param [ApiClient] api_client # @param [CheckoutConfiguration] configuration @@ -62,6 +63,18 @@ def get_face_authentication_attempt(face_authentication_id, attempt_id) sdk_authorization ) end + + # Retrieve the assets (face images and videos) captured during a face authentication attempt. + # @param [String] face_authentication_id + # @param [String] attempt_id + # @param [Hash] query the pagination query parameters (skip and limit) + def get_face_authentication_attempt_assets(face_authentication_id, attempt_id, query = nil) + api_client.invoke_get( + build_path(FACE_AUTHENTICATIONS, face_authentication_id, ATTEMPTS, attempt_id, ASSETS), + sdk_authorization, + query + ) + end end end end diff --git a/lib/checkout_sdk/identities/identity_verification/identity_verification_client.rb b/lib/checkout_sdk/identities/identity_verification/identity_verification_client.rb index 291d8ef..b137f15 100644 --- a/lib/checkout_sdk/identities/identity_verification/identity_verification_client.rb +++ b/lib/checkout_sdk/identities/identity_verification/identity_verification_client.rb @@ -10,7 +10,8 @@ class IdentityVerificationClient < Client ANONYMIZE = 'anonymize' ATTEMPTS = 'attempts' PDF_REPORT = 'pdf-report' - private_constant :IDENTITY_VERIFICATIONS, :CREATE_AND_OPEN_IDV, :ANONYMIZE, :ATTEMPTS, :PDF_REPORT + ASSETS = 'assets' + private_constant :IDENTITY_VERIFICATIONS, :CREATE_AND_OPEN_IDV, :ANONYMIZE, :ATTEMPTS, :PDF_REPORT, :ASSETS # @param [ApiClient] api_client # @param [CheckoutConfiguration] configuration @@ -78,6 +79,19 @@ def get_identity_verification_pdf_report(identity_verification_id) sdk_authorization ) end + + # Retrieve the assets (face images, videos, and document images) captured during an + # identity verification attempt. + # @param [String] identity_verification_id + # @param [String] attempt_id + # @param [Hash] query the pagination query parameters (skip and limit) + def get_identity_verification_attempt_assets(identity_verification_id, attempt_id, query = nil) + api_client.invoke_get( + build_path(IDENTITY_VERIFICATIONS, identity_verification_id, ATTEMPTS, attempt_id, ASSETS), + sdk_authorization, + query + ) + end end end end diff --git a/lib/checkout_sdk/payments/hosted/hosted_payments_session.rb b/lib/checkout_sdk/payments/hosted/hosted_payments_session.rb index 29f1b0b..f319295 100644 --- a/lib/checkout_sdk/payments/hosted/hosted_payments_session.rb +++ b/lib/checkout_sdk/payments/hosted/hosted_payments_session.rb @@ -66,6 +66,11 @@ module Payments # @return [HostedPaymentInstruction] # @!attribute payment_method_configuration # @return [PaymentMethodConfiguration] + # @!attribute payment_plan + # @return [PaymentPlan] [Optional] The information to process a recurring payment request. + # To be used when the payment_type is Recurring. + # @!attribute authorization_type + # @return [String] [Optional] {AuthorizationType} Enum: "Final" "Estimated". Default: "Final". class HostedPaymentsSession attr_accessor :currency, :billing, @@ -97,7 +102,9 @@ class HostedPaymentsSession :capture, :capture_on, :instruction, - :payment_method_configuration + :payment_method_configuration, + :payment_plan, + :authorization_type def initialize(payment_type: CheckoutSdk::Payments::PaymentType::REGULAR) @payment_type = payment_type diff --git a/lib/checkout_sdk/payments/links/payment_link.rb b/lib/checkout_sdk/payments/links/payment_link.rb index ef39c6e..3679a28 100644 --- a/lib/checkout_sdk/payments/links/payment_link.rb +++ b/lib/checkout_sdk/payments/links/payment_link.rb @@ -60,6 +60,11 @@ module Payments # @return [TrueClass, FalseClass] # @!attribute capture_on # @return [Time] + # @!attribute payment_plan + # @return [PaymentPlan] [Optional] The information to process a recurring payment request. + # To be used when the payment_type is Recurring. + # @!attribute authorization_type + # @return [String] [Optional] {AuthorizationType} Enum: "Final" "Estimated". Default: "Final". class PaymentLink attr_accessor :amount, :currency, @@ -88,7 +93,9 @@ class PaymentLink :return_url, :locale, :capture, - :capture_on + :capture_on, + :payment_plan, + :authorization_type def initialize(payment_type: CheckoutSdk::Payments::PaymentType::REGULAR) @payment_type = payment_type diff --git a/lib/checkout_sdk/payments/processing_settings.rb b/lib/checkout_sdk/payments/processing_settings.rb index e9d6369..35cef51 100644 --- a/lib/checkout_sdk/payments/processing_settings.rb +++ b/lib/checkout_sdk/payments/processing_settings.rb @@ -75,6 +75,8 @@ module Payments # @!attribute partner_code # @return [String] The customer's 6-digit BLIK code. Required when source.type is "blik" # and merchant_initiated is false. Pattern: ^\d{6}$ + # @!attribute scheme_transaction_link_id + # @return [String] [Optional] The scheme transaction link identifier. class ProcessingSettings attr_accessor :order_id, :tax_amount, @@ -111,7 +113,8 @@ class ProcessingSettings :purpose, :affiliate_id, :affiliate_url, - :partner_code + :partner_code, + :scheme_transaction_link_id end end end diff --git a/lib/checkout_sdk/payments/sessions/payment_sessions_request.rb b/lib/checkout_sdk/payments/sessions/payment_sessions_request.rb index a73b07e..fa1ac45 100644 --- a/lib/checkout_sdk/payments/sessions/payment_sessions_request.rb +++ b/lib/checkout_sdk/payments/sessions/payment_sessions_request.rb @@ -64,6 +64,11 @@ module Payments # @return [Time] # @!attribute tax_amount # @return [Integer] + # @!attribute authorization_type + # @return [String] [Optional] {AuthorizationType} Enum: "Final" "Estimated". Default: "Final". + # @!attribute payment_plan + # @return [PaymentPlan] [Optional] The information to process a recurring payment request. + # To be used when the payment_type is Recurring. class PaymentSessionsRequest attr_accessor :amount, :currency, @@ -95,7 +100,9 @@ class PaymentSessionsRequest :capture, :ip_address, :capture_on, - :tax_amount + :tax_amount, + :authorization_type, + :payment_plan end end end diff --git a/spec/checkout_sdk/identities/face_authentication/face_authentication_client_spec.rb b/spec/checkout_sdk/identities/face_authentication/face_authentication_client_spec.rb index 69b7511..f2c75d4 100644 --- a/spec/checkout_sdk/identities/face_authentication/face_authentication_client_spec.rb +++ b/spec/checkout_sdk/identities/face_authentication/face_authentication_client_spec.rb @@ -56,4 +56,19 @@ expect(client.get_face_authentication_attempt('fa_x', 'att_1')).to eq('response') end end + + describe '#get_face_authentication_attempt_assets' do + it 'GETs face-authentications/{id}/attempts/{attempt_id}/assets with query params' do + query = { skip: 0, limit: 10 } + expect(api_client_mock).to receive(:invoke_get) + .with('face-authentications/fa_x/attempts/att_1/assets', 'secret_key', query).and_return('response') + expect(client.get_face_authentication_attempt_assets('fa_x', 'att_1', query)).to eq('response') + end + + it 'GETs the assets path with no query params' do + expect(api_client_mock).to receive(:invoke_get) + .with('face-authentications/fa_x/attempts/att_1/assets', 'secret_key', nil).and_return('response') + expect(client.get_face_authentication_attempt_assets('fa_x', 'att_1')).to eq('response') + end + end end diff --git a/spec/checkout_sdk/identities/face_authentication/face_authentication_integration_spec.rb b/spec/checkout_sdk/identities/face_authentication/face_authentication_integration_spec.rb index 6a17536..c13d7d5 100644 --- a/spec/checkout_sdk/identities/face_authentication/face_authentication_integration_spec.rb +++ b/spec/checkout_sdk/identities/face_authentication/face_authentication_integration_spec.rb @@ -37,5 +37,14 @@ expect(response).not_to be_nil end end + + describe '#get_face_authentication_attempt_assets' do + it 'retrieves the assets captured during a face authentication attempt' do + response = client.get_face_authentication_attempt_assets( + ENV['CHECKOUT_FACE_AUTH_ID'], ENV['CHECKOUT_FACE_AUTH_ATTEMPT_ID'], { skip: 0, limit: 10 } + ) + expect(response).not_to be_nil + end + end end end diff --git a/spec/checkout_sdk/identities/identity_verification/identity_verification_client_spec.rb b/spec/checkout_sdk/identities/identity_verification/identity_verification_client_spec.rb index fcbb1b5..c4cd7f5 100644 --- a/spec/checkout_sdk/identities/identity_verification/identity_verification_client_spec.rb +++ b/spec/checkout_sdk/identities/identity_verification/identity_verification_client_spec.rb @@ -80,4 +80,19 @@ expect(client.get_identity_verification_pdf_report('idv_x')).to eq('response') end end + + describe '#get_identity_verification_attempt_assets' do + it 'GETs identity-verifications/{id}/attempts/{attempt_id}/assets with query params' do + query = { skip: 0, limit: 10 } + expect(api_client_mock).to receive(:invoke_get) + .with('identity-verifications/idv_x/attempts/att_1/assets', 'secret_key', query).and_return('response') + expect(client.get_identity_verification_attempt_assets('idv_x', 'att_1', query)).to eq('response') + end + + it 'GETs the assets path with no query params' do + expect(api_client_mock).to receive(:invoke_get) + .with('identity-verifications/idv_x/attempts/att_1/assets', 'secret_key', nil).and_return('response') + expect(client.get_identity_verification_attempt_assets('idv_x', 'att_1')).to eq('response') + end + end end diff --git a/spec/checkout_sdk/identities/identity_verification/identity_verification_integration_spec.rb b/spec/checkout_sdk/identities/identity_verification/identity_verification_integration_spec.rb index 2284a8f..1b364a4 100644 --- a/spec/checkout_sdk/identities/identity_verification/identity_verification_integration_spec.rb +++ b/spec/checkout_sdk/identities/identity_verification/identity_verification_integration_spec.rb @@ -60,5 +60,14 @@ expect(response).not_to be_nil end end + + describe '#get_identity_verification_attempt_assets' do + it 'retrieves the assets captured during an identity verification attempt' do + response = client.get_identity_verification_attempt_assets( + ENV['CHECKOUT_IDENTITY_VERIFICATION_ID'], ENV['CHECKOUT_IDENTITY_VERIFICATION_ATTEMPT_ID'], { skip: 0, limit: 10 } + ) + expect(response).not_to be_nil + end + end end end From dd315a559f82d0ec863592c55a1d79e65f5b08eb Mon Sep 17 00:00:00 2001 From: david ruiz Date: Tue, 23 Jun 2026 11:43:02 +0200 Subject: [PATCH 2/4] Review changes --- .../face_authentication/face_authentication_client.rb | 2 +- .../identity_verification/identity_verification_client.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/checkout_sdk/identities/face_authentication/face_authentication_client.rb b/lib/checkout_sdk/identities/face_authentication/face_authentication_client.rb index 05d17fb..518fba9 100644 --- a/lib/checkout_sdk/identities/face_authentication/face_authentication_client.rb +++ b/lib/checkout_sdk/identities/face_authentication/face_authentication_client.rb @@ -67,7 +67,7 @@ def get_face_authentication_attempt(face_authentication_id, attempt_id) # Retrieve the assets (face images and videos) captured during a face authentication attempt. # @param [String] face_authentication_id # @param [String] attempt_id - # @param [Hash] query the pagination query parameters (skip and limit) + # @param [Hash, nil] query pagination query parameters; supports :skip (Integer, default: 0) and :limit (Integer, default: 10) def get_face_authentication_attempt_assets(face_authentication_id, attempt_id, query = nil) api_client.invoke_get( build_path(FACE_AUTHENTICATIONS, face_authentication_id, ATTEMPTS, attempt_id, ASSETS), diff --git a/lib/checkout_sdk/identities/identity_verification/identity_verification_client.rb b/lib/checkout_sdk/identities/identity_verification/identity_verification_client.rb index b137f15..4cd21c8 100644 --- a/lib/checkout_sdk/identities/identity_verification/identity_verification_client.rb +++ b/lib/checkout_sdk/identities/identity_verification/identity_verification_client.rb @@ -84,7 +84,7 @@ def get_identity_verification_pdf_report(identity_verification_id) # identity verification attempt. # @param [String] identity_verification_id # @param [String] attempt_id - # @param [Hash] query the pagination query parameters (skip and limit) + # @param [Hash, nil] query pagination query parameters; supports :skip (Integer, default: 0) and :limit (Integer, default: 10) def get_identity_verification_attempt_assets(identity_verification_id, attempt_id, query = nil) api_client.invoke_get( build_path(IDENTITY_VERIFICATIONS, identity_verification_id, ATTEMPTS, attempt_id, ASSETS), From 34331ef1c89788e74c34469a1670449c2e38d276 Mon Sep 17 00:00:00 2001 From: david ruiz Date: Tue, 23 Jun 2026 11:53:21 +0200 Subject: [PATCH 3/4] Rubocop fix (120 lines) --- .../face_authentication/face_authentication_client.rb | 3 ++- .../identity_verification/identity_verification_client.rb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/checkout_sdk/identities/face_authentication/face_authentication_client.rb b/lib/checkout_sdk/identities/face_authentication/face_authentication_client.rb index 518fba9..3fc8612 100644 --- a/lib/checkout_sdk/identities/face_authentication/face_authentication_client.rb +++ b/lib/checkout_sdk/identities/face_authentication/face_authentication_client.rb @@ -67,7 +67,8 @@ def get_face_authentication_attempt(face_authentication_id, attempt_id) # Retrieve the assets (face images and videos) captured during a face authentication attempt. # @param [String] face_authentication_id # @param [String] attempt_id - # @param [Hash, nil] query pagination query parameters; supports :skip (Integer, default: 0) and :limit (Integer, default: 10) + # @param [Hash, nil] query pagination query parameters; supports :skip (Integer, default: 0) + # and :limit (Integer, default: 10) def get_face_authentication_attempt_assets(face_authentication_id, attempt_id, query = nil) api_client.invoke_get( build_path(FACE_AUTHENTICATIONS, face_authentication_id, ATTEMPTS, attempt_id, ASSETS), diff --git a/lib/checkout_sdk/identities/identity_verification/identity_verification_client.rb b/lib/checkout_sdk/identities/identity_verification/identity_verification_client.rb index 4cd21c8..6adf66e 100644 --- a/lib/checkout_sdk/identities/identity_verification/identity_verification_client.rb +++ b/lib/checkout_sdk/identities/identity_verification/identity_verification_client.rb @@ -84,7 +84,8 @@ def get_identity_verification_pdf_report(identity_verification_id) # identity verification attempt. # @param [String] identity_verification_id # @param [String] attempt_id - # @param [Hash, nil] query pagination query parameters; supports :skip (Integer, default: 0) and :limit (Integer, default: 10) + # @param [Hash, nil] query pagination query parameters; supports :skip (Integer, default: 0) + # and :limit (Integer, default: 10) def get_identity_verification_attempt_assets(identity_verification_id, attempt_id, query = nil) api_client.invoke_get( build_path(IDENTITY_VERIFICATIONS, identity_verification_id, ATTEMPTS, attempt_id, ASSETS), From a40e0a3a983c03efa69c3666b14d38ea9f519136 Mon Sep 17 00:00:00 2001 From: david ruiz Date: Tue, 23 Jun 2026 12:03:49 +0200 Subject: [PATCH 4/4] RSpec fix --- .../payments/contexts/contexts_integration_spec.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spec/checkout_sdk/payments/contexts/contexts_integration_spec.rb b/spec/checkout_sdk/payments/contexts/contexts_integration_spec.rb index 64822cb..74767f9 100644 --- a/spec/checkout_sdk/payments/contexts/contexts_integration_spec.rb +++ b/spec/checkout_sdk/payments/contexts/contexts_integration_spec.rb @@ -4,8 +4,13 @@ include ContextsHelper before(:all) do - @payment_context_paypal = create_payment_contexts_paypal - @payment_context_klarna = create_payment_contexts_klarna + begin + @payment_context_paypal = create_payment_contexts_paypal + @payment_context_klarna = create_payment_contexts_klarna + rescue CheckoutSdk::CheckoutApiException => e + skip 'PayPal/Klarna APM service unavailable in sandbox' if e.message.include?('apm_service_unavailable') + raise + end end describe '.create_payment_contexts' do