Skip to content

Commit

Permalink
[Bitpay] Add token to payload while creating the invoice
Browse files Browse the repository at this point in the history
The V2 API needs the token upon invoice creation, as per BitPay people
it's also fine to pass it to V1
  • Loading branch information
Pierre Nespo committed May 21, 2019
1 parent 677c124 commit ca4a674
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/offsite_payments/integrations/bit_pay.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def initialize(order_id, account, options)
add_field('posData', {'orderId' => order_id}.to_json)
add_field('fullNotifications', true)
add_field('transactionSpeed', 'high')
add_field('token', account)
end

mapping :amount, 'price'
Expand Down
2 changes: 2 additions & 0 deletions test/unit/integrations/bit_pay/bit_pay_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def test_calls_the_v1_api_url_when_the_token_is_v1
posData: { orderId: 1234 }.to_json,
fullNotifications: "true",
transactionSpeed: 'high',
token: @token_v1,
}.to_json
).to_return(
status: 200,
Expand All @@ -75,6 +76,7 @@ def test_calls_the_v2_api_url_when_the_token_is_v2
posData: { orderId: 1234 }.to_json,
fullNotifications: "true",
transactionSpeed: 'high',
token: @token_v2,
}.to_json
).to_return(
status: 200,
Expand Down

0 comments on commit ca4a674

Please sign in to comment.