Sha256: 2b089614042a8c741d1d1d7d578a26460e667ff56510b3f17063d264831466fa

Contents?: true

Size: 1.24 KB

Versions: 39

Compression:

Stored size: 1.24 KB

Contents

describe MangoPay::Refund do
  include_context 'transfers'

  describe 'FETCH' do
    it 'fetches a refund' do
      transfer = new_transfer
      resource = MangoPay::Transfer.refund(transfer['Id'], { AuthorId: transfer['AuthorId'] })

      refund = MangoPay::Refund.fetch(resource['Id'])

      expect(refund['Id']).not_to be_nil
      expect(refund['Status']).to eq('SUCCEEDED')
      expect(refund['Type']).to eq('TRANSFER')
      expect(refund['Nature']).to eq('REFUND')
      expect(refund['InitialTransactionType']).to eq('TRANSFER')
      expect(refund['InitialTransactionId']).to eq(transfer['Id'])
      expect(refund['DebitedWalletId']).to eq(transfer['CreditedWalletId'])
      expect(refund['CreditedWalletId']).to eq(transfer['DebitedWalletId'])
    end
  end

  #describe 'FETCH for Repudiation' do
  #  it "fetches a repudiation's refunds" do
  #    disputes = MangoPay::Dispute.fetch
  #   dispute = disputes.find do |dispute|
  #      dispute['DisputeType'] == 'NOT_CONTESTABLE'\
  #         && !dispute['InitialTransactionId'].nil?
  #   end
  #    repudiation_id = MangoPay::Dispute.transactions(dispute['Id'])[0]['Id']
  #    refunds = MangoPay::Refund.of_repudiation(repudiation_id)
  #    expect(refunds).to be_an(Array)
  #  end
  # end
end

Version data entries

39 entries across 39 versions & 1 rubygems

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