Sha256: 050c0bfcd78ecd7fa2af99985056b673cd0a0a4556ae5521a1fc12824a73573e

Contents?: true

Size: 1.25 KB

Versions: 7

Compression:

Stored size: 1.25 KB

Contents

require 'test_helper'

class RemoteEpsilonGmoIdGatewayTest < MiniTest::Test
  include SamplePaymentMethods

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

  def test_gmo_id_purchase_successful
    VCR.use_cassette(:gmo_id_purchase_successful) do
      detail = valid_gmo_id_purchase_detail
      response = gateway.purchase(200, detail)
      assert_equal true, response.success?
    end
  end

  def test_gmo_id_purchase_failure
    VCR.use_cassette(:gmo_id_purchase_failure) do
      detail = invalid_gmo_id_purchase_detail
      response = gateway.purchase(200, detail)
      assert_equal false, response.success?
      assert_equal true, response.params["error_detail"].valid_encoding?
    end
  end

  def test_gmo_id_void_successful
    VCR.use_cassette(:gmo_id_void_successful) do
      # purchase
      detail = valid_gmo_id_purchase_detail
      response = gateway.purchase(200, detail)
      assert_equal true, response.success?
      # void
      response = gateway.void(detail[:order_number])
      assert_equal true, response.success?
    end
  end

  def test_gmo_id_void_faiure
    VCR.use_cassette(:gmo_id_void_faiure) do
      response = gateway.void('1234567890')
      assert_equal false, response.success?
    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_gmo_id_test.rb
active_merchant-epsilon-0.13.0 test/remote/gateways/remote_epsilon_gmo_id_test.rb
active_merchant-epsilon-0.12.0 test/remote/gateways/remote_epsilon_gmo_id_test.rb
active_merchant-epsilon-0.11.0 test/remote/gateways/remote_epsilon_gmo_id_test.rb
active_merchant-epsilon-0.10.0 test/remote/gateways/remote_epsilon_gmo_id_test.rb
active_merchant-epsilon-0.9.4 test/remote/gateways/remote_epsilon_gmo_id_test.rb
active_merchant-epsilon-0.9.3 test/remote/gateways/remote_epsilon_gmo_id_test.rb