Class: PayCertify::Gateway::Charge
Defined Under Namespace
Classes: Validation
Constant Summary
collapse
- API_ENDPOINT =
'/ws/cardsafe.asmx/ProcessStoredCard'
- ATTRIBUTES =
[
:transaction_id, :app_transaction_id, :type, :amount,
:credit_card_id, :gateway_response
]
Instance Attribute Summary
#client, #errors, #original_attributes, #response
Instance Method Summary
collapse
#attributes, #initialize, #to_json, #validatable?, #validation
Instance Method Details
30
31
32
33
34
35
36
37
38
|
# File 'lib/paycertify/gateway/charge.rb', line 30
def attributes_to_gateway_format
formatted = super
attribute_mapping = PayCertify::Gateway::AttributeMapping
formatted.merge! attribute_mapping.type(self)
formatted.merge!({'TokenMode' => 'DEFAULT'})
formatted
end
|
#execute! ⇒ Object
14
|
# File 'lib/paycertify/gateway/charge.rb', line 14
alias :execute! :save!
|
#save! ⇒ Object
24
25
26
27
28
|
# File 'lib/paycertify/gateway/charge.rb', line 24
def save!
super
self.transaction_id = response['response']['transaction_result']['pn_ref']
self
end
|
#success? ⇒ Boolean
20
21
22
|
# File 'lib/paycertify/gateway/charge.rb', line 20
def success?
response['response']['transaction_result']['result'] == '0'
end
|
#type ⇒ Object
16
17
18
|
# File 'lib/paycertify/gateway/charge.rb', line 16
def type
'sale'
end
|