killbill 1.0.9 → 1.0.10
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/VERSION +1 -1
- data/lib/killbill/jpayment.rb +9 -7
- data/lib/killbill/payment.rb +6 -6
- data/spec/killbill/payment_plugin_spec.rb +13 -12
- metadata +19 -19
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            1.0. | 
| 1 | 
            +
            1.0.10
         | 
    
        data/lib/killbill/jpayment.rb
    CHANGED
    
    | @@ -38,21 +38,21 @@ module Killbill | |
| 38 38 | 
             
                  def get_name
         | 
| 39 39 | 
             
                  end
         | 
| 40 40 |  | 
| 41 | 
            -
                  java_signature 'com.ning.billing.payment.plugin.api.PaymentInfoPlugin processPayment(java.util.UUID, java.util.UUID, java.lang.BigDecimal, com.ning.billing.util.callcontext.CallContext)'
         | 
| 41 | 
            +
                  java_signature 'com.ning.billing.payment.plugin.api.PaymentInfoPlugin processPayment(java.util.UUID, java.util.UUID, java.util.UUID, java.lang.BigDecimal, com.ning.billing.catalog.api.Currency, com.ning.billing.util.callcontext.CallContext)'
         | 
| 42 42 | 
             
                  def process_payment(*args)
         | 
| 43 43 | 
             
                    do_call_handle_exception(__method__, *args) do |res|
         | 
| 44 44 | 
             
                      return JPaymentResponse.new(res)
         | 
| 45 45 | 
             
                    end
         | 
| 46 46 | 
             
                  end
         | 
| 47 47 |  | 
| 48 | 
            -
                  java_signature 'Java::com.ning.billing.payment.plugin.api.PaymentInfoPlugin getPaymentInfo(java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
         | 
| 48 | 
            +
                  java_signature 'Java::com.ning.billing.payment.plugin.api.PaymentInfoPlugin getPaymentInfo(java.util.UUID, java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
         | 
| 49 49 | 
             
                  def get_payment_info(*args)
         | 
| 50 50 | 
             
                    do_call_handle_exception(__method__, *args) do |res|
         | 
| 51 51 | 
             
                      return JPaymentResponse.new(res)
         | 
| 52 52 | 
             
                    end
         | 
| 53 53 | 
             
                  end
         | 
| 54 54 |  | 
| 55 | 
            -
                  java_signature 'Java::com.ning.billing.payment.plugin.api.RefundInfoPlugin processRefund(java.util.UUID, java.lang.BigDecimal, Java::com.ning.billing.util.callcontext.CallContext)'
         | 
| 55 | 
            +
                  java_signature 'Java::com.ning.billing.payment.plugin.api.RefundInfoPlugin processRefund(java.util.UUID, java.util.UUID, java.lang.BigDecimal, com.ning.billing.catalog.api.Currency, Java::com.ning.billing.util.callcontext.CallContext)'
         | 
| 56 56 | 
             
                  def process_refund(*args)
         | 
| 57 57 | 
             
                    do_call_handle_exception(__method__, *args) do |res|
         | 
| 58 58 | 
             
                      return JRefundResponse.new(res)
         | 
| @@ -66,7 +66,7 @@ module Killbill | |
| 66 66 | 
             
                    end
         | 
| 67 67 | 
             
                  end
         | 
| 68 68 |  | 
| 69 | 
            -
                  java_signature 'void deletePaymentMethod(java.util.UUID, Java::com.ning.billing.util.callcontext.CallContext)'
         | 
| 69 | 
            +
                  java_signature 'void deletePaymentMethod(java.util.UUID, java.util.UUID, Java::com.ning.billing.util.callcontext.CallContext)'
         | 
| 70 70 | 
             
                  def delete_payment_method(*args)
         | 
| 71 71 | 
             
                    do_call_handle_exception(__method__, *args) do |res|
         | 
| 72 72 | 
             
                      return nil
         | 
| @@ -80,14 +80,14 @@ module Killbill | |
| 80 80 | 
             
                    end
         | 
| 81 81 | 
             
                  end
         | 
| 82 82 |  | 
| 83 | 
            -
                  java_signature 'void setDefaultPaymentMethod(java.util.UUID  | 
