Sha256: a00801d94416283d7fc73a4adcc19b5a96d00966b64d8e4d8f5d5ed737137e67

Contents?: true

Size: 1.25 KB

Versions: 7

Compression:

Stored size: 1.25 KB

Contents

require 'test_helper'

class RemoteEpsilonVirtualAccountGatewayTest < MiniTest::Test
  include SamplePaymentMethods

  def gateway
    @gateway ||= ActiveMerchant::Billing::EpsilonVirtualAccountGateway.new
  end

  def test_virtual_account_purchase_successfull
    VCR.use_cassette(:virtual_account_purchase_successful) do
      response = gateway.purchase(10000, purchase_detail)

      assert_equal true, response.success?

      assert_equal true, !response.params['transaction_code'].empty?

      assert_equal true, !response.params['account_number'].empty?
      assert_equal true, !response.params['account_name'].empty?
      assert_equal true, !response.params['bank_code'].empty?
      assert_equal true, !response.params['bank_name'].empty?
      assert_equal true, !response.params['branch_code'].empty?
      assert_equal true, !response.params['branch_name'].empty?
    end
  end

  def test_virtual_account_purchase_fail
    invalid_purchase_detail = purchase_detail
    invalid_purchase_detail[:user_id] = ''

    VCR.use_cassette(:virtual_account_purchase_fail) do
      response = gateway.purchase(10000, invalid_purchase_detail)
      assert_equal false, response.success?
      assert_equal true, response.params["error_detail"].valid_encoding?
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
active_merchant-epsilon-0.14.0 test/remote/gateways/remote_epsilon_virtual_account_test.rb
active_merchant-epsilon-0.13.0 test/remote/gateways/remote_epsilon_virtual_account_test.rb
active_merchant-epsilon-0.12.0 test/remote/gateways/remote_epsilon_virtual_account_test.rb
active_merchant-epsilon-0.11.0 test/remote/gateways/remote_epsilon_virtual_account_test.rb
active_merchant-epsilon-0.10.0 test/remote/gateways/remote_epsilon_virtual_account_test.rb
active_merchant-epsilon-0.9.4 test/remote/gateways/remote_epsilon_virtual_account_test.rb
active_merchant-epsilon-0.9.3 test/remote/gateways/remote_epsilon_virtual_account_test.rb