File tree Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,13 @@ def create_quote(quote_request)
2727 Quote . new ( ResponseFactory . new ( transferwise_response ) . response . to_h )
2828 end
2929
30+ def temporary_quote ( source , target , source_amount )
31+ transferwise_response = @http_request . send_get_request (
32+ "quotes?source=#{ source } &target=#{ target } &sourceAmount=#{ source_amount } &rateType=FIXED"
33+ )
34+ Quote . new ( ResponseFactory . new ( transferwise_response ) . response . to_h )
35+ end
36+
3037 def create_transfer ( transfer_request )
3138 return nil unless transfer_request . valid?
3239
Original file line number Diff line number Diff line change 99Dir [ File . dirname ( __FILE__ ) + '/transferwise-client/request/*.rb' ] . each { |f | require f }
1010Dir [ File . dirname ( __FILE__ ) + '/transferwise-client/response/*.rb' ] . each { |f | require f }
1111
12- TransferwiseClient ::VALIDATIONS = YAML . safe_load (
12+ TransferwiseClient ::VALIDATIONS = YAML . load (
1313 IO . read ( File . dirname ( __FILE__ ) + '/../validations.yaml' )
1414)
1515
Original file line number Diff line number Diff line change 22
33RSpec . describe TransferwiseClient ::Client do
44 let ( :auth_key ) { '4a569d2b-264c-46ef-8280-7d8e96ac5b10' }
5+ let ( :profile ) { '3431' }
56 subject { TransferwiseClient ::Client . new ( auth_key ) }
67
78 describe '#create_account' do
1213 account_request . type = 'australian'
1314 account_request . account_holder_name = 'Full Name'
1415 account_request . details = { 'bsbCode' => '083451' , 'accountNumber' => '89976543' }
15- account_request . details [ 'legalType' ] = 'BUSINESS '
16+ account_request . details [ 'legalType' ] = 'PRIVATE '
1617 end
1718
18- it { expect ( subject . create_account ( account_request ) ) . to eq ( { } ) }
19+ it { expect ( subject . create_account ( account_request ) . id ) . to be_kind_of ( Integer ) }
1920 end
2021end
Original file line number Diff line number Diff line change 1010
1111 subject { TransferwiseClient ::QuoteRequest . new }
1212 before do
13- subject . profile_id = profile_id
1413 subject . source = source
1514 subject . target = target
1615 subject . target_amount = target_amount
2019 describe 'implements to_h' do
2120 it {
2221 expect ( subject . to_h ) . to include (
23- profile : profile_id ,
2422 source : source ,
2523 target : target ,
2624 targetAmount : target_amount ,
You can’t perform that action at this time.
0 commit comments