Class: Increase::Resources::Simulations::CardAuthorizations

Inherits:
Object
  • Object
show all
Defined in:
lib/increase/resources/simulations/card_authorizations.rb,
sig/increase/resources/simulations/card_authorizations.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CardAuthorizations

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of CardAuthorizations.

Parameters:



92
93
94
# File 'lib/increase/resources/simulations/card_authorizations.rb', line 92

def initialize(client:)
  @client = client
end

Instance Method Details

#create(amount:, authenticated_card_payment_id: nil, card_id: nil, decline_reason: nil, digital_wallet_token_id: nil, event_subscription_id: nil, merchant_acceptor_id: nil, merchant_category_code: nil, merchant_city: nil, merchant_country: nil, merchant_descriptor: nil, merchant_state: nil, network_details: nil, network_risk_score: nil, physical_card_id: nil, processing_category: nil, terminal_id: nil, request_options: {}) ⇒ Increase::Models::Simulations::CardAuthorizationCreateResponse

Simulates a purchase authorization on a Card. Depending on the balance available to the card and the amount submitted, the authorization activity will result in a Pending Transaction of type card_authorization or a Declined Transaction of type card_decline. You can pass either a Card id or a Digital Wallet Token id to simulate the two different ways purchases can be made. The response will contain either a pending_transaction or a declined_transaction; the other attribute will be null. If the authorization is declined, the reason is available on the Declined Transaction at source.card_decline.reason.

Parameters:

  • amount (Integer)

    The authorization amount in cents.

  • authenticated_card_payment_id (String)

    The identifier of a Card Payment with a card_authentication if you want to simulate an authenticated authorization.

  • card_id (String)

    The identifier of the Card to be authorized.

  • decline_reason (Symbol, Increase::Models::Simulations::CardAuthorizationCreateParams::DeclineReason)

    Forces a card decline with a specific reason. No real time decision will be sent.

  • digital_wallet_token_id (String)

    The identifier of the Digital Wallet Token to be authorized.

  • event_subscription_id (String)

    The identifier of the Event Subscription to use. If provided, will override the default real time event subscription. Because you can only create one real time decision event subscription, you can use this field to route events to any specified event subscription for testing purposes.

  • merchant_acceptor_id (String)

    The merchant identifier (commonly abbreviated as MID) of the merchant the card is transacting with.

  • merchant_category_code (String)

    The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is transacting with.

  • merchant_city (String)

    The city the merchant resides in.

  • merchant_country (String)

    The country the merchant resides in.

  • merchant_descriptor (String)

    The merchant descriptor of the merchant the card is transacting with.

  • merchant_state (String)

    The state the merchant resides in.

  • network_details (Increase::Models::Simulations::CardAuthorizationCreateParams::NetworkDetails)

    Fields specific to a given card network.

  • network_risk_score (Integer)

    The risk score generated by the card network. For Visa this is the Visa Advanced Authorization risk score, from 0 to 99, where 99 is the riskiest.

  • physical_card_id (String)

    The identifier of the Physical Card to be authorized.

  • processing_category (Increase::Models::Simulations::CardAuthorizationCreateParams::ProcessingCategory)

    Fields specific to a specific type of authorization, such as Automatic Fuel Dispensers, Refund Authorizations, or Cash Disbursements.

  • terminal_id (String)

    The terminal identifier (commonly abbreviated as TID) of the terminal the card is transacting with.

  • request_options (Increase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



78
79
80
81
82
83
84
85
86
87
# File 'lib/increase/resources/simulations/card_authorizations.rb', line 78

def create(params)
  parsed, options = Increase::Simulations::CardAuthorizationCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "simulations/card_authorizations",
    body: parsed,
    model: Increase::Models::Simulations::CardAuthorizationCreateResponse,
    options: options
  )
end