| 83 | 
            +
                  java_signature 'void setDefaultPaymentMethod(java.util.UUID, java.util.UUID, Java::com.ning.billing.util.callcontext.CallContext)'
         | 
| 84 84 | 
             
                  def set_default_payment_method(*args)
         | 
| 85 85 | 
             
                    do_call_handle_exception(__method__, *args) do |res|
         | 
| 86 86 | 
             
                      return nil
         | 
| 87 87 | 
             
                    end
         | 
| 88 88 | 
             
                  end
         | 
| 89 89 |  | 
| 90 | 
            -
                  java_signature 'java.util.List getPaymentMethods(java.util.UUID, Java::boolean | 
| 90 | 
            +
                  java_signature 'java.util.List getPaymentMethods(java.util.UUID, Java::boolean, Java::com.ning.billing.util.callcontext.CallContext)'
         | 
| 91 91 | 
             
                  def get_payment_methods(*args)
         | 
| 92 92 | 
             
                    do_call_handle_exception(__method__, *args) do |res|
         | 
| 93 93 | 
             
                      array_res = java.util.ArrayList.new
         | 
| @@ -98,7 +98,7 @@ module Killbill | |
| 98 98 | 
             
                    end
         | 
| 99 99 | 
             
                  end
         | 
| 100 100 |  | 
| 101 | 
            -
                  java_signature 'void resetPaymentMethods(java.util.List)'
         | 
| 101 | 
            +
                  java_signature 'void resetPaymentMethods(java.util.UUID, java.util.List)'
         | 
| 102 102 | 
             
                  def reset_payment_methods(*args)
         | 
| 103 103 | 
             
                    do_call_handle_exception(__method__, *args) do |res|
         | 
| 104 104 | 
             
                      return nil
         | 
| @@ -130,6 +130,8 @@ module Killbill | |
| 130 130 | 
             
                       JConverter.from_uuid(a)
         | 
| 131 131 | 
             
                     elsif a.java_kind_of? java.math.BigDecimal
         | 
| 132 132 | 
             
                       JConverter.from_big_decimal(a)
         | 
| 133 | 
            +
                     elsif a.get_class.is_enum
         | 
| 134 | 
            +
                       a.nil? ? '' : a.to_string
         | 
| 133 135 | 
             
                     elsif a.java_kind_of? Java::com.ning.billing.payment.api.PaymentMethodPlugin
         | 
| 134 136 | 
             
                       JConverter.from_payment_method_plugin(a)
         | 
| 135 137 | 
             
                     elsif ((a.java_kind_of? Java::boolean) || (a.java_kind_of? java.lang.Boolean))
         | 
    
        data/lib/killbill/payment.rb
    CHANGED
    
    | @@ -16,15 +16,15 @@ module Killbill | |
| 16 16 | 
             
                    raise OperationUnsupportedByGatewayError
         | 
| 17 17 | 
             
                  end
         | 
| 18 18 |  | 
| 19 | 
            -
                  def process_payment(kb_payment_id, kb_payment_method_id, amount_in_cents, options = {})
         | 
| 19 | 
            +
                  def process_payment(kb_account_id, kb_payment_id, kb_payment_method_id, amount_in_cents, currency, options = {})
         | 
| 20 20 | 
             
                    raise OperationUnsupportedByGatewayError
         | 
| 21 21 | 
             
                  end
         | 
| 22 22 |  | 
| 23 | 
            -
                  def get_payment_info(kb_payment_id, options = {})
         | 
| 23 | 
            +
                  def get_payment_info(kb_account_id, kb_payment_id, options = {})
         | 
| 24 24 | 
             
                    raise OperationUnsupportedByGatewayError
         | 
| 25 25 | 
             
                  end
         | 
| 26 26 |  | 
| 27 | 
            -
                  def process_refund(kb_payment_id, amount_in_cents, options = {})
         | 
| 27 | 
            +
                  def process_refund(kb_account_id, kb_payment_id, amount_in_cents, currency, options = {})
         | 
| 28 28 | 
             
                    raise OperationUnsupportedByGatewayError
         | 
| 29 29 | 
             
                  end
         | 
| 30 30 |  | 
| @@ -32,7 +32,7 @@ module Killbill | |
| 32 32 | 
             
                    raise OperationUnsupportedByGatewayError
         | 
