Sha256: 71e00d0eea8a3da7cd228815ac3fe7bbf5be5b6ae00f39b5a81fa4419cd65709

Contents?: true

Size: 1.94 KB

Versions: 15

Compression:

Stored size: 1.94 KB

Contents

require 'killbill/response/payment_method_response_internal'
require 'killbill/jresponse/jconverter'

module Killbill
  module Plugin

    java_package 'com.ning.billing.payment.plugin.api'
    class JPaymentMethodResponseInternal

      include Java::com.ning.billing.payment.plugin.api.PaymentMethodInfoPlugin
      attr_reader :kb_account_id,
                   :kb_payment_method_id,
                   :is_default
                   :external_payment_method_id

      class << self
        def to_payment_method_response_internal(jinfo)
          account_id = JConverter.from_uuid(jinfo.get_account_id)
          payment_method_id = JConverter.from_uuid(jinfo.get_payment_method_id)
          is_default = JConverter.from_boolean(jinfo.is_default)
          external_payment_method_id = JConverter.from_string(jinfo.get_external_payment_method_id)
          PaymentMethodResponseInternal.new(account_id, payment_method_id, is_default, external_payment_method_id)
        end
      end

      def initialize(payment_method_response_internal)
        @kb_account_id = JConverter.to_uuid(payment_method_response_internal.kb_account_id)
        @kb_payment_method_id = JConverter.to_uuid(payment_method_response_internal.kb_payment_method_id)
        @is_default = JConverter.to_boolean(payment_method_response_internal.is_default)
        @external_payment_method_id = JConverter.to_string(payment_method_response_internal.external_payment_method_id)
      end

      java_signature 'java.lang.UUID getAccountId()'
      def get_account_id
        @kb_account_id
      end

      java_signature 'java.lang.UUID getPaymentMethodId()'
      def get_payment_method_id
        @kb_payment_method_id
      end

      java_signature 'java.lang.Boolean isDefault()'
      def is_default
        @is_default
      end

      java_signature 'java.lang.String getExternalPaymentMethodId()'
      def get_external_payment_method_id
        @external_payment_method_id
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
killbill-1.0.15 lib/killbill/jresponse/jpayment_method_response_internal.rb
killbill-1.0.14 lib/killbill/jresponse/jpayment_method_response_internal.rb
killbill-1.0.13 lib/killbill/jresponse/jpayment_method_response_internal.rb
killbill-1.0.12 lib/killbill/jresponse/jpayment_method_response_internal.rb
killbill-1.0.11 lib/killbill/jresponse/jpayment_method_response_internal.rb
killbill-1.0.10 lib/killbill/jresponse/jpayment_method_response_internal.rb
killbill-1.0.9 lib/killbill/jresponse/jpayment_method_response_internal.rb
killbill-1.0.8 lib/killbill/jresponse/jpayment_method_response_internal.rb
killbill-1.0.7 lib/killbill/jresponse/jpayment_method_response_internal.rb
killbill-1.0.6 lib/killbill/jresponse/jpayment_method_response_internal.rb
killbill-1.0.5 lib/killbill/jresponse/jpayment_method_response_internal.rb
killbill-1.0.4 lib/killbill/jresponse/jpayment_method_response_internal.rb
killbill-1.0.3 lib/killbill/jresponse/jpayment_method_response_internal.rb
killbill-1.0.2 lib/killbill/jresponse/jpayment_method_response_internal.rb
killbill-1.0.1 lib/killbill/jresponse/jpayment_method_response_internal.rb