Class ActiveMerchant::Billing::PayflowGateway
In: lib/active_merchant/billing/gateways/payflow.rb
Parent: Gateway

Methods

Included Modules

PayflowCommonAPI

Constants

RECURRING_ACTIONS = Set.new([:add, :modify, :cancel, :inquiry, :reactivate, :payment])

Public Instance methods

[Source]

    # File lib/active_merchant/billing/gateways/payflow.rb, line 16
16:       def authorize(money, credit_card_or_reference, options = {})
17:         request = build_sale_or_authorization_request(:authorization, money, credit_card_or_reference, options)
18:       
19:         commit(request)
20:       end

[Source]

    # File lib/active_merchant/billing/gateways/payflow.rb, line 60
60:       def cancel_recurring(profile_id)
61:         request = build_recurring_request(:cancel, 0, :profile_id => profile_id)
62:         commit(request, :recurring)
63:       end

[Source]

    # File lib/active_merchant/billing/gateways/payflow.rb, line 28
28:       def credit(money, identification_or_credit_card, options = {})
29:         if identification_or_credit_card.is_a?(String)
30:           # Perform referenced credit
31:           request = build_reference_request(:credit, money, identification_or_credit_card, options)
32:         else
33:           # Perform non-referenced credit
34:           request = build_credit_card_request(:credit, money, identification_or_credit_card, options)
35:         end
36:         
37:         commit(request)
38:       end

[Source]

    # File lib/active_merchant/billing/gateways/payflow.rb, line 70
70:       def express
71:         @express ||= PayflowExpressGateway.new(@options)
72:       end

[Source]

    # File lib/active_merchant/billing/gateways/payflow.rb, line 22
22:       def purchase(money, credit_card_or_reference, options = {})
23:         request = build_sale_or_authorization_request(:purchase, money, credit_card_or_reference, options)
24: 
25:         commit(request)
26:       end

Adds or modifies a recurring Payflow profile. See the Payflow Pro Recurring Billing Guide for more details: www.paypal.com/en_US/pdf/PayflowPro_RecurringBilling_Guide.pdf

Several options are available to customize the recurring profile:

  • profile_id - is only required for editing a recurring profile
  • starting_at - takes a Date, Time, or string in mmddyyyy format. The date must be in the future.
  • name - The name of the customer to be billed. If not specified, the name from the credit card is used.
  • periodicity - The frequency that the recurring payments will occur at. Can be one of

:bimonthly, :monthly, :biweekly, :weekly, :yearly, :daily, :semimonthly, :quadweekly, :quarterly, :semiyearly

  • payments - The term, or number of payments that will be made
  • comment - A comment associated with the profile

[Source]

    # File lib/active_merchant/billing/gateways/payflow.rb, line 52
52:       def recurring(money, credit_card, options = {})
53:         options[:name] = credit_card.name if options[:name].blank? && credit_card
54:         request = build_recurring_request(options[:profile_id] ? :modify : :add, money, options) do |xml|
55:           add_credit_card(xml, credit_card) if credit_card
56:         end
57:         commit(request, :recurring)
58:       end

[Source]

    # File lib/active_merchant/billing/gateways/payflow.rb, line 65
65:       def recurring_inquiry(profile_id, options = {})
66:         request = build_recurring_request(:inquiry, nil, options.update( :profile_id => profile_id ))
67:         commit(request, :recurring)
68:       end

[Validate]