Payment Director - Conditional payment methods

Payment Director allows a store owner to conditionally determine which payment methods to show the customer and to calculate additional payment fees.  Let’s start with the basics…

By default, all Payment Methods that are marked Active in admin > Configuration > Payment Methods are available to your customers.   Then, you set up Payment Director Option records as needed to hide options and calculate fees.   Each option’s Expression field is evaluated, and if ‘true’ (or ‘Show’) then the option will be presented to the customer.  If ‘false’ (or ‘Hide’), then the payment option is removed.  You can include an Option record for all your active payment methods, but if only some are conditional, then it’s easiest to just have Option records for those;  if an active payment method is not included in payment director, then it will automatically be shown to the customer.

Here are some example scenarios for offering payment methods, and their Option records/expressions:

Offer 'payment in store' method only when "In-Store Pickup" shipping method selected:

  Option  Payments.PayInStore         ShippingOptionName = "In-Store Pickup"

Local Deliveries can include CashOnDelivery:

  Option  Payments.CashOnDelivery Customer.ShippingAddress.ZipPostalCode.StartsWith("100")

Customers in role "Members" can include PurchaseOrder  (use the role's System Name):

  Option  Payments.PurchaseOrder      Customer.IsInCustomerRole("Members")

If an admin is impersonating a Customer, then use Manual Credit Card, otherwise the customer enters a credit card that Authorize.Net will process:

  Option  Payments.Manual             OriginalCustomerIfImpersonated != null

  Option  Payments.AuthorizeNet       OriginalCustomerIfImpersonated = null

Only offer Paypal if a FedEx shipping method was selected (a method that has tracking :)

  Option  Payments.PayPalStandard     ShippingOptionName.StartsWith("FedEx")

Only offer credit card if there are  no Gift Cards in the cart

  Option  Payments.Manual           NOT Items.Any(Product.IsGiftCard)

When entering records in the Add new 'Payment Director' record dialog, select Option in the Type  field drop down, and then the Payment Name field will present a drop down with only active payment methods.    


Then, enter an expression that evaluates to a Boolean (true or false) using one or more or more of the following operands:

  • Customer  (also has function IsInRole("systemname") )
  • ShippingAddress
  • ShippingOption  (.ShippingRateComputationMethodSystemName, .Rate, .Name, .Description)
  • ShippingOptionName
  • Items  (shopping cart items collection)
  • OriginalCustomerIfImpersonated (if != null then you are impersonating)
  • WorkingLanguage  (.Name, and .LanguageCulture)
  • WorkingCurrency (.Name, .CurrencyCode, .Rate, and .DisplayLocale)
  • TaxDisplayType  (IncludingTax = 0, ExcludingTax = 10)
  • CreditCardType  (e.g. for Authorize.NET :  "Visa", "MasterCard", "Discover", "Amex")
  • PurchaseOrderNumber
  • OrderTotalWithoutPaymentFee
  • FriendlyName

   (UPDATE: Here are more operands added added from 3.60 and on)

  • CurrentStoreId
  • CurrentStoreName
  • IsImpersonating (Boolean)
  • CustomValues  
    • (The nopC PaymentInfoCustomValues is a Dictionary of Key/Values set by other payment plugins.  This variable converts that dictionary to a string of "key:value|key:value|...".  You can use CustomValues.StringBetween("key:","|") to get a value.

Here are some examples:

WorkingLanguage.Name = "English"

WorkingLanguage.LanguageCulture = "en-US"

We'll introduce more features in the next blog :)


Comments
Leave your comment
:
jasonbbane@gmail.com
Created on: 3/12/2017 5:43 AM
How do you prevent a credit card (Authorize.net) from being used for orders over X --  OrderTotalWithoutPaymentFee  <  1200 I can not get this to Work v3.8  
support@nopTools.com
Created on: 3/12/2017 10:04 AM
The Expression for the record  "Option  Payments.AuthorizeNet" should be  OrderTotalWithoutPaymentFee  <  1200.  If you're still having problems, Export your configuration and email it to us at support@
brianluiginawrocki@yahoo.com
Created on: 7/6/2017 4:01 PM
We have recently made several changes to our site, one being that we no longer use categories for specific items, since the change our payment director is no longer working, and our guy who set this up is no longer with us, I have minimal computer knowledge, just enough to get me in trouble, so I'm looking for help on how to change our payment director.

Right now we have items that cannot be purchased with PayPal, the director recognizes these items by a parent category and other category's in which we no long use, is it possible to chance how it recognizes this items to key words, like the word "dagger" so that any item on our site that uses the word dagger can no longer be purchased through PayPal option?  

Thanks
support@nopTools.com
Created on: 7/6/2017 6:37 PM
Brian,
Yes, we can adjust the configuration.  We'll contact you from our ticket system.