Class: Hps::HpsGiftCardActivate
- Inherits:
-
HpsTransaction
- Object
- HpsTransaction
- Hps::HpsGiftCardActivate
- Defined in:
- lib/hps/entities/hps_gift_card.rb
Overview
= HpsGiftCardActivate =
=======================
Direct Known Subclasses
HpsGiftCardAddValue, HpsGiftCardBalance, HpsGiftCardDeactivate, HpsGiftCardReplace, HpsGiftCardReversal, HpsGiftCardReward, HpsGiftCardSale, HpsGiftCardVoid
Instance Attribute Summary collapse
-
#authorization_code ⇒ Object
Values used in the card activate response.
-
#balance_amount ⇒ Object
Values used in the card activate response.
-
#notes ⇒ Object
Notes contain reward messages to be displayed on a receipt, mobile app, or web page to inform an account holder about special rewards or promotions available on their account.
-
#points_balance_amount ⇒ Object
Values used in the card activate response.
-
#rewards ⇒ Object
The rewards (dollars or points) added to the account as a result of the transaction.
Attributes inherited from HpsTransaction
#reference_number, #response_code, #response_text, #transaction_header, #transaction_id
Class Method Summary collapse
Methods inherited from HpsTransaction
Constructor Details
This class inherits a constructor from Hps::HpsTransaction
Instance Attribute Details
#authorization_code ⇒ Object
Values used in the card activate response
19 20 21 |
# File 'lib/hps/entities/hps_gift_card.rb', line 19 def end |
#balance_amount ⇒ Object
Values used in the card activate response
19 20 21 |
# File 'lib/hps/entities/hps_gift_card.rb', line 19 def balance_amount @balance_amount end |
#notes ⇒ Object
Notes contain reward messages to be displayed on a receipt, mobile app, or web page to inform an account holder about special rewards or promotions available on their account
28 29 30 |
# File 'lib/hps/entities/hps_gift_card.rb', line 28 def notes @notes end |
#points_balance_amount ⇒ Object
Values used in the card activate response
19 20 21 |
# File 'lib/hps/entities/hps_gift_card.rb', line 19 def points_balance_amount @points_balance_amount end |
#rewards ⇒ Object
The rewards (dollars or points) added to the account as a result of the transaction
23 24 25 |
# File 'lib/hps/entities/hps_gift_card.rb', line 23 def rewards @rewards end |
Class Method Details
.from_response(response, txn_type, return_type = nil) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/hps/entities/hps_gift_card.rb', line 30 def self.from_response(response, txn_type, return_type = nil) activation_response = response['Transaction'][txn_type] activation = return_type ? return_type.constantize.new : self.new activation.transaction_id = response['Header']['GatewayTxnId'] activation. = activation_response['AuthCode'] activation.balance_amount = activation_response['BalanceAmt'] activation.points_balance_amount = activation_response['PointsBalanceAmt'] activation.rewards = activation_response['Rewards'] activation.notes = activation_response['Notes'] activation.response_code = activation_response['RspCode'] activation.response_text = activation_response['RspText'] return activation end |