Sha256: e8c74c40b5a1c4233475f303481190b3756ce5d1de200dd1e59ef0f9898ebeaf

Contents?: true

Size: 673 Bytes

Versions: 2

Compression:

Stored size: 673 Bytes

Contents

module Spree
  class Gateway::UsaEpay < Gateway
    preference :source_key, :string
    preference :pin, :string

    def provider_class
      SpreeUsaEpay::Client
    end

    def payment_profiles_supported?
      true
    end

    def create_profile(payment)
      amount = (payment.amount * 100).round
      creditcard = payment.source
      if creditcard.gateway_customer_profile_id.nil?
        profile_id = provider.add_customer(amount, creditcard, creditcard.gateway_options(payment))
        creditcard.update_attributes(:gateway_customer_profile_id => profile_id,
                                     :gateway_payment_profile_id => 0)
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_usa_epay-1.0.1 app/models/spree/gateway/usa_epay.rb
spree_usa_epay-1.0.0 app/models/spree/gateway/usa_epay.rb