paypal_adaptive 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +1 -1
 - data/VERSION +1 -1
 - data/lib/config.rb +1 -1
 - data/lib/request.rb +10 -3
 - data/paypal_adaptive.gemspec +2 -3
 - data/test/unit/config_test.rb +7 -7
 - metadata +6 -7
 - data/test/data/dummy_cacert.pem +0 -1
 
    
        data/README.markdown
    CHANGED
    
    | 
         @@ -91,7 +91,7 @@ this location exists, otherwise falling back to the cacert.pem file included wit 
     | 
|
| 
       91 
91 
     | 
    
         
             
            ## Changelog
         
     | 
| 
       92 
92 
     | 
    
         
             
            0.2.0
         
     | 
| 
       93 
93 
     | 
    
         
             
            Thanks to seangaffney for set payment option support.
         
     | 
| 
       94 
     | 
    
         
            -
            Thanks to gaelian for  
     | 
| 
      
 94 
     | 
    
         
            +
            Thanks to gaelian for ssl cert support.
         
     | 
| 
       95 
95 
     | 
    
         
             
            Changed tests to use relative paths.
         
     | 
| 
       96 
96 
     | 
    
         | 
| 
       97 
97 
     | 
    
         
             
            0.1.0
         
     | 
    
        data/VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            0.2. 
     | 
| 
      
 1 
     | 
    
         
            +
            0.2.1
         
     | 
    
        data/lib/config.rb
    CHANGED
    
    
    
        data/lib/request.rb
    CHANGED
    
    | 
         @@ -17,7 +17,7 @@ module PaypalAdaptive 
     | 
|
| 
       17 
17 
     | 
    
         
             
                  @@ssl_cert_path ||= @@config.ssl_cert_path
         
     | 
| 
       18 
18 
     | 
    
         
             
                  @@ssl_cert_file ||= @@config.ssl_cert_file
         
     | 
| 
       19 
19 
     | 
    
         
             
                end
         
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
       21 
21 
     | 
    
         
             
                def validate
         
     | 
| 
       22 
22 
     | 
    
         
             
                  #TODO the receiverList field not validating properly
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
         @@ -33,7 +33,14 @@ module PaypalAdaptive 
     | 
|
| 
       33 
33 
     | 
    
         
             
                  response_data = call_api(data, "/AdaptivePayments/Pay")
         
     | 
| 
       34 
34 
     | 
    
         
             
                  PaypalAdaptive::Response.new(response_data, @env)
         
     | 
| 
       35 
35 
     | 
    
         
             
                end
         
     | 
| 
       36 
     | 
    
         
            -
             
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
                def set_payment_options(data)
         
     | 
| 
      
 38 
     | 
    
         
            +
                  raise NoDataError unless data
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                  response_data = call_api(data, "/AdaptivePayments/SetPaymentOptions")
         
     | 
| 
      
 41 
     | 
    
         
            +
                  PaypalAdaptive::Response.new(response_data, @env)
         
     | 
| 
      
 42 
     | 
    
         
            +
                end
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
       37 
44 
     | 
    
         
             
                def payment_details(data)
         
     | 
| 
       38 
45 
     | 
    
         
             
                  raise NoDataError unless data
         
     | 
| 
       39 
46 
     | 
    
         | 
| 
         @@ -87,4 +94,4 @@ module PaypalAdaptive 
     | 
|
| 
       87 
94 
     | 
    
         
             
                end
         
     | 
| 
       88 
95 
     | 
    
         
             
              end
         
     | 
| 
       89 
96 
     | 
    
         | 
| 
       90 
     | 
    
         
            -
            end
         
     | 
| 
      
 97 
     | 
    
         
            +
            end
         
     | 
    
        data/paypal_adaptive.gemspec
    CHANGED
    
    | 
         @@ -5,11 +5,11 @@ 
     | 
|
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            Gem::Specification.new do |s|
         
     | 
| 
       7 
7 
     | 
    
         
             
              s.name = %q{paypal_adaptive}
         
     | 
| 
       8 
     | 
    
         
            -
              s.version = "0.2. 
     | 
| 
      
 8 
     | 
    
         
            +
              s.version = "0.2.1"
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         
     | 
| 
       11 
11 
     | 
    
         
             
              s.authors = ["Tommy Chheng"]
         
     | 
