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
1 change: 1 addition & 0 deletions lib/checkout_sdk/accounts/accounts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
require 'checkout_sdk/accounts/instrument_details_faster_payments'
require 'checkout_sdk/accounts/instrument_details_sepa'
require 'checkout_sdk/accounts/instrument_details_card_token'
require 'checkout_sdk/accounts/instrument_details_ach'
require 'checkout_sdk/accounts/payment_instrument_request'
require 'checkout_sdk/accounts/payment_instruments_query'
require 'checkout_sdk/accounts/update_payment_instrument_request'
Expand Down
21 changes: 21 additions & 0 deletions lib/checkout_sdk/accounts/instrument_details_ach.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

module CheckoutSdk
module Accounts
# ACH bank-account instrument details. Maps swagger `PlatformsInstrumentDetailsAch`.
# All three attributes are required.
#
# @!attribute account_number
# @return [String] The alphanumeric value that identifies the account.
# @!attribute routing_number
# @return [String] The 9-digit American Bankers Association (ABA) routing number that
# identifies the financial institution.
# @!attribute account_type
# @return [String] The type of bank account. One of `savings`, `checking`.
class InstrumentDetailsAch < InstrumentDetails
attr_accessor :account_number,
:routing_number,
:account_type
end
end
end
31 changes: 31 additions & 0 deletions lib/checkout_sdk/issuing/amend_dispute_request.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# frozen_string_literal: true

module CheckoutSdk
module Issuing
# Request body for POST /issuing/disputes/{disputeId}/amend.
# Submit an amendment to a dispute that is currently blocked from proceeding. Maps swagger
# `amend-dispute-request`. All fields are optional.
#
# @!attribute reason
# @return [String] The updated four-digit scheme-specific reason code. If not provided, the
# existing reason code is retained.
# @!attribute amount
# @return [Numeric] The updated disputed amount, in the minor unit of the transaction currency.
# If not provided, the existing amount is retained.
# @!attribute evidence
# @return [Array<Hash>] Evidence supporting the dispute (maps `IssuingDisputeEvidence`).
# @!attribute fraud_details
# @return [IssuingDisputeFraudDetails] Fraud-related details. Required if `reason` specifies a
# fraud-related dispute.
# @!attribute reason_change_justification
# @return [String] Justification for changing the reason at the escalation stage. Max 13000
# characters.
# @!attribute action_response
# @return [String] Free-form text explaining your choices or asking questions about the
# requested changes. Max 1000 characters.
class AmendDisputeRequest
attr_accessor :reason, :amount, :evidence, :fraud_details,
:reason_change_justification, :action_response
end
end
end
5 changes: 4 additions & 1 deletion lib/checkout_sdk/issuing/create_dispute_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ module Issuing
# @return [Numeric]
# @!attribute presentment_message_id
# @return [String]
# @!attribute fraud_details
# @return [IssuingDisputeFraudDetails] Fraud-related information to send with the chargeback.
# Required if the dispute has a fraud-related reason code.
# @!attribute justification
# @return [String]
class CreateDisputeRequest
attr_accessor :transaction_id, :reason, :evidence, :amount,
:presentment_message_id, :justification
:presentment_message_id, :fraud_details, :justification
end
end
end
6 changes: 5 additions & 1 deletion lib/checkout_sdk/issuing/escalate_dispute_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ module Issuing
# @return [Numeric]
# @!attribute reason_change
# @return [String]
# @!attribute fraud_details
# @return [IssuingDisputeFraudDetails] Fraud-related details. Required if the dispute has a
# fraud-related reason code at the escalation stage, or after a reason-code change to a
# fraud code.
# @!attribute justification
# @return [String] Required.
class EscalateDisputeRequest
attr_accessor :additional_evidence, :amount, :reason_change, :justification
attr_accessor :additional_evidence, :amount, :reason_change, :fraud_details, :justification
end
end
end
18 changes: 0 additions & 18 deletions lib/checkout_sdk/issuing/identification_document.rb

This file was deleted.

6 changes: 4 additions & 2 deletions lib/checkout_sdk/issuing/issuing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
# Cardholders / Cards updates
require 'checkout_sdk/issuing/issuing_phone_number'
require 'checkout_sdk/issuing/issuing_address'
require 'checkout_sdk/issuing/identification_document'
require 'checkout_sdk/issuing/update_cardholder_request'
require 'checkout_sdk/issuing/update_card_request'
require 'checkout_sdk/issuing/schedule_revocation_request'

# Simulations
require 'checkout_sdk/issuing/simulate_refund_request'
Expand All @@ -22,7 +20,11 @@
require 'checkout_sdk/issuing/update_control_profile_request'

# Disputes
require 'checkout_sdk/issuing/issuing_dispute_fraud_type'
require 'checkout_sdk/issuing/issuing_dispute_fraud_details'
require 'checkout_sdk/issuing/create_dispute_request'
require 'checkout_sdk/issuing/escalate_dispute_request'
require 'checkout_sdk/issuing/amend_dispute_request'
require 'checkout_sdk/issuing/submit_dispute_request'

