Skip to content

Commit

Permalink
added payout bankwire endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
SoloJr committed May 26, 2021
1 parent 15c68c7 commit b12d870
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/mangopay/pay_out.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ class BankWire < Resource
def self.url(*)
"#{MangoPay.api_path}/payouts/bankwire"
end

def self.get_bankwire(pay_out_id)
url = self.url() + "/" + pay_out_id
MangoPay.request(:get, url);
end
end
end
end
9 changes: 9 additions & 0 deletions spec/mangopay/payout_bankwire_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ def check_type_and_status(payout, check_status = true)
end
end

describe 'Get Bankwire' do
it 'gets a bankwire' do
created = new_payout_bankwire
fetched = MangoPay::PayOut::BankWire.get_bankwire(created['Id'])
expect(fetched['Id']).to eq(created['Id'])
expect(fetched['CreationDate']).to eq(created['CreationDate'])
end
end

describe 'FETCH' do
it 'fetches a payout' do
created = new_payout_bankwire
Expand Down
3 changes: 2 additions & 1 deletion spec/mangopay/shared_resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@ def create_new_payout_bankwire(payin, amnt = 500)
Fees: {Currency: 'EUR', Amount: 0},
BankAccountId: new_bank_account['Id'],
Communication: 'This is a test',
Tag: 'Test PayOut/Bank/Wire'
Tag: 'Test PayOut/Bank/Wire',
PayoutModeRequested: 'Standard'
)
end
end
Expand Down

0 comments on commit b12d870

Please sign in to comment.