Class: AlphaCard::Transaction

Inherits:
Resource
  • Object
show all
Defined in:
lib/alpha_card/transaction.rb

Overview

Base Alpha Card transaction object.

Direct Known Subclasses

Capture, Sale, Void

Constant Summary

Constants inherited from Resource

Resource::ORIGIN_TRANSACTION_VARIABLES

Instance Method Summary collapse

Methods inherited from Resource

#attributes_for_request

Methods included from Attribute

included

Instance Method Details

#process(credentials = Account.credentials) ⇒ AlphaCard::Response Also known as: create

Creates transaction.

Examples:

void = AlphaCard::Void.new(transaction_id: '981562')
void.create

#=> #<AlphaCard::Response:0x1a0fda ...>

Parameters:

  • credentials (Hash) (defaults to: Account.credentials)

    Alpha Card merchant account credentials.

Returns:

  • (AlphaCard::Response)

    AlphaCard Gateway response with all the information about transaction.

Raises:

  • (AlphaCard::InvalidObjectError)

    Exception if one of required attributes doesn’t specified.



22
23
24
25
26
# File 'lib/alpha_card/transaction.rb', line 22

def process(credentials = Account.credentials)
  validate_required_attributes!

  AlphaCard.request(attributes_for_request, credentials)
end