Sha256: d2462539cf793cb46415db3566165bd963b47efb8b8af959da4383b7a4dbd25e

Contents?: true

Size: 682 Bytes

Versions: 4

Compression:

Stored size: 682 Bytes

Contents

module Spree
  class PaymentMethod::Paypal < PaymentMethod
    preference :client_id, :string
    preference :client_secret, :string
    preference :sandbox, :boolean, default: true # Default to sandbox mode

    def payment_source_class
      Spree::Paypal
    end

    def actions
      %w{capture void}
    end

    def auto_capture?
      true
    end

    def supports?(source)
      source.payment_method.is_a?(Spree::PaymentMethod::Paypal)
    end

    def provider_class
      ::PaypalService
    end

    def client_id
      preferred_client_id
    end

    def client_secret
      preferred_client_secret
    end

    def sandbox?
      preferred_sandbox
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spree_paypal-1.0.0 app/models/spree/payment_method/paypal.rb
spree_paypal-0.1.2 app/models/spree/payment_method/paypal.rb
spree_paypal-0.1.1 app/models/spree/payment_method/paypal.rb
spree_paypal-0.1.0 app/models/spree/payment_method/paypal.rb