Sha256: dad043da4ce1dcfb9ec63a6affee5a93e101e719c670ad12812845f53860662f

Contents?: true

Size: 1.75 KB

Versions: 8

Compression:

Stored size: 1.75 KB

Contents

require 'killbill/response/refund_response'
require 'killbill/jresponse/jconverter'

module Killbill
  module Plugin

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

      include Java::com.ning.billing.payment.plugin.api.RefundInfoPlugin

      attr_reader :amount,
                  :created_date,
                  :effective_date,
                  :status,
                  :gateway_error,
                  :gateway_error_code

      def initialize(refund_response)
        @amount = JConverter.to_big_decimal(refund_response.amount_in_cents)
        @created_date = JConverter.to_joda_date_time(refund_response.created_date)
        @effective_date = JConverter.to_joda_date_time(refund_response.effective_date)
        @status = JConverter.to_payment_plugin_status(refund_response.status)
        @gateway_error = JConverter.to_string(refund_response.gateway_error)
        @gateway_error_code = JConverter.to_string(refund_response.gateway_error_code)
      end


      java_signature 'java.math.BigDecimal getAmount()'
      def get_amount
        @amount
      end

      java_signature 'org.joda.time.DateTime getCreatedDate()'
      def get_created_date
        @created_date
      end

      java_signature 'org.joda.time.DateTime getEffectiveDate()'
      def get_effective_date
        @effective_date
      end

      java_signature 'Java::com.ning.billing.payment.plugin.api.PaymentInfoPlugin::PaymentPluginStatus getStatus()'
      def get_status
        @status
      end

      java_signature 'java.lang.String getGatewayError()'
      def get_gateway_error
        @gateway_error
      end

      java_signature 'java.lang.String getGatewayErrorCode()'
      def get_gateway_error_code
        @gateway_error_code
      end
   end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
killbill-1.0.8 lib/killbill/jresponse/jrefund_response.rb
killbill-1.0.7 lib/killbill/jresponse/jrefund_response.rb
killbill-1.0.6 lib/killbill/jresponse/jrefund_response.rb
killbill-1.0.5 lib/killbill/jresponse/jrefund_response.rb
killbill-1.0.4 lib/killbill/jresponse/jrefund_response.rb
killbill-1.0.3 lib/killbill/jresponse/jrefund_response.rb
killbill-1.0.2 lib/killbill/jresponse/jrefund_response.rb
killbill-1.0.1 lib/killbill/jresponse/jrefund_response.rb