Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -62,6 +63,19 @@ 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, 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),
sdk_authorization,
query
)
end
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -78,6 +79,20 @@ 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, 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),
sdk_authorization,
query
)
end
end
end
end
Expand Down
9 changes: 8 additions & 1 deletion lib/checkout_sdk/payments/hosted/hosted_payments_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion lib/checkout_sdk/payments/links/payment_link.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion lib/checkout_sdk/payments/processing_settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -111,7 +113,8 @@ class ProcessingSettings
:purpose,
:affiliate_id,
:affiliate_url,
:partner_code
:partner_code,
:scheme_transaction_link_id
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -95,7 +100,9 @@ class PaymentSessionsRequest
:capture,
:ip_address,
:capture_on,
:tax_amount
:tax_amount,
:authorization_type,
:payment_plan
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading