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

Returns a new instance of CardAuthorizations.



7
8
9
# File 'lib/increase/resources/simulations/card_authorizations.rb', line 7

def initialize(client:)
  @client = client
end

Instance Method Details

#create(params = {}, opts = {}) ⇒ Increase::Models::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.

Parameters:

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :amount (Integer)

    The authorization amount in cents.

  • :card_id (String)

    The identifier of the Card to be authorized.

  • :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.

  • :physical_card_id (String)

    The identifier of the Physical Card to be authorized.

Returns:



39
40
41
42
43
44
45
46
# File 'lib/increase/resources/simulations/card_authorizations.rb', line 39

def create(params = {}, opts = {})
  req = {}
  req[:method] = :post
  req[:path] = "/simulations/card_authorizations"
  req[:body] = params
  req[:model] = Increase::Models::CardAuthorizationCreateResponse
  @client.request(req, opts)
end