Sha256: ee52a667b9c84ee237c784b7551ed70d689fabe5a4a3e9319d95c3c8313ef5be

Contents?: true

Size: 818 Bytes

Versions: 4

Compression:

Stored size: 818 Bytes

Contents

describe Veritrans::Client do

  before do
    hide_const("Rails")
    Midtrans.logger = Logger.new("/dev/null")
    Midtrans.setup do
      config.load_config "./spec/configs/real_key.yml"
    end
  end

  it "should create alias constant for Midtrans" do
    Midtrans.should == Veritrans
  end

  it "should work with Midtrans" do
    VCR.use_cassette('midtrans_status') do
      txn_result = Veritrans.charge("permata", transaction: { order_id: Time.now.to_s, gross_amount: 100_000 })
      txn_result.success?.should == true
      txn_result.status_message.should == "Success, PERMATA VA transaction is successful"

      cancel_result = Midtrans.status(txn_result.order_id)
      cancel_result.success?.should == true
      cancel_result.status_message.should == "Success, transaction is found"
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
veritrans-2.3.0 spec/midtrans_rename_spec.rb
veritrans-2.2.0 spec/midtrans_rename_spec.rb
veritrans-2.1.3 spec/midtrans_rename_spec.rb
veritrans-2.1.2 spec/midtrans_rename_spec.rb