Class: Increase::Resources::Simulations::CardAuthorizations
- Inherits:
-
Object
- Object
- Increase::Resources::Simulations::CardAuthorizations
- Defined in:
- lib/increase/resources/simulations/card_authorizations.rb
Instance Method Summary collapse
-
#create(params = {}, opts = {}) ⇒ Increase::Models::CardAuthorizationCreateResponse
Simulates a purchase authorization on a Card.
-
#initialize(client:) ⇒ CardAuthorizations
constructor
A new instance of CardAuthorizations.
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.
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 |