Sha256: 4692a9fa0ec7737ddb3a352a5b1380ee15eb7a5c20adbdbf3584289a10299e6f

Contents?: true

Size: 1.14 KB

Versions: 4

Compression:

Stored size: 1.14 KB

Contents

require_relative '../test_helper'

describe Ebanx::Command::ResendPaymentNotification do
  before do
    @params = {
      payment: {
        name: 'João da Silva',
        email: 'joao@mailinator.com',
        currency_code: 'BRL',
        amount_total: 100.50,
        merchant_payment_code: Random.rand(10000000000),
        payment_type_code: 'boleto',
        document: '13326724691',
        birth_date: '01/01/1980',
        zipcode: '70000-000',
        address: 'Rua Brasil',
        street_number: '1',
        city: 'Brasília',
        state: 'DF',
        country: 'br',
        phone_number: '6130001111',
        due_date: (Time.now + 86400).strftime('%d/%m/%Y')
      }
    }
  end

  it "can't run without arguments" do
    lambda { ebanx.do_resend_payment_notification }.must_raise ArgumentError
  end

  it "resend notifiction successfully" do

    payment_request = ebanx.do_direct @params

    payment_request.http_code.must_equal 200

    response = ebanx.do_resend_payment_notification({hash: payment_request.response['payment']['hash']})
    response.http_code.must_equal 200
    response.response['status'].must_equal 'SUCCESS'
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ebanx-1.3.5 test/ebanx/resend_payment_notification_command_test.rb
ebanx-1.3.4 test/ebanx/resend_payment_notification_command_test.rb
ebanx-1.3.3 test/ebanx/resend_payment_notification_command_test.rb
ebanx-1.3.2 test/ebanx/resend_payment_notification_command_test.rb