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

### Home Classes Methods

### In Files

- lib/active_merchant/billing/integrations/sage_pay_form/notification.rb

### Parent

ActiveMerchant::Billing::Integrations::Notification

### Namespace

- CLASS ActiveMerchant::Billing::Integrations::SagePayForm::Notification::CryptError
- CLASS ActiveMerchant::Billing::Integrations::SagePayForm::Notification::InvalidCryptData
- CLASS ActiveMerchant::Billing::Integrations::SagePayForm::Notification::MissingCryptData
- CLASS ActiveMerchant::Billing::Integrations::SagePayForm::Notification::MissingCryptKey

### Methods

- ::new
- #acknowledge
- #address_result
- #address_status
- #auth_id
- #avs_cv2_result
- #buyer_auth_result
- #buyer_auth_result_code
- #cancelled?
- #complete?
- #credit_card_last_4_digits
- #credit_card_type
- #currency
- #cv2_result
- #gift_aid?
- #gross
- #item_id
- #message
- #payer_verified?
- #post_code_result
- #status
- #status_code
- #test?
- #transaction_id

### Included Modules

- ActiveMerchant::Billing::Integrations::SagePayForm::Encryption

### Class/Module Index

Quicksearch

- ActiveMerchant
- ActiveMerchant::Billing
- ActiveMerchant::Billing::AVSResult
- ActiveMerchant::Billing::BarclaysEpdqGateway
- ActiveMerchant::Billing::BarclaysEpdqGateway::Document
- ActiveMerchant::Billing::BarclaysEpdqGateway::Parser
- ActiveMerchant::Billing::Base
- ActiveMerchant::Billing::BeanstreamGateway
- ActiveMerchant::Billing::BeanstreamInteracGateway
- ActiveMerchant::Billing::BeanstreamInteracResponse
- ActiveMerchant::Billing::BluePayGateway
- ActiveMerchant::Billing::BogusGateway
- ActiveMerchant::Billing::BraintreeBlueGateway
- ActiveMerchant::Billing::BraintreeGateway
- ActiveMerchant::Billing::BraintreeOrangeGateway
- ActiveMerchant::Billing::CVVResult
- ActiveMerchant::Billing::CardSaveGateway
- ActiveMerchant::Billing::CardStreamGateway
- ActiveMerchant::Billing::Check
- ActiveMerchant::Billing::CreditCard
- ActiveMerchant::Billing::CreditCardFormatting
- ActiveMerchant::Billing::CreditCardMethods
- ActiveMerchant::Billing::CreditCardMethods::ClassMethods
- ActiveMerchant::Billing::CyberSourceGateway
- ActiveMerchant::Billing::DataCashGateway
- ActiveMerchant::Billing::EfsnetGateway
- ActiveMerchant::Billing::ElavonGateway
- ActiveMerchant::Billing::EpayGateway
- ActiveMerchant::Billing::EwayGateway
- ActiveMerchant::Billing::EwayManagedGateway
- ActiveMerchant::Billing::EwayManagedGateway::EwayResponse
- ActiveMerchant::Billing::ExactGateway
- ActiveMerchant::Billing::FederatedCanadaGateway
- ActiveMerchant::Billing::FirstPayGateway
- ActiveMerchant::Billing::FirstPayGateway::FirstPayPostData
- ActiveMerchant::Billing::GarantiGateway
- ActiveMerchant::Billing::Gateway
- ActiveMerchant::Billing::IdealBaseGateway
- ActiveMerchant::Billing::IdealRabobankGateway
- ActiveMerchant::Billing::IdealResponse
- ActiveMerchant::Billing::InspireGateway
- ActiveMerchant::Billing::InstapayGateway
- ActiveMerchant::Billing::Integrations
- ActiveMerchant::Billing::Integrations::ActionViewHelper
- ActiveMerchant::Billing::Integrations::Bogus
- ActiveMerchant::Billing::Integrations::Bogus::Helper
- ActiveMerchant::Billing::Integrations::Bogus::Notification
- ActiveMerchant::Billing::Integrations::Bogus::Return
- ActiveMerchant::Billing::Integrations::Chronopay
- ActiveMerchant::Billing::Integrations::Chronopay::Helper
- ActiveMerchant::Billing::Integrations::Chronopay::Return
- ActiveMerchant::Billing::Integrations::DirecPay
- ActiveMerchant::Billing::Integrations::DirecPay::Helper
- ActiveMerchant::Billing::Integrations::DirecPay::Notification
- ActiveMerchant::Billing::Integrations::DirecPay::Return
- ActiveMerchant::Billing::Integrations::DirecPay::Status
- ActiveMerchant::Billing::Integrations::Directebanking
- ActiveMerchant::Billing::Integrations::Directebanking::Helper
- ActiveMerchant::Billing::Integrations::Directebanking::Notification
- ActiveMerchant::Billing::Integrations::Directebanking::Return
- ActiveMerchant::Billing::Integrations::Dwolla
- ActiveMerchant::Billing::Integrations::Dwolla::Helper
- ActiveMerchant::Billing::Integrations::Dwolla::Notification
- ActiveMerchant::Billing::Integrations::Dwolla::Return
- ActiveMerchant::Billing::Integrations::EPaymentPlans
- ActiveMerchant::Billing::Integrations::EPaymentPlans::Helper
- ActiveMerchant::Billing::Integrations::EPaymentPlans::Notification
- ActiveMerchant::Billing::Integrations::Gestpay
- ActiveMerchant::Billing::Integrations::Gestpay::Common
- ActiveMerchant::Billing::Integrations::Gestpay::Helper
- ActiveMerchant::Billing::Integrations::Gestpay::Notification
- ActiveMerchant::Billing::Integrations::Gestpay::Return
- ActiveMerchant::Billing::Integrations::HiTrust
- ActiveMerchant::Billing::Integrations::HiTrust::Notification
- ActiveMerchant::Billing::Integrations::HiTrust::Return
- ActiveMerchant::Billing::Integrations::Moneybookers
- ActiveMerchant::Billing::Integrations::Moneybookers::Helper
- ActiveMerchant::Billing::Integrations::Nochex
- ActiveMerchant::Billing::Integrations::Nochex::Helper
- ActiveMerchant::Billing::Integrations::Nochex::Notification
- ActiveMerchant::Billing::Integrations::Nochex::Return
- ActiveMerchant::Billing::Integrations::Notification
- ActiveMerchant::Billing::Integrations::PayflowLink
- ActiveMerchant::Billing::Integrations::PayflowLink::Helper
- ActiveMerchant::Billing::Integrations::PayflowLink::Notification
- ActiveMerchant::Billing::Integrations::Paypal
- ActiveMerchant::Billing::Integrations::Paypal::Helper
- ActiveMerchant::Billing::Integrations::Paypal::Notification
- ActiveMerchant::Billing::Integrations::Paypal::Return
- ActiveMerchant::Billing::Integrations::Quickpay
- ActiveMerchant::Billing::Integrations::Quickpay::Helper
- ActiveMerchant::Billing::Integrations::Quickpay::Notification
- ActiveMerchant::Billing::Integrations::Return
- ActiveMerchant::Billing::Integrations::SagePayForm
- ActiveMerchant::Billing::Integrations::SagePayForm::Encryption
- ActiveMerchant::Billing::Integrations::SagePayForm::Helper
- ActiveMerchant::Billing::Integrations::SagePayForm::Notification
- ActiveMerchant::Billing::Integrations::SagePayForm::Notification::CryptError
- ActiveMerchant::Billing::Integrations::SagePayForm::Notification::InvalidCryptData
- ActiveMerchant::Billing::Integrations::SagePayForm::Notification::MissingCryptData
- ActiveMerchant::Billing::Integrations::SagePayForm::Notification::MissingCryptKey
- ActiveMerchant::Billing::Integrations::SagePayForm::Return
- ActiveMerchant::Billing::Integrations::TwoCheckout
- ActiveMerchant::Billing::Integrations::TwoCheckout::Helper
- ActiveMerchant::Billing::Integrations::TwoCheckout::Notification
- ActiveMerchant::Billing::Integrations::TwoCheckout::Return
- ActiveMerchant::Billing::Integrations::Valitor
- ActiveMerchant::Billing::Integrations::Valitor::Helper
- ActiveMerchant::Billing::Integrations::Valitor::Notification
- ActiveMerchant::Billing::Integrations::Valitor::ResponseFields
- ActiveMerchant::Billing::Integrations::Valitor::Return
- ActiveMerchant::Billing::Integrations::WorldPay
- ActiveMerchant::Billing::Integrations::WorldPay::Helper
- ActiveMerchant::Billing::Integrations::WorldPay::Notification
- ActiveMerchant::Billing::IridiumGateway
- ActiveMerchant::Billing::JetpayGateway
- ActiveMerchant::Billing::LinkpointGateway
- ActiveMerchant::Billing::MerchantESolutionsGateway
- ActiveMerchant::Billing::MerchantWareGateway
- ActiveMerchant::Billing::ModernPaymentsGateway
- ActiveMerchant::Billing::MonerisGateway
- ActiveMerchant::Billing::NetRegistryGateway
- ActiveMerchant::Billing::NetaxeptGateway
- ActiveMerchant::Billing::NetaxeptGateway::Response
- ActiveMerchant::Billing::NetbillingGateway
- ActiveMerchant::Billing::NmiGateway
- ActiveMerchant::Billing::OptimalPaymentGateway
- ActiveMerchant::Billing::OrbitalSoftDescriptors
- ActiveMerchant::Billing::PayJunctionGateway
- ActiveMerchant::Billing::PaySecureGateway
- ActiveMerchant::Billing::PayboxDirectGateway
- ActiveMerchant::Billing::PayflowCommonAPI
- ActiveMerchant::Billing::PayflowExpressResponse
- ActiveMerchant::Billing::PayflowExpressUkGateway
- ActiveMerchant::Billing::PayflowGateway
- ActiveMerchant::Billing::PayflowResponse
- ActiveMerchant::Billing::PayflowUkGateway
- ActiveMerchant::Billing::PaymentExpressGateway
- ActiveMerchant::Billing::PaymentExpressResponse
- ActiveMerchant::Billing::PaypalCaGateway
- ActiveMerchant::Billing::PaypalCommonAPI
- ActiveMerchant::Billing::PaypalExpressCommon
- ActiveMerchant::Billing::PaypalExpressGateway
- ActiveMerchant::Billing::PaypalExpressResponse
- ActiveMerchant::Billing::PaypalGateway
- ActiveMerchant::Billing::PlugnpayGateway
- ActiveMerchant::Billing::PlugnpayGateway::PlugnpayPostData
- ActiveMerchant::Billing::PsigateGateway
- ActiveMerchant::Billing::QbmsGateway
- ActiveMerchant::Billing::QuantumGateway
- ActiveMerchant::Billing::QuickpayGateway
- ActiveMerchant::Billing::RealexGateway
- ActiveMerchant::Billing::Response
- ActiveMerchant::Billing::SageGateway
- ActiveMerchant::Billing::SagePayGateway
- ActiveMerchant::Billing::SallieMaeGateway
- ActiveMerchant::Billing::SamuraiGateway
- ActiveMerchant::Billing::SecureNetGateway
- ActiveMerchant::Billing::SecurePayAuGateway
- ActiveMerchant::Billing::SecurePayGateway
- ActiveMerchant::Billing::SecurePayTechGateway
- ActiveMerchant::Billing::SecurePayTechGateway::SecurePayTechPostData
- ActiveMerchant::Billing::SkipJackGateway
- ActiveMerchant::Billing::StripeGateway
- ActiveMerchant::Billing::TransFirstGateway
- ActiveMerchant::Billing::TransaxGateway
- ActiveMerchant::Billing::TrustCommerceGateway
- ActiveMerchant::Billing::UsaEpayAdvancedGateway
- ActiveMerchant::Billing::UsaEpayGateway
- ActiveMerchant::Billing::UsaEpayTransactionGateway
- ActiveMerchant::Billing::VerifiGateway
- ActiveMerchant::Billing::VerifiGateway::VerifiPostData
- ActiveMerchant::Billing::ViaklixGateway
- ActiveMerchant::Billing::WirecardGateway
- ActiveMerchant::Billing::WorldpayGateway
- ActiveMerchant::Billing::WorldpayGateway::MultiResponse
- BraintreeCommon
- OutboundHosts

