Skip to content
This repository was archived by the owner on May 29, 2025. It is now read-only.

Commit e97137d

Browse files
author
Alexander Leitner
committed
Merge pull request #31 from philosodad/master
Change namespace of Client to SDK::Client
2 parents 42a6a60 + ad3a68e commit e97137d

File tree

14 files changed

+165
-207
lines changed

14 files changed

+165
-207
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ Powerful, flexible, lightweight interface to the BitPay Bitcoin Payment Gateway
33

44
## Installation
55

6-
gem install bitpay
6+
gem install bitpay-sdk
77

88
In your Gemfile:
99

10-
gem 'bitpay', :require => 'bitpay'
10+
gem 'bitpay-sdk', :require => 'bitpay_sdk'
1111

1212
Or directly:
1313

14-
require 'bitpay'
14+
require 'bitpay_sdk'
1515

1616
## Configuration
1717

features/step_definitions/invoice_steps.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
end
2121

2222
Then(/^they can retrieve that invoice$/) do
23-
invoice = BitPay::Client.new(api_uri: ROOT_ADDRESS, insecure: true).get_public_invoice(id: @id)
23+
invoice = BitPay::SDK::Client.new(api_uri: ROOT_ADDRESS, insecure: true).get_public_invoice(id: @id)
2424
raise "That's the wrong invoice" unless invoice['id'] == @id
2525
end
2626

features/step_definitions/keygen_steps.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
When(/^the user pairs with BitPay(?: with a valid pairing code|)$/) do
55
claim_code = get_claim_code_from_server
66
pem = BitPay::KeyUtils.generate_pem
7-
@client = BitPay::Client.new(api_uri: ROOT_ADDRESS, pem: pem, insecure: true)
7+
@client = BitPay::SDK::Client.new(api_uri: ROOT_ADDRESS, pem: pem, insecure: true)
88
@token = @client.pair_pos_client(claim_code)
99
end
1010

1111
When(/^the fails to pair with BitPay because of an incorrect port$/) do
1212
pem = BitPay::KeyUtils.generate_pem
1313
address = ROOT_ADDRESS.split(':').slice(0,2).join(':') + ":999"
14-
client = BitPay::Client.new(api_uri: address, pem: pem, insecure: true)
14+
client = BitPay::SDK::Client.new(api_uri: address, pem: pem, insecure: true)
1515
begin
1616
client.pair_pos_client("1ab2c34")
1717
raise "pairing unexpectedly worked"
@@ -35,7 +35,7 @@
3535

3636
Then(/^the user fails to pair with a semantically (?:in|)valid code "(.*?)"$/) do |code|
3737
pem = BitPay::KeyUtils.generate_pem
38-
client = BitPay::Client.new(api_uri: ROOT_ADDRESS, pem: pem, insecure: true)
38+
client = BitPay::SDK::Client.new(api_uri: ROOT_ADDRESS, pem: pem, insecure: true)
3939
begin
4040
client.pair_pos_client(code)
4141
raise "pairing unexpectedly worked"

features/step_definitions/step_helpers.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
require 'capybara/poltergeist'
22
require 'pry'
33

4-
require File.join File.dirname(__FILE__), '..', '..', 'lib', 'bitpay', 'client.rb'
5-
require File.join File.dirname(__FILE__), '..', '..', 'lib', 'bitpay', 'key_utils.rb'
6-
require File.join File.dirname(__FILE__), '..', '..', 'lib', 'bitpay.rb'
4+
require File.join File.dirname(__FILE__), '..', '..', 'lib', 'bitpay_sdk.rb'
75
require_relative '../../config/constants.rb'
86
require_relative '../../config/capybara.rb'
97

@@ -48,7 +46,7 @@ def log_in
4846
def new_paired_client
4947
claim_code = get_claim_code_from_server
5048
pem = BitPay::KeyUtils.generate_pem
51-
client = BitPay::Client.new(api_uri: ROOT_ADDRESS, pem: pem, insecure: true)
49+
client = BitPay::SDK::Client.new(api_uri: ROOT_ADDRESS, pem: pem, insecure: true)
5250
client.pair_pos_client(claim_code)
5351
client
5452
end
@@ -57,11 +55,11 @@ def new_client_from_stored_values
5755
if File.file?(BitPay::PRIVATE_KEY_PATH) && File.file?(BitPay::TOKEN_FILE_PATH)
5856
token = get_token_from_file
5957
pem = File.read(BitPay::PRIVATE_KEY_PATH)
60-
BitPay::Client.new(pem: pem, tokens: token, insecure: true, api_uri: ROOT_ADDRESS )
58+
BitPay::SDK::Client.new(pem: pem, tokens: token, insecure: true, api_uri: ROOT_ADDRESS )
6159
else
6260
claim_code = get_claim_code_from_server
6361
pem = BitPay::KeyUtils.generate_pem
64-
client = BitPay::Client.new(api_uri: ROOT_ADDRESS, pem: pem, insecure: true)
62+
client = BitPay::SDK::Client.new(api_uri: ROOT_ADDRESS, pem: pem, insecure: true)
6563
token = client.pair_pos_client(claim_code)
6664
File.write(BitPay::PRIVATE_KEY_PATH, pem)
6765
File.write(BitPay::TOKEN_FILE_PATH, JSON.generate(token))

0 commit comments

Comments
 (0)