Class: Killbill::PaypalExpress::PaypalExpressPaymentMethod

Inherits:
Killbill::Plugin::ActiveMerchant::ActiveRecord::PaymentMethod
  • Object
show all
Defined in:
lib/paypal_express/models/payment_method.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_response(kb_account_id, kb_payment_method_id, kb_tenant_id, cc_or_token, response, options, extra_params = {}, model = ::Killbill::PaypalExpress::PaypalExpressPaymentMethod) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/paypal_express/models/payment_method.rb', line 7

def self.from_response(, kb_payment_method_id, kb_tenant_id, cc_or_token, response, options, extra_params = {}, model = ::Killbill::PaypalExpress::PaypalExpressPaymentMethod)
  super(,
        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

Instance Method Details

#to_payment_method_pluginObject



21
22
23
24
25
26
27
28
29
# File 'lib/paypal_express/models/payment_method.rb', line 21

def to_payment_method_plugin
  pm_plugin = super

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

  pm_plugin
end