No matching classes.

# 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
    def initialize(post_data, options)
      super
      load_crypt_params(params['crypt'], options[:credential2])
    end

### Public Instance Methods

acknowledge() click to toggle source

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 173
    def acknowledge
      true
    end

address_result() click to toggle source

Numeric address check. Possible values:

`NOTPROVIDED` |
`NOTCHECKED` |
`MATCHED` |
`NOTMATCHED` |

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 87
    def address_result
      params['AddressResult']
    end

address_status() click to toggle source

Address confirmation status. PayPal only. Possible values:

`NONE` |
`CONFIRMED` |
`UNCONFIRMED` |

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 134
    def address_status
      params['AddressStatus']
    end

auth_id() click to toggle source

Authorization number (only if completed?).

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 63
    def auth_id
      params['TxAuthNo']
    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` |
`DATA NOT CHECKED` |

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 78
    def avs_cv2_result
      params['AVSCV2']
    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
    def buyer_auth_result
      params['3DSecureStatus']
    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
    def buyer_auth_result_code
      params['CAVV']
    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
    def cancelled?
      status_code == 'ABORT'
    end

complete?() click to toggle source

Was the transaction complete?

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 18
    def complete?
      status_code == 'OK'
    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
    def credit_card_last_4_digits
      params['Last4Digits']
    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
    def credit_card_type
      params['CardType']
    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
    def currency
      nil
    end

cv2_result() click to toggle source

CV2 code check. Possible values:

`NOTPROVIDED` |
`NOTCHECKED` |
`MATCHED` |
`NOTMATCHED` |

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 105
    def cv2_result
      params['CV2Result']
    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
    def gift_aid?
      params['GiftAid'] == '1'
    end

gross() click to toggle source

Total amount (no fees).

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 68
    def gross
      params['Amount']
    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
    def item_id
      params['VendorTxCode']
    end

message() click to toggle source

Check this if completed? is false.

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 48
    def message
      params['StatusDetail']
    end

payer_verified?() click to toggle source

Payer verification. Undocumented.

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 139
    def payer_verified?
      params['PayerStatus'] == 'VERIFIED'
    end

post_code_result() click to toggle source

Post code check. Possible values:

`NOTPROVIDED` |
`NOTCHECKED` |
`MATCHED` |
`NOTMATCHED` |

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 96
    def post_code_result
      params['PostCodeResult']
    end

status() click to toggle source

Text version of complete?, since we don't support Pending.

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 29
    def status
      complete? ? 'Completed' : 'Failed'
    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
    def status_code
      params['Status']
    end

test?() click to toggle source

    # File lib/active_merchant/billing/integrations/sage_pay_form/notification.rb, line 169
    def test?
      false
    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
    def transaction_id
      params['VPSTxId']
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.