Skip to content

Commit

Permalink
let developers specify api version
Browse files Browse the repository at this point in the history
ref nov#74
  • Loading branch information
nov committed Dec 4, 2014
1 parent a2014db commit 25b445b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/paypal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
require 'rest_client'

module Paypal
cattr_accessor :api_version
self.api_version = '88.0'

API_VERSION = '88.0'
ENDPOINT = {
:production => 'https://www.paypal.com/cgi-bin/webscr',
:sandbox => 'https://www.sandbox.paypal.com/cgi-bin/webscr'
Expand Down
2 changes: 1 addition & 1 deletion lib/paypal/nvp/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def self.endpoint
end

def initialize(attributes = {})
@version = API_VERSION
@version = Paypal.api_version
super
end

Expand Down
1 change: 0 additions & 1 deletion spec/paypal/nvp/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

it 'should setup endpoint and version' do
client = Paypal::NVP::Request.new attributes
client.version.should == Paypal::API_VERSION
client.class.endpoint.should == Paypal::NVP::Request::ENDPOINT[:production]
end

Expand Down

0 comments on commit 25b445b

Please sign in to comment.