Sha256: 8c2d0b0ea2de10d1e5950f69526fe92d7a5cb25edfe078a4df0f7e3808a7ebc3

Contents?: true

Size: 1.23 KB

Versions: 11

Compression:

Stored size: 1.23 KB

Contents

describe MangoPay::PayIn::Card::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('CARD')
    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 card web payin' do
      created = new_payin_card_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_card_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

11 entries across 11 versions & 1 rubygems

Version Path
mangopay-3.0.25 spec/mangopay/payin_card_web_spec.rb
mangopay-3.0.23 spec/mangopay/payin_card_web_spec.rb
mangopay-3.0.21 spec/mangopay/payin_card_web_spec.rb
mangopay-3.0.20 spec/mangopay/payin_card_web_spec.rb
mangopay-3.0.19 spec/mangopay/payin_card_web_spec.rb
mangopay-3.0.18 spec/mangopay/payin_card_web_spec.rb
mangopay-3.0.17 spec/mangopay/payin_card_web_spec.rb
mangopay-3.0.16 spec/mangopay/payin_card_web_spec.rb
mangopay-3.0.15 spec/mangopay/payin_card_web_spec.rb
mangopay-3.0.14 spec/mangopay/payin_card_web_spec.rb
mangopay-3.0.13 spec/mangopay/payin_card_web_spec.rb