require 'checkout_sdk/issuing/issuing_client'
51 changes: 29 additions & 22 deletions lib/checkout_sdk/issuing/issuing_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ class IssuingClient < Client
REVERSALS = 'reversals'
REFUNDS = 'refunds'
RENEW = 'renew'
SCHEDULE_REVOCATION = 'schedule-revocation'
DISPUTES = 'disputes'
CANCEL = 'cancel'
ESCALATE = 'escalate'
AMEND = 'amend'
SUBMIT = 'submit'
TRANSACTIONS = 'transactions'
DIGITAL_CARDS = 'digital-cards'
ADD = 'add'
Expand All @@ -36,7 +37,7 @@ class IssuingClient < Client
private_constant :ISSUING, :CARDHOLDERS, :CARDS, :THREE_DS, :ACTIVATE, :CREDENTIALS,
:REVOKE, :SUSPEND, :CONTROLS, :CONTROL_GROUPS, :CONTROL_PROFILES,
:SIMULATE, :AUTHORIZATIONS, :PRESENTMENTS, :REVERSALS, :REFUNDS,
:RENEW, :SCHEDULE_REVOCATION, :DISPUTES, :CANCEL, :ESCALATE,
:RENEW, :DISPUTES, :CANCEL, :ESCALATE, :AMEND, :SUBMIT,
:TRANSACTIONS, :DIGITAL_CARDS, :ADD, :REMOVE

# @param [ApiClient] api_client
Expand Down Expand Up @@ -145,26 +146,6 @@ def renew_card(card_id, renew_request = nil)
)
end

# Schedule a card revocation. POST /issuing/cards/{cardId}/schedule-revocation.
# @param [String] card_id
# @param [Hash, ScheduleRevocationRequest] schedule_revocation_request
def schedule_card_revocation(card_id, schedule_revocation_request)
api_client.invoke_post(
build_path(ISSUING, CARDS, card_id, SCHEDULE_REVOCATION),
sdk_authorization,
schedule_revocation_request
)
end

# Cancel a scheduled card revocation. DELETE /issuing/cards/{cardId}/schedule-revocation.
# @param [String] card_id
def cancel_scheduled_card_revocation(card_id)
api_client.invoke_delete(
build_path(ISSUING, CARDS, card_id, SCHEDULE_REVOCATION),
sdk_authorization
)
end

# ====== Controls (legacy single endpoint) ======

# @param [Hash] control_request
Expand Down Expand Up @@ -317,6 +298,32 @@ def escalate_issuing_dispute(dispute_id, escalate_dispute_request)
)
end

# Submit an Issuing dispute. POST /issuing/disputes/{disputeId}/submit.
# @param [String] dispute_id
# @param [Hash, SubmitDisputeRequest] submit_dispute_request
# @deprecated Use {#create_issuing_dispute} to create and submit a dispute in one step, or
# {#amend_issuing_dispute} when the dispute status is `action_required`.
def submit_issuing_dispute(dispute_id, submit_dispute_request = nil)
api_client.invoke_post(
build_path(ISSUING, DISPUTES, dispute_id, SUBMIT),
sdk_authorization,
submit_dispute_request
)
end

# Amend an Issuing dispute. POST /issuing/disputes/{disputeId}/amend.
# Submit an amendment to a dispute that is currently blocked from proceeding. Handles both
# chargeback-stage and escalation-stage amendments using the same payload.
# @param [String] dispute_id
# @param [Hash, AmendDisputeRequest] amend_dispute_request
def amend_issuing_dispute(dispute_id, amend_dispute_request = nil)
api_client.invoke_post(
build_path(ISSUING, DISPUTES, dispute_id, AMEND),
sdk_authorization,
amend_dispute_request
)
end

# ====== Transactions ======

# @param [Hash] transactions_query
Expand Down
18 changes: 18 additions & 0 deletions lib/checkout_sdk/issuing/issuing_dispute_fraud_details.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# frozen_string_literal: true

module CheckoutSdk
module Issuing
# Fraud-related information required when the dispute reason code is fraud-related.
# Maps swagger `IssuingDisputeFraudDetails`. Reused by create, escalate and amend dispute
# requests.
#
# @!attribute fraud_type
# @return [String] {IssuingDisputeFraudType} The type of fraud the cardholder is asserting.
# [Required]
# @!attribute description
# @return [String] Optional free-form description of the fraud.
class IssuingDisputeFraudDetails
attr_accessor :fraud_type, :description
end
end
end
21 changes: 21 additions & 0 deletions lib/checkout_sdk/issuing/issuing_dispute_fraud_type.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

