Included Modules

Class Index [+]

Quicksearch

ActiveMerchant::Billing::Integrations::SagePayForm::Notification

Public Class Methods

new(post_data, options) click to toggle source
    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 12
12:           def initialize(post_data, options)
13:             super
14:             load_crypt_params(params['crypt'], options[:credential2])
15:           end

Public Instance Methods

acknowledge() click to toggle source
     # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 173
173:           def acknowledge      
174:             true
175:           end
address_result() click to toggle source

Numeric address check. Possible values:

NOTPROVIDED
NOTCHECKED
MATCHED
    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 87
87:           def address_result
88:             params['AddressResult']
89:           end
address_status() click to toggle source

Address confirmation status. PayPal only. Possible values:

NONE
CONFIRMED
     # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 134
134:           def address_status
135:             params['AddressStatus']
136:           end
auth_id() click to toggle source

Authorization number (only if #).

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 63
63:           def auth_id
64:             params['TxAuthNo']
65:           end
avs_cv2_result() click to toggle source

AVS and CV2 check results. Possible values:

ALL MATCH
SECURITY CODE MATCH ONLY
ADDRESS MATCH ONLY
NO DATA MATCHES
    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 78
78:           def avs_cv2_result
79:             params['AVSCV2']
80:           end
buyer_auth_result() click to toggle source

Result of 3D Secure checks. Possible values:

OK

Authenticated correctly.

NOTCHECKED

Authentication not performed.

NOTAVAILABLE

Card not auth-capable, or auth is otherwise impossible.

NOTAUTHED

User failed authentication.

INCOMPLETE

Authentication unable to complete.

ERROR

Unable to attempt authentication due to data / service errors.

     # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 121
121:           def buyer_auth_result
122:             params['3DSecureStatus']
123:           end
buyer_auth_result_code() click to toggle source

Encoded 3D Secure result code.

     # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 126
126:           def buyer_auth_result_code
127:             params['CAVV']
128:           end
cancelled?() click to toggle source

Was the transaction cancelled? Unfortunately, we can’t distinguish “user abort” from “idle too long”.

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 24
24:           def cancelled?
25:             status_code == 'ABORT'
26:           end
complete?() click to toggle source

Was the transaction complete?

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 18
18:           def complete?
19:             status_code == 'OK'
20:           end
credit_card_last_4_digits() click to toggle source

Last four digits of credit card.

     # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 160
160:           def credit_card_last_4_digits
161:             params['Last4Digits']
162:           end
credit_card_type() click to toggle source

Credit card type. Possible values:

VISA

Visa

MC

MasterCard

DELTA

Delta

SOLO

Solo

MAESTRO

Maestro (UK and International)

UKE

Visa Electron

AMEX

American Express

DC

Diners Club

JCB

JCB

LASER

Laser

PAYPAL

PayPal

     # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 155
155:           def credit_card_type
156:             params['CardType']
157:           end
currency() click to toggle source

Used by composition methods, but not supplied by SagePay.

     # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 165
165:           def currency
166:             nil
167:           end
cv2_result() click to toggle source

CV2 code check. Possible values:

NOTPROVIDED
NOTCHECKED
MATCHED
     # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 105
105:           def cv2_result
106:             params['CV2Result']
107:           end
gift_aid?() click to toggle source

Was the Gift Aid box checked?

     # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 110
110:           def gift_aid?
111:             params['GiftAid'] == '1'
112:           end
gross() click to toggle source

Total amount (no fees).

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 68
68:           def gross
69:             params['Amount']
70:           end
item_id() click to toggle source

Vendor-supplied code (:order mapping).

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 53
53:           def item_id
54:             params['VendorTxCode']
55:           end
message() click to toggle source

Check this if # is false.

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 48
48:           def message
49:             params['StatusDetail']
50:           end
payer_verified?() click to toggle source

Payer verification. Undocumented.

     # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 139
139:           def payer_verified?
140:             params['PayerStatus'] == 'VERIFIED'
141:           end
post_code_result() click to toggle source

Post code check. Possible values:

NOTPROVIDED
NOTCHECKED
MATCHED
    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 96
96:           def post_code_result
97:             params['PostCodeResult']
98:           end
status() click to toggle source

Text version of #, since we don’t support Pending.

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 29
29:           def status
30:             complete? ? 'Completed' : 'Failed'
31:           end
status_code() click to toggle source

Status of transaction. List of possible values:

OK

Transaction completed successfully.

NOTAUTHED

Incorrect card details / insufficient funds.

MALFORMED

Invalid input data.

INVALID

Valid input data, but some fields are incorrect.

ABORT

User hit cancel button or went idle for 15+ minutes.

REJECTED

Rejected by account fraud screening rules.

AUTHENTICATED

Authenticated card details secured at SagePay.

REGISTERED

Non-authenticated card details secured at SagePay.

ERROR

Problem internal to SagePay.

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 43
43:           def status_code
44:             params['Status']
45:           end
test?() click to toggle source
     # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 169
169:           def test?
170:             false
171:           end
transaction_id() click to toggle source

Internal SagePay code, typically “{LONG-UUID}”.

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 58
58:           def transaction_id
59:             params['VPSTxId']
60:           end

Private Instance Methods

load_crypt_params(crypt, key) click to toggle source
     # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 179
179:           def load_crypt_params(crypt, key)
180:             raise MissingCryptData if crypt.blank?
181:             raise MissingCryptKey  if key.blank?
182:             
183:             crypt_data = sage_decrypt(crypt.gsub(' ', '+'), key)
184:             raise InvalidCryptData unless crypt_data =~ /(^|&)Status=/
185: 
186:             params.clear            
187:             parse(crypt_data)
188:           end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.