Payment Director and PayPal Express

PayPal Express is a "button" payment method, which means it appears as a button on the shopping cart page.  That said, your Payment Director expression won't be able to make use of ShippingAddress attributes, because a shipping address does not get selected by the customer until later in the checkout flow.  

So, for example, if you wanted to only allow PayPal Express for US customers, you can't use ShippingAddress.Country.TwoLetterIsoCode .  Instead, one workaround is to require a Country be entered during customer registration.   "CountryId" is an attribute stored with the Customer. 

Here's what it should look like in Payment Director grid: 

Option

Payments.PayPalExpressCheckout

Customer.GetAttribute("CountryId") = "1"

Note the "1".  That's the CountryId.  You'll need to verify (or change) the "1" for country of your choice. "US" is typically "1", but it could vary depending on your nopCommerce configuration.  To verify/get the Id, Edit your country in Admin > Configuration > Countries, and check the browser's address bar.  Check the # on the end of the url  - e.g.  /Admin/Country/Edit/1

(See this blog for additional information: Payment Director - checking the selected shipping method)

Comments
Leave your comment
:
sample@email.tst
Created on: 6/26/2023 5:32 PM
1