| 33 33 | 
             
                  end
         | 
| 34 34 |  | 
| 35 | 
            -
                  def delete_payment_method(kb_payment_method_id, options = {})
         | 
| 35 | 
            +
                  def delete_payment_method(kb_account_id, kb_payment_method_id, options = {})
         | 
| 36 36 | 
             
                    raise OperationUnsupportedByGatewayError
         | 
| 37 37 | 
             
                  end
         | 
| 38 38 |  | 
| @@ -40,7 +40,7 @@ module Killbill | |
| 40 40 | 
             
                    raise OperationUnsupportedByGatewayError
         | 
| 41 41 | 
             
                  end
         | 
| 42 42 |  | 
| 43 | 
            -
                  def set_default_payment_method(kb_payment_method_id, options = {})
         | 
| 43 | 
            +
                  def set_default_payment_method(kb_account_id, kb_payment_method_id, options = {})
         | 
| 44 44 | 
             
                    raise OperationUnsupportedByGatewayError
         | 
| 45 45 | 
             
                  end
         | 
| 46 46 |  | 
| @@ -48,7 +48,7 @@ module Killbill | |
| 48 48 | 
             
                    raise OperationUnsupportedByGatewayError
         | 
| 49 49 | 
             
                  end
         | 
| 50 50 |  | 
| 51 | 
            -
                  def reset_payment_methods(payment_methods)
         | 
| 51 | 
            +
                  def reset_payment_methods(kb_account_id, payment_methods)
         | 
| 52 52 | 
             
                    raise OperationUnsupportedByGatewayError
         | 
| 53 53 | 
             
                  end
         | 
| 54 54 | 
             
                end
         | 
| @@ -5,12 +5,13 @@ end | |
| 5 5 |  | 
| 6 6 | 
             
            describe Killbill::Plugin::Payment do
         | 
| 7 7 | 
             
              before(:each) do
         | 
| 8 | 
            -
                @ | 
| 9 | 
            -
                @ | 
| 8 | 
            +
                @kb_account_id = SecureRandom.uuid
         | 
| 9 | 
            +
                @kb_payment_id = SecureRandom.uuid
         | 
| 10 10 | 
             
                @amount_in_cents = rand(100000)
         | 
| 11 | 
            +
                @currency = 'USD'
         | 
| 11 12 |  | 
| 12 13 | 
             
                @payment_method = Hash.new(:credit_card => SecureRandom.uuid)
         | 
| 13 | 
            -
                @ | 
| 14 | 
            +
                @kb_payment_method_id = SecureRandom.uuid
         | 
| 14 15 |  | 
| 15 16 | 
             
                @payment_method_props = Hash.new
         | 
| 16 17 | 
             
                @payment_methods = Hash.new
         | 
| @@ -20,15 +21,15 @@ describe Killbill::Plugin::Payment do | |
| 20 21 | 
             
              end
         | 
| 21 22 |  | 
| 22 23 | 
             
              it "should raise exceptions for unsupported operations" do
         | 
