Sha256: c6e02f037d76dc4fe0442210d4e7f67031ea52806563fa3235aaadd63d845372

Contents?: true

Size: 1.05 KB

Versions: 3

Compression:

Stored size: 1.05 KB

Contents

module Opay
  module Helpers

    module FormHelper

      def opay_form_for(record, options = {}, &block)
        # for future purposes
        @payment_provider = options[:provider]

        raise ArgumentError, 'Empty payment provider' if @payment_provider.blank? || Opay.config.providers.include?(@payment_provider) == false

        case @payment_provider
        when :payu
          return payu_form_for(record, options, &block)
        when :transferuj
          return transferuj_form_for(record, options, &block)
        when :paypal
          return paypal_form_for(record, options, &block)
        end

      end

      def payment_info(options = {})
        raise ArgumentError, 'Empty payment provider' if @options[:provider].blank? || Opay.config.providers.include?(@options[:provider]) == false

        case @options[:provider]
        when :payu
          payu_payment_info(options)
        when :transferuj
          transferuj_payment_info(options)
        when :paypal
          paypal_payment_info(options)
        end
      end

    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opay-1.3.2 lib/opay/helpers/form_helper.rb
opay-1.3.1 lib/opay/helpers/form_helper.rb
opay-1.3.0 lib/opay/helpers/form_helper.rb