| 
       12 
     | 
    
         
            -
              s.date = %q{2011- 
     | 
| 
      
 12 
     | 
    
         
            +
              s.date = %q{2011-05-21}
         
     | 
| 
       13 
13 
     | 
    
         
             
              s.description = %q{Lightweight wrapper for Paypal's Adaptive Payments API.}
         
     | 
| 
       14 
14 
     | 
    
         
             
              s.email = %q{tommy.chheng@gmail.com}
         
     | 
| 
       15 
15 
     | 
    
         
             
              s.extra_rdoc_files = [
         
     | 
| 
         @@ -31,7 +31,6 @@ Gem::Specification.new do |s| 
     | 
|
| 
       31 
31 
     | 
    
         
             
                "lib/response.rb",
         
     | 
| 
       32 
32 
     | 
    
         
             
                "paypal_adaptive.gemspec",
         
     | 
| 
       33 
33 
     | 
    
         
             
                "templates/paypal_ipn.rb",
         
     | 
| 
       34 
     | 
    
         
            -
                "test/data/dummy_cacert.pem",
         
     | 
| 
       35 
34 
     | 
    
         
             
                "test/data/invalid_chain_pay_request.json",
         
     | 
| 
       36 
35 
     | 
    
         
             
                "test/data/invalid_parallel_pay_request.json",
         
     | 
| 
       37 
36 
     | 
    
         
             
                "test/data/invalid_preapproval.json",
         
     | 
    
        data/test/unit/config_test.rb
    CHANGED
    
    | 
         @@ -1,15 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require 'test_helper'
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            class ConfigTest < Test::Unit::TestCase
         
     | 
| 
       4 
     | 
    
         
            -
              def  
     | 
| 
       5 
     | 
    
         
            -
                @config = PaypalAdaptive::Config.new("test", { "ssl_cert_file" => "" })
         
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
                assert_equal  
     | 
| 
      
 4 
     | 
    
         
            +
              def test_set_ssl_cert_file
         
     | 
| 
      
 5 
     | 
    
         
            +
                @config = PaypalAdaptive::Config.new("test", { "ssl_cert_file" => "/path/to/cacert.pem" })
         
     | 
| 
      
 6 
     | 
    
         
            +
                assert_equal "/path/to/cacert.pem", @config.ssl_cert_file
         
     | 
| 
      
 7 
     | 
    
         
            +
                assert_equal nil, @config.ssl_cert_path
         
     | 
| 
       8 
8 
     | 
    
         
             
              end
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
     | 
    
         
            -
              def  
     | 
| 
       11 
     | 
    
         
            -
                @config = PaypalAdaptive::Config.new("test", { "ssl_cert_file" => " 
     | 
| 
       12 
     | 
    
         
            -
                 
     | 
| 
      
 10 
     | 
    
         
            +
              def test_default_ssl_cert_file
         
     | 
| 
      
 11 
     | 
    
         
            +
                @config = PaypalAdaptive::Config.new("test", { "ssl_cert_file" => "" })
         
     | 
| 
      
 12 
     | 
    
         
            +
                assert File.exists?(@config.ssl_cert_file)
         
     | 
| 
       13 
13 
     | 
    
         
             
                assert_equal nil, @config.ssl_cert_path
         
     | 
| 
       14 
14 
     | 
    
         
             
              end
         
     | 
| 
       15 
15 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: paypal_adaptive
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.2. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.1
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -9,12 +9,12 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2011- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2011-05-21 00:00:00.000000000 -07:00
         
     | 
| 
       13 
13 
     | 
    
         
             
            default_executable: 
         
     | 
| 
       14 
14 
     | 
    
         
             
            dependencies:
         
     | 
| 
       15 
15 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       16 
16 
     | 
    
         
             
              name: json
         
     | 
| 
       17 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 17 
     | 
    
         
            +
              requirement: &2153461880 !ruby/object:Gem::Requirement
         
     | 
| 
       18 
18 
     | 
    
         
             
                none: false
         
     | 
| 
       19 
19 
     | 
    
         
             
                requirements:
         
     | 
| 
       20 
20 
     | 
    
         
             
                - - ! '>='
         
     | 
| 
         @@ -22,10 +22,10 @@ dependencies: 
     | 
|
| 
       22 
22 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       23 
23 
     | 
    
         
             
              type: :development
         
     | 
| 
       24 
24 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       25 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 25 
     | 
    
         
            +
              version_requirements: *2153461880
         
     | 
| 
       26 
26 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       27 
27 
     | 
    
         
             
              name: jsonschema
         
     | 
| 
       28 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 28 
     | 
    
         
            +
              requirement: &2153461300 !ruby/object:Gem::Requirement
         
     | 
| 
       29 
29 
     | 
    
         
             
                none: false
         
     | 
| 
       30 
30 
     | 
    
         
             
                requirements:
         
     | 
| 
       31 
31 
     | 
    
         
             
                - - ! '>='
         
     | 
| 
         @@ -33,7 +33,7 @@ dependencies: 
     | 
|
| 
       33 
33 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       34 
34 
     | 
    
         
             
              type: :development
         
     | 
| 
       35 
35 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       36 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 36 
     | 
    
         
            +
              version_requirements: *2153461300
         
     | 
| 
       37 
37 
     | 
    
         
             
            description: Lightweight wrapper for Paypal's Adaptive Payments API.
         
     | 
| 
       38 
38 
     | 
    
         
             
            email: tommy.chheng@gmail.com
         
     | 
| 
       39 
39 
     | 
    
         
             
            executables: []
         
     | 
| 
         @@ -56,7 +56,6 @@ files: 
     | 
|
| 
       56 
56 
     | 
    
         
             
            - lib/response.rb
         
     | 
| 
       57 
57 
     | 
    
         
             
            - paypal_adaptive.gemspec
         
     | 
| 
       58 
58 
     | 
    
         
             
            - templates/paypal_ipn.rb
         
     | 
| 
       59 
     | 
    
         
            -
            - test/data/dummy_cacert.pem
         
     | 
| 
       60 
59 
     | 
    
         
             
            - test/data/invalid_chain_pay_request.json
         
     | 
| 
       61 
60 
     | 
    
         
             
            - test/data/invalid_parallel_pay_request.json
         
     | 
| 
       62 
61 
     | 
    
         
             
            - test/data/invalid_preapproval.json
         
     | 
    
        data/test/data/dummy_cacert.pem
    DELETED
    
    | 
         @@ -1 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # Dummy file for testing.
         
     |