Sha256: 7f903dc49d09b4348ac4f9422bd6a0ea546154dafaf9c7126c98451a4f1c6f5f

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

require 'test_helper'

class ActiveMerchantOgoneTest < Test::Unit::TestCase
  include ActiveMerchant::Billing::Integrations

  def test_sha1_signature_out
    # input values and return value taken from BASIC documentation
    data = {'orderID'  => '1234',
            'currency' => 'EUR',
            'amount'   => 1500,
            'PSPID'    => 'MyPSPID',
            'operation' => 'RES' }

    signature = 'Mysecretsig1875!?'

    assert_equal 'EB52902BCC4B50DC1250E5A7C1068ECF97751256',
      Ogone.outbound_message_signature(data, signature)
  end

  def test_sha1_signature_in
    # input values and return value taken from BASIC documentation
    data = {'orderID'    => '12',
            'currency'   => 'EUR',
            'amount'     => '15',
            'PM'         => 'CreditCard',
            'ACCEPTANCE' => '1234',
            'STATUS'     => '9',
            'CARDNO'     => 'xxxxxxxxxxxx1111',
            'PAYID'      => '32100123',
            'NCERROR'    => '0',
            'BRAND'      => 'VISA'}

    signature = 'Mysecretsig1875!?'

    assert_equal 'B209960D5703DD1047F95A0F97655FFE5AC8BD52',
      Ogone.inbound_message_signature(data, signature)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_merchant_ogone-1.0.0 test/active_merchant_ogone_test.rb
active_merchant_ogone-0.2.0 test/active_merchant_ogone_test.rb