module CheckoutSdk
module Issuing
# The type of fraud the cardholder is asserting on an Issuing dispute.
# Maps swagger `IssuingDisputeFraudDetails.fraud_type`.
module IssuingDisputeFraudType
CARD_LOST = 'card_lost'
CARD_STOLEN = 'card_stolen'
CARD_NEVER_RECEIVED = 'card_never_received'
FRAUDULENT_ACCOUNT = 'fraudulent_account'
COUNTERFEIT_CARD = 'counterfeit_card'
ACCOUNT_TAKEOVER = 'account_takeover'
CARD_NOT_PRESENT_FRAUD = 'card_not_present_fraud'
MERCHANT_MISREPRESENTATION = 'merchant_misrepresentation'
CARDHOLDER_MANIPULATION = 'cardholder_manipulation'
INCORRECT_PROCESSING = 'incorrect_processing'
OTHER = 'other'
end
end
end
13 changes: 0 additions & 13 deletions lib/checkout_sdk/issuing/schedule_revocation_request.rb

This file was deleted.

21 changes: 21 additions & 0 deletions lib/checkout_sdk/issuing/submit_dispute_request.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

module CheckoutSdk
module Issuing
# Request body for POST /issuing/disputes/{disputeId}/submit. Maps swagger
# `submit-dispute-request`. All fields are optional.
#
# @!attribute reason
# @return [String] The updated four-digit scheme-specific reason code. If not provided, the
# existing reason code is used.
# @!attribute evidence
# @return [Array<Hash>] Evidence for the chargeback, if updated since you created the dispute
# (maps `IssuingDisputeEvidence`).
# @!attribute amount
# @return [Numeric] The updated disputed amount, in the minor unit of the transaction currency.
# If not provided, the existing disputed amount is used.
class SubmitDisputeRequest
attr_accessor :reason, :evidence, :amount
end
end
end
10 changes: 9 additions & 1 deletion lib/checkout_sdk/issuing/update_card_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,16 @@ module Issuing
# @return [Integer]
# @!attribute expiry_year
# @return [Integer]
# @!attribute activation_date
# @return [String] ISO-8601 date scheduling the card's activation. Supported formats:
# date only `yyyy-mm-dd` (treated as midnight UTC) or date with round hour
# `yyyy-mm-ddTHH:mmZ` / `yyyy-mm-ddTHH:mm±HH:mm`. Maps swagger `IssuingActivationDate`.
# @!attribute revocation_date
# @return [String] Date for the card to be automatically revoked, in the form `yyyy-mm-dd`.
# Must be after the current date. Maps swagger `IssuingRevocationDate`.
class UpdateCardRequest
attr_accessor :reference, :metadata, :expiry_month, :expiry_year
attr_accessor :reference, :metadata, :expiry_month, :expiry_year,
:activation_date, :revocation_date
end
end
end
5 changes: 1 addition & 4 deletions lib/checkout_sdk/issuing/update_cardholder_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,9 @@ module Issuing
# @return [IssuingAddress]
# @!attribute residency_address
# @return [IssuingAddress]
# @!attribute document
# @return [IdentificationDocument]
class UpdateCardholderRequest
attr_accessor :first_name, :middle_name, :last_name, :date_of_birth,
:phone_number, :email, :billing_address, :residency_address,
:document
:phone_number, :email, :billing_address, :residency_address
end
end
end
4 changes: 4 additions & 0 deletions lib/checkout_sdk/payments/payments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@
require 'checkout_sdk/payments/setups/account_funding_transaction_recipient'
require 'checkout_sdk/payments/setups/payment_setup_account_funding_transaction'
require 'checkout_sdk/payments/setups/blik_payment_method'
require 'checkout_sdk/payments/setups/bacs_payment_method'
require 'checkout_sdk/payments/setups/card_present_payment_method'
require 'checkout_sdk/payments/setups/pay_by_bank_payment_method'
require 'checkout_sdk/payments/setups/stablecoin_payment_method'
require 'checkout_sdk/payments/setups/payment_setups_client'

# Payment Flow
Expand Down
41 changes: 41 additions & 0 deletions lib/checkout_sdk/payments/setups/bacs_payment_method.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# frozen_string_literal: true

module CheckoutSdk
module Payments
# Bacs payment method configuration on a Payment Setup. Maps swagger `Bacs`.
#
# @!attribute status
# @return [String] (response-only) Payment method status.
# @!attribute flags
# @return [Array(String)] (response-only) Diagnostic flags returned by the API.
# @!attribute initialization
# @return [String] The initialization type for the payment method.
# @!attribute instrument_id
# @return [String] (response-only) The ID of the Bacs instrument used for the payment.
# @!attribute account_holder
# @return [Hash] The account holder details (`type`, `first_name`, `last_name`,
# `company_name`, `email`).
# @!attribute account_number
# @return [String] The account number of the Bacs Direct Debit account.
# @!attribute bank_code
# @return [String] The bank code (sort code) of the Bacs Direct Debit account.
# @!attribute country
# @return [String] {CheckoutSdk::Common::Country}
# @!attribute currency
# @return [String] {CheckoutSdk::Common::Currency}
# @!attribute allow_partial_match
# @return [TrueClass, FalseClass] Whether to allow a partial match of the account holder details.
class BacsPaymentMethod
attr_accessor :status,
:flags,
:initialization,
:instrument_id,
:account_holder,
:account_number,
:bank_code,
:country,
:currency,
:allow_partial_match
end
end
end
Loading
Loading