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

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

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:



73
74
75
# File 'lib/increase/resources/simulations/card_authorizations.rb', line 73

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

Some parameter documentations has been truncated, see Models::Simulations::CardAuthorizationCreateParams for more details.

Simulates a purchase authorization on a [Card](#cards). Depending on the balance available to the card and the ‘amount` submitted, the authorization activity will result in a [Pending Transaction](#pending-transactions) of type `card_authorization` or a [Declined Transaction](#declined-transactions) of type `card_decline`. You can pass either a Card id or a [Digital Wallet Token](#digital-wallet-tokens) id to simulate the two different ways purchases can be made.

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 sim

  • 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

  • merchant_acceptor_id (String)

    The merchant identifier (commonly abbreviated as MID) of the merchant the card i

  • merchant_category_code (String)

    The Merchant Category Code (commonly abbreviated as MCC) of the merchant the car

  • 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

  • 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 Disp

  • terminal_id (String)

    The terminal identifier (commonly abbreviated as TID) of the terminal the card i

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

Returns:

See Also:



59
60
61
62
63
64
65
66
67
68
# File 'lib/increase/resources/simulations/card_authorizations.rb', line 59

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