| 23 | 
            -
                lambda { @plugin.process_payment(@ | 
| 24 | 
            -
                lambda { @plugin.process_refund(@ | 
| 25 | 
            -
                lambda { @plugin.get_payment_info(@ | 
| 26 | 
            -
                lambda { @plugin.add_payment_method(@ | 
| 27 | 
            -
                lambda { @plugin.delete_payment_method(@ | 
| 28 | 
            -
                lambda { @plugin.set_default_payment_method(@ | 
| 24 | 
            +
                lambda { @plugin.process_payment(@kb_account_id, @kb_payment_id, @kb_payment_method_id, @amount_in_cents, @currency) }.should raise_error Killbill::Plugin::Payment::OperationUnsupportedByGatewayError
         | 
| 25 | 
            +
                lambda { @plugin.process_refund(@kb_account_id, @kb_payment_id, @amount_in_cents, @currency) }.should raise_error Killbill::Plugin::Payment::OperationUnsupportedByGatewayError
         | 
| 26 | 
            +
                lambda { @plugin.get_payment_info(@kb_account_id, @kb_payment_id) }.should raise_error Killbill::Plugin::Payment::OperationUnsupportedByGatewayError
         | 
| 27 | 
            +
                lambda { @plugin.add_payment_method(@kb_account_id, @payment_method, @payment_method_props, true ) }.should raise_error Killbill::Plugin::Payment::OperationUnsupportedByGatewayError
         | 
| 28 | 
            +
                lambda { @plugin.delete_payment_method(@kb_account_id, @kb_payment_method_id) }.should raise_error Killbill::Plugin::Payment::OperationUnsupportedByGatewayError
         | 
| 29 | 
            +
                lambda { @plugin.set_default_payment_method(@kb_account_id, @payment_method) }.should raise_error Killbill::Plugin::Payment::OperationUnsupportedByGatewayError
         | 
| 29 30 |  | 
| 30 | 
            -
                lambda { @plugin.get_payment_method_detail(@ | 
| 31 | 
            -
                lambda { @plugin.get_payment_methods(@ | 
| 32 | 
            -
                lambda { @plugin.reset_payment_methods(@payment_methods) }.should raise_error Killbill::Plugin::Payment::OperationUnsupportedByGatewayError
         | 
| 31 | 
            +
                lambda { @plugin.get_payment_method_detail(@kb_account_id, @payment_method) }.should raise_error Killbill::Plugin::Payment::OperationUnsupportedByGatewayError
         | 
| 32 | 
            +
                lambda { @plugin.get_payment_methods(@kb_account_id, true) }.should raise_error Killbill::Plugin::Payment::OperationUnsupportedByGatewayError
         | 
| 33 | 
            +
                lambda { @plugin.reset_payment_methods(@kb_account_id, @payment_methods) }.should raise_error Killbill::Plugin::Payment::OperationUnsupportedByGatewayError
         | 
| 33 34 | 
             
              end
         | 
| 34 35 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,27 +1,27 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: killbill
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            +
              version: 1.0.10
         | 
| 4 5 | 
             
              prerelease:
         | 
| 5 | 
            -
              version: 1.0.9
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| 8 8 | 
             
            - Killbill core team
         | 
| 9 9 | 
             
            autorequire:
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2013-03- | 
| 12 | 
            +
            date: 2013-03-26 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: jbundler
         | 
| 16 16 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 17 17 | 
             
                requirements:
         | 
| 18 | 
            -
                - -  | 
| 18 | 
            +
                - - ~>
         | 
| 19 19 | 
             
                  - !ruby/object:Gem::Version
         | 
| 20 20 | 
             
                    version: 0.4.1
         | 
| 21 21 | 
             
                none: false
         | 
| 22 22 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 23 23 | 
             
                requirements:
         | 
| 24 | 
            -
                - -  | 
| 24 | 
            +
                - - ~>
         | 
| 25 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 26 | 
             
                    version: 0.4.1
         | 
| 27 27 | 
             
                none: false
         | 
| @@ -31,13 +31,13 @@ dependencies: | |
| 31 31 | 
             
              name: rack
         | 
| 32 32 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 33 33 | 
             
                requirements:
         | 
| 34 | 
            -
                - -  | 
| 34 | 
            +
                - - ! '>='
         | 
| 35 35 | 
             
                  - !ruby/object:Gem::Version
         | 
| 36 36 | 
             
                    version: 1.5.2
         | 
| 37 37 | 
             
                none: false
         | 
| 38 38 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 39 39 | 
             
                requirements:
         | 
| 40 | 
            -
                - -  | 
| 40 | 
            +
                - - ! '>='
         | 
| 41 41 | 
             
                  - !ruby/object:Gem::Version
         | 
| 42 42 | 
             
                    version: 1.5.2
         | 
| 43 43 | 
             
                none: false
         | 
| @@ -47,13 +47,13 @@ dependencies: | |
| 47 47 | 
             
              name: rake
         | 
| 48 48 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 49 49 | 
             
                requirements:
         | 
| 50 | 
            -
                - -  | 
| 50 | 
            +
                - - ! '>='
         | 
| 51 51 | 
             
                  - !ruby/object:Gem::Version
         | 
| 52 52 | 
             
                    version: 0.8.7
         | 
| 53 53 | 
             
                none: false
         | 
| 54 54 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 55 55 | 
             
                requirements:
         | 
| 56 | 
            -
                - -  | 
| 56 | 
            +
                - - ! '>='
         | 
| 57 57 | 
             
                  - !ruby/object:Gem::Version
         | 
| 58 58 | 
             
                    version: 0.8.7
         | 
| 59 59 | 
             
                none: false
         | 
| @@ -63,13 +63,13 @@ dependencies: | |
| 63 63 | 
             
              name: rspec
         | 
| 64 64 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 65 | 
             
                requirements:
         | 
| 66 | 
            -
                - -  | 
| 66 | 
            +
                - - ~>
         | 
| 67 67 | 
             
                  - !ruby/object:Gem::Version
         | 
| 68 68 | 
             
                    version: 2.12.0
         | 
| 69 69 | 
             
                none: false
         | 
| 70 70 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 71 71 | 
             
                requirements:
         | 
| 72 | 
            -
                - -  | 
| 72 | 
            +
                - - ~>
         | 
| 73 73 | 
             
                  - !ruby/object:Gem::Version
         | 
| 74 74 | 
             
                    version: 2.12.0
         | 
| 75 75 | 
             
                none: false
         | 
| @@ -79,13 +79,13 @@ dependencies: | |
| 79 79 | 
             
              name: sinatra
         | 
| 80 80 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 81 81 | 
             
                requirements:
         | 
| 82 | 
            -
                - -  | 
| 82 | 
            +
                - - ~>
         | 
| 83 83 | 
             
                  - !ruby/object:Gem::Version
         | 
| 84 84 | 
             
                    version: 1.3.4
         | 
| 85 85 | 
             
                none: false
         | 
| 86 86 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 87 87 | 
             
                requirements:
         | 
| 88 | 
            -
                - -  | 
| 88 | 
            +
                - - ~>
         | 
| 89 89 | 
             
                  - !ruby/object:Gem::Version
         | 
| 90 90 | 
             
                    version: 1.3.4
         | 
| 91 91 | 
             
                none: false
         | 
| @@ -97,8 +97,8 @@ executables: [] | |
| 97 97 | 
             
            extensions: []
         | 
| 98 98 | 
             
            extra_rdoc_files: []
         | 
| 99 99 | 
             
            files:
         | 
| 100 | 
            -
            -  | 
| 101 | 
            -
            -  | 
| 100 | 
            +
            - .gitignore
         | 
| 101 | 
            +
            - .travis.yml
         | 
| 102 102 | 
             
            - Gemfile
         | 
| 103 103 | 
             
            - Jarfile
         | 
| 104 104 | 
             
            - README.md
         | 
| @@ -144,25 +144,25 @@ licenses: | |
| 144 144 | 
             
            - Apache License (2.0)
         | 
| 145 145 | 
             
            post_install_message:
         | 
| 146 146 | 
             
            rdoc_options:
         | 
| 147 | 
            -
            -  | 
| 148 | 
            -
            -  | 
| 147 | 
            +
            - --exclude
         | 
| 148 | 
            +
            - .
         | 
| 149 149 | 
             
            require_paths:
         | 
| 150 150 | 
             
            - lib
         | 
| 151 151 | 
             
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 152 152 | 
             
              requirements:
         | 
| 153 | 
            -
              - -  | 
| 153 | 
            +
              - - ! '>='
         | 
| 154 154 | 
             
                - !ruby/object:Gem::Version
         | 
| 155 155 | 
             
                  version: 1.9.3
         | 
| 156 156 | 
             
              none: false
         | 
| 157 157 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 158 158 | 
             
              requirements:
         | 
| 159 | 
            -
              - -  | 
| 159 | 
            +
              - - ! '>='
         | 
| 160 160 | 
             
                - !ruby/object:Gem::Version
         | 
| 161 161 | 
             
                  segments:
         | 
| 162 162 | 
             
                  - 0
         | 
| 163 | 
            -
                  hash: 2
         | 
| 164 163 | 
             
                  version: !binary |-
         | 
| 165 164 | 
             
                    MA==
         | 
| 165 | 
            +
                  hash: 2
         | 
| 166 166 | 
             
              none: false
         | 
| 167 167 | 
             
            requirements:
         | 
| 168 168 | 
             
            - jar 'com.ning.billing:killbill-api'
         |