Sha256: 0d1aa4b153036d16b534b95b2651ae73a5ba1ad78fe19c0ce4820df9e67b078b

Contents?: true

Size: 1.23 KB

Versions: 47

Compression:

Stored size: 1.23 KB

Contents

describe MangoPay::PayIn::DirectDebit::Web, 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('WEB')

    # not SUCCEEDED yet: waiting for processing
    expect(payin['Status']).to eq('CREATED')
    expect(payin['ResultCode']).to be_nil
    expect(payin['ResultMessage']).to be_nil
    expect(payin['ExecutionDate']).to be_nil
  end
  
  describe 'CREATE' do
    it 'creates a directdebit web payin' do
      created = new_payin_directdebit_web
      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_web
      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_web_spec.rb
mangopay-3.27.0 spec/mangopay/payin_directdebit_web_spec.rb
mangopay-3.26.1 spec/mangopay/payin_directdebit_web_spec.rb
mangopay-3.26.0 spec/mangopay/payin_directdebit_web_spec.rb
mangopay-3.25.1 spec/mangopay/payin_directdebit_web_spec.rb
mangopay-3.25.0 spec/mangopay/payin_directdebit_web_spec.rb
mangopay-3.24.1 spec/mangopay/payin_directdebit_web_spec.rb
mangopay-3.24.0 spec/mangopay/payin_directdebit_web_spec.rb
mangopay-3.23.0 spec/mangopay/payin_directdebit_web_spec.rb
mangopay-3.22.0 spec/mangopay/payin_directdebit_web_spec.rb
mangopay-3.21.0 spec/mangopay/payin_directdebit_web_spec.rb
mangopay-3.20.0 spec/mangopay/payin_directdebit_web_spec.rb
mangopay-3.19.0 spec/mangopay/payin_directdebit_web_spec.rb
mangopay-3.18.0 spec/mangopay/payin_directdebit_web_spec.rb
mangopay-3.17.0 spec/mangopay/payin_directdebit_web_spec.rb
mangopay-3.16.0 spec/mangopay/payin_directdebit_web_spec.rb
mangopay-3.15.0 spec/mangopay/payin_directdebit_web_spec.rb
mangopay-3.14.0 spec/mangopay/payin_directdebit_web_spec.rb
mangopay-3.13.2 spec/mangopay/payin_directdebit_web_spec.rb
mangopay-3.12.0 spec/mangopay/payin_directdebit_web_spec.rb