Sha256: aeb81cdee88ae0bdeb6a228c38592f2a1db122e9b7025ab64a9834ebd3c871ff

Contents?: true

Size: 1.26 KB

Versions: 47

Compression:

Stored size: 1.26 KB

Contents

describe MangoPay::PayIn::DirectDebit::Direct, type: :feature do
  include_context 'payins'

  def check_type_and_status(payin)
    expect(payin['Type']).to eq('PAYIN')
    expect(payin['Nature']).to eq('REGULAR')
    expect(payin['PaymentType']).to eq('DIRECT_DEBIT')
    expect(payin['ExecutionType']).to eq('DIRECT')

    # FAILED: the related Mandate is not confirmed yet
    expect(payin['Status']).to eq('FAILED')
    expect(payin['ResultMessage']).to eq('The Status of this Mandate does not allow for payments')
    expect(payin['ExecutionDate']).to be_nil
  end
  
  describe 'CREATE' do
    it 'creates a directdebit direct payin' do
      created = new_payin_directdebit_direct
      expect(created['Id']).not_to be_nil
      check_type_and_status(created)
    end
  end

  describe 'FETCH' do
    it 'fetches a payin' do
      created = new_payin_directdebit_direct
      fetched = MangoPay::PayIn.fetch(created['Id'])
      expect(fetched['Id']).to eq(created['Id'])
      expect(fetched['CreationDate']).to eq(created['CreationDate'])
      expect(fetched['CreditedFunds']).to eq(created['CreditedFunds'])
      expect(fetched['CreditedWalletId']).to eq(created['CreditedWalletId'])
      check_type_and_status(created)
      check_type_and_status(fetched)
    end
  end

end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
mangopay-3.28.0 spec/mangopay/payin_directdebit_direct_spec.rb
mangopay-3.27.0 spec/mangopay/payin_directdebit_direct_spec.rb
mangopay-3.26.1 spec/mangopay/payin_directdebit_direct_spec.rb
mangopay-3.26.0 spec/mangopay/payin_directdebit_direct_spec.rb
mangopay-3.25.1 spec/mangopay/payin_directdebit_direct_spec.rb
mangopay-3.25.0 spec/mangopay/payin_directdebit_direct_spec.rb
mangopay-3.24.1 spec/mangopay/payin_directdebit_direct_spec.rb
mangopay-3.24.0 spec/mangopay/payin_directdebit_direct_spec.rb
mangopay-3.23.0 spec/mangopay/payin_directdebit_direct_spec.rb
mangopay-3.22.0 spec/mangopay/payin_directdebit_direct_spec.rb
mangopay-3.21.0 spec/mangopay/payin_directdebit_direct_spec.rb
mangopay-3.20.0 spec/mangopay/payin_directdebit_direct_spec.rb
mangopay-3.19.0 spec/mangopay/payin_directdebit_direct_spec.rb
mangopay-3.18.0 spec/mangopay/payin_directdebit_direct_spec.rb
mangopay-3.17.0 spec/mangopay/payin_directdebit_direct_spec.rb
mangopay-3.16.0 spec/mangopay/payin_directdebit_direct_spec.rb
mangopay-3.15.0 spec/mangopay/payin_directdebit_direct_spec.rb
mangopay-3.14.0 spec/mangopay/payin_directdebit_direct_spec.rb
mangopay-3.13.2 spec/mangopay/payin_directdebit_direct_spec.rb
mangopay-3.12.0 spec/mangopay/payin_directdebit_direct_spec.rb