In an always-changing retail environment, the world of electronic payments has become more and more prevalent. Dynamics 365 is trying its best to get up with the times. The first installment in the electronic "wallet" style payment method that Retail and Commerce offers is Paypal. In this blog I'll talk about how to set up PayPal for your E-commerce (D365 Ecomm) website, including front and back-office setups. I'll also cover what needs to be done with PayPal.com in order to do anything (since you need to have a merchant account with them to take payments, just like with a credit card).
The first thing that you need to do to get this process started is to create a developer's account on PayPal. This is a very simple process and can be started by going here. Click "Log into dashboard" then "Sign up" as follows:
The sign-up (if I remember right) is just an email address and a password that you create. After that you're golden.
Once you've created an account, you'll need to collect a few things for your setups in the back office. First, you'll need to get information about your REST API app. When you first create an account, navigate to My Apps and Credentials (you may be there automatically). From there you'll see your REST API Apps, and a default application should be created without you doing anything:
Click into that and copy 2 things:
The Client ID
The Secret for the application (you'll have to press Show to see it)
Store these for safe keeping in the next step.
And that's it for testing purposes! Next up, the back-office setups.
Back Office
In D365 back office there are a few configurations that you need to do. This setup is similar to setting up a credit card, but with a few extra steps along the way. The first thing we'll need to do is set up a credit card and a card type.
Feature Management
Before we can do any of the setup in back office, you need to make sure that the feature to allow for wallet type payments is set to enabled. In the feature management workspace, find the feature called "Enhanced wallet support and payment improvements." I found mine in the All features section:
Now once that's turned on, you can start your configurations.
Payment Methods
The first thing we'll need to set up is a retail payment method. To do this, navigate to Retail and Commerce > Channel Setup > Payment methods. Create a new one and give it a name (mine is named simply PayPal). You'll need to select the Wallet type payment method for this one. Here's what mine looks like:
A simple enough setup, so let's move on.
Card Types
Card types in D365 are what we use to map specific types of cards like Visa or MasterCard to BIN ranges for identification at the time of order payment. We need to do something similar for PayPal, but since it's a wallet we don't have BIN ranges to worry about. Instead, we have processor types to worry about.
First, create a new card type. Again, keep it simple and call is PayPal. In the Type field select Wallet again, and in the Issuer type in PayPal. Again, this is all for simplicity's sake for future reference.
After you've created your card type it should look something like this:
Notice at the top that the "Card numbers" section, which is where we usually specify our BIN range, is not available. That's because we chose type Wallet. What IS available, though, is processor mapping, which we'll click on next.
Processor Mapping
Once you click on processor mapping there's a lot there, and only a little bit that's useful for us. First, on the left-hand column select your PayPal card type. Then in the middle column find the PayPal processor that has "Adyen for PayPal" as the processor type. Select it and add it to the right-most grid. And poof, you're done with BIN ranges for PayPal!
After that you'll need to assign the PayPal payment method to all of your channels. I decided to just do call center and my online store.
Payment Service
For call centers you'll need to set up a separate payment service apart for Adyen for credit cards. It's simple enough. Go to payment services (Accounts Receivable > Setup > Payment Setup > Payment services) and create a new one. The key here is to not select it for the default service, as that's going to be credit cards (Processor for Adyen instead of for PayPal).
Set it up as follows:
Note here the OrderIntent field, which is new. In layman's terms, it decides whether the payment will be saved for future authorizations within the same instance of a transaction or not. The two values you can have here are Authorize or Save. I keep it as Authorize since I don't have a reason to make any changes as such (Authorize is the default value).
Online Store Payment Setup
The online store payment service setup is exactly the same as what we've done above, just done from the online store that's supposed to have the ability to pay with PayPal. There is something important to note here and that's the order in which the payment services are set up on the online store. If you are using credit cards it MUST be first payment service that's set up. All others can be set up after that:
Channel-specific payment methods
For any channel that you've got that you're going to use the payment method, you'll need to set up a payment method on the channel. In the Setup tab in the ribbon for any retail channel you'll see the Payment methods tab. Below is what I set mine up to look like for our discussion:
The important thing here is that you specify operation name Pay card and then in the connector you choose the connector for PayPal. You only need to do this for pay card that isn't the default in payment services or isn't the first payment service record in your online store (your credit card payment processor).
Finally, I will always push 9999 from the channel database after something like this, but generally speaking all you need to do is push 1070 (again, preference here is from the channel database, but the distribution scheduler would be fine too).
Site Builder
In Site builder we need to add a module to our checkout fragment in order to see the button for PayPal on the checkout screen. I haven't done any blogs on the site builder, so if you are unfamiliar with that please refer to the Microsoft documentation or your nearest friendliest consultant to help talk you through it.
Checkout Fragment
Within the checkout fragment we need to make some edits to the standard credit card payment module as well as add a secondary payment module and do some extra configurations on it. First, we'll update the credit card payment module.
First thing to do is navigate to your checkout fragment and begin editing. Then expand the checkout fragment until you get to the checkout information module and the checkout section container. Find the payment with credit card module and do the following in the properties of the module:
Make sure "Is primary payment is checked"
Check the box "Use connector ID"
Leave supported tender types blank
Next we'll add our PayPal payment. In the checkout section container press the ellipses and add a new Payment module. Best practice is to name the module something logical. For me, I named it "PayPal."
Depending on where you want it on your screen, move the module up or down to suit your requirement, then do the following in the properties of the module:
Change the name of the module from Payment to "PayPal" or something you'll recognize
Add a heading with an appropriate name for CSS purposes
In the Supported tender types, type PayPal (exactly like this)
Uncheck "Is primary payment"
Check "Use connector id"
Finish editing and publish your fragment, which will update the Checkout page.
Assuming you've done everything right, when you get to your checkout screen you should see a small PayPal button that allows you to connect to the PayPal iFrame and process through your payment using your login credentials from your test account!
コメント