Class: PayCertify::Gateway::Transaction
- Inherits:
-
Base::Resource
- Object
- Base::Resource
- PayCertify::Gateway::Transaction
- Defined in:
- lib/paycertify/gateway/transaction.rb
Defined Under Namespace
Classes: Validation
Constant Summary collapse
- API_ENDPOINT =
'/ws/encgateway2.asmx/ProcessCreditCard'
- ATTRIBUTES =
[ :transaction_id, :type, :amount, :currency, :card_number, :expiration_month, :expiration_year, :name_on_card, :cvv, :billing_address, :billing_city, :billing_state, :billing_country, :billing_zip, :shipping_address, :shipping_city, :shipping_state, :shipping_country, :shipping_zip, :email, :phone, :ip, :order_description, :customer_id ]
Instance Attribute Summary
Attributes inherited from Base::Resource
#client, #errors, #original_attributes, #response
Instance Method Summary collapse
Methods inherited from Base::Resource
#attributes, #initialize, #to_json, #validatable?, #validation
Constructor Details
This class inherits a constructor from PayCertify::Gateway::Base::Resource
Instance Method Details
#attributes_to_gateway_format ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/paycertify/gateway/transaction.rb', line 28 def attributes_to_gateway_format formatted = super attribute_mapping = PayCertify::Gateway::AttributeMapping formatted.merge! attribute_mapping.expiration_date(self) formatted.merge! attribute_mapping.type(self) formatted end |
#save! ⇒ Object
18 19 20 21 22 |
# File 'lib/paycertify/gateway/transaction.rb', line 18 def save! super self.transaction_id = response['response']['pn_ref'] self end |
#success? ⇒ Boolean
24 25 26 |
# File 'lib/paycertify/gateway/transaction.rb', line 24 def success? super && response['response']['result'] == '0' end |