Class: ActiveMerchant::Billing::PayflowGateway
- Includes:
- PayflowCommonAPI
- Defined in:
- lib/active_merchant/billing/gateways/payflow.rb
Direct Known Subclasses
Constant Summary collapse
- RECURRING_ACTIONS =
Set.new([:add, :modify, :cancel, :inquiry, :reactivate, :payment])
Constants included from PayflowCommonAPI
ActiveMerchant::Billing::PayflowCommonAPI::CARD_MAPPING, ActiveMerchant::Billing::PayflowCommonAPI::CVV_CODE, ActiveMerchant::Billing::PayflowCommonAPI::TRANSACTIONS, ActiveMerchant::Billing::PayflowCommonAPI::XMLNS
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
- #authorize(money, credit_card_or_reference, options = {}) ⇒ Object
- #cancel_recurring(profile_id) ⇒ Object
- #credit(money, funding_source, options = {}) ⇒ Object
- #express ⇒ Object
- #purchase(money, funding_source, options = {}) ⇒ Object
-
#recurring(money, credit_card, options = {}) ⇒ Object
Adds or modifies a recurring Payflow profile.
- #recurring_inquiry(profile_id, options = {}) ⇒ Object
- #refund(money, reference, options = {}) ⇒ Object
- #verify(payment, options = {}) ⇒ Object
Methods included from PayflowCommonAPI
#capture, included, #initialize, #void
Methods inherited from Gateway
#card_brand, card_brand, #generate_unique_id, inherited, #initialize, non_fractional_currency?, #scrub, supported_countries, #supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?
Methods included from CreditCardFormatting
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Instance Method Details
#authorize(money, credit_card_or_reference, options = {}) ⇒ Object
16 17 18 19 20 |
# File 'lib/active_merchant/billing/gateways/payflow.rb', line 16 def (money, credit_card_or_reference, = {}) request = (:authorization, money, credit_card_or_reference, ) commit(request, ) end |
#cancel_recurring(profile_id) ⇒ Object
73 74 75 76 77 78 |
# File 'lib/active_merchant/billing/gateways/payflow.rb', line 73 def cancel_recurring(profile_id) ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE request = build_recurring_request(:cancel, 0, :profile_id => profile_id) commit(request, .merge(:request_type => :recurring)) end |
#credit(money, funding_source, options = {}) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/active_merchant/billing/gateways/payflow.rb', line 28 def credit(money, funding_source, = {}) if funding_source.is_a?(String) ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE # Perform referenced credit refund(money, funding_source, ) elsif card_brand(funding_source) == 'check' # Perform non-referenced credit request = build_check_request(:credit, money, funding_source, ) commit(request, ) else request = build_credit_card_request(:credit, money, funding_source, ) commit(request, ) end end |
#express ⇒ Object
87 88 89 |
# File 'lib/active_merchant/billing/gateways/payflow.rb', line 87 def express @express ||= PayflowExpressGateway.new(@options) end |
#purchase(money, funding_source, options = {}) ⇒ Object
22 23 24 25 26 |
# File 'lib/active_merchant/billing/gateways/payflow.rb', line 22 def purchase(money, funding_source, = {}) request = (:purchase, money, funding_source, ) commit(request, ) end |
#recurring(money, credit_card, options = {}) ⇒ Object
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
63 64 65 66 67 68 69 70 71 |
# File 'lib/active_merchant/billing/gateways/payflow.rb', line 63 def recurring(money, credit_card, = {}) ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE [:name] = credit_card.name if [:name].blank? && credit_card request = build_recurring_request([:profile_id] ? :modify : :add, money, ) do |xml| add_credit_card(xml, credit_card) if credit_card end commit(request, .merge(:request_type => :recurring)) end |
#recurring_inquiry(profile_id, options = {}) ⇒ Object
80 81 82 83 84 85 |
# File 'lib/active_merchant/billing/gateways/payflow.rb', line 80 def recurring_inquiry(profile_id, = {}) ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE request = build_recurring_request(:inquiry, nil, .update( :profile_id => profile_id )) commit(request, .merge(:request_type => :recurring)) end |
#refund(money, reference, options = {}) ⇒ Object
43 44 45 |
# File 'lib/active_merchant/billing/gateways/payflow.rb', line 43 def refund(money, reference, = {}) commit(build_reference_request(:credit, money, reference, ), ) end |
#verify(payment, options = {}) ⇒ Object
47 48 49 |
# File 'lib/active_merchant/billing/gateways/payflow.rb', line 47 def verify(payment, ={}) (0, payment, ) end |