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
2 changes: 1 addition & 1 deletion lib/checkout_sdk/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module CheckoutSdk
VERSION = '2.3.0'
VERSION = '2.4.0'
end
12 changes: 9 additions & 3 deletions spec/checkout_sdk/accounts/accounts_integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
describe 'when sub entity operations (Accounts API schema_version 3.0)' do
# v3.0 onboards a sub-entity as a company whose single representative carries a nested individual
# + roles. Uses the accounts-scoped OAuth client (provisioned for v3.0) and the SDK default (3.0).
# Profile currencies use the platform scope (USD) while processing_details reflects the region (GBP).
# Every currency on the request has to sit inside the platform's currency scope, which is USD
# only. See build_onboard_entity_v3 for why processing_details cannot be regional.
it 'creates and retrieves a v3.0 company sub-entity' do
request = build_entity_v3(SecureRandom.uuid)

Expand Down Expand Up @@ -262,7 +263,12 @@ def build_entity_v3(reference = nil)
contact_details.phone = phone
contact_details.email_addresses = email_addresses

# Profile currencies are validated against the platform scope (USD); processing currency is regional (GBP).
# Every currency here has to sit inside the platform's currency scope, which is USD only. The
# processing currency was previously GBP, on the theory that the profile reflects the platform
# while processing details reflect the sub-entity region. The API rejects that with
# processing_details_currency_invalid_for_currency_scope, and widening the profile to GBP is also
# rejected because the scope itself does not permit GBP. The GB settlement_country and addresses
# are unaffected and still accepted.
profile = CheckoutSdk::Accounts::Profile.new
profile.urls = ['https://www.superheroexample.com']
profile.mccs = ['0742']
Expand Down Expand Up @@ -322,7 +328,7 @@ def build_entity_v3(reference = nil)
processing_details.average_transaction_value = 5_000
processing_details.average_order_fulfillment_time = 3
processing_details.highest_transaction_value = 25_000
processing_details.currency = CheckoutSdk::Common::Currency::GBP
processing_details.currency = CheckoutSdk::Common::Currency::USD
processing_details.settlement_country = 'GB'
processing_details.target_countries = ['GB']
processing_details.payments = payments
Expand Down
Loading