Sha256: a5c0d2a4865018a2b543263e04dd7c651b3b309fe5c8794f2004e2c664789ac7

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

module Killbill #:nodoc:
  module PaypalExpress #:nodoc:
    class PaypalExpressPaymentMethod < ::Killbill::Plugin::ActiveMerchant::ActiveRecord::PaymentMethod

      self.table_name = 'paypal_express_payment_methods'

      def self.from_response(kb_account_id, kb_payment_method_id, kb_tenant_id, cc_or_token, response, options, extra_params = {}, model = ::Killbill::PaypalExpress::PaypalExpressPaymentMethod)
        super(kb_account_id,
              kb_payment_method_id,
              kb_tenant_id,
              cc_or_token,
              response,
              options,
              {
                  :paypal_express_token    => options[:paypal_express_token],
                  :paypal_express_payer_id => options[:paypal_express_payer_id],
              }.merge!(extra_params),
              model)
      end

      def to_payment_method_plugin
        pm_plugin = super

        pm_plugin.properties << create_pm_kv_info('paypalExpressToken', paypal_express_token)
        pm_plugin.properties << create_pm_kv_info('payerId', paypal_express_payer_id)
        pm_plugin.properties << create_pm_kv_info('baid', token)

        pm_plugin
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
killbill-paypal-express-1.8.1 lib/paypal_express/models/payment_method.rb
killbill-paypal-express-1.8.0 lib/paypal_express/models/payment_method.rb
killbill-paypal-express-1.7.1 lib/paypal_express/models/payment_method.rb