Positive Pay Setup in AX 2012 R2
Customers have expressed some frustration over the not quite clear steps on setting up Positive Pay in AX 2012 R2. Our TechNet article does a pretty good job on explaining the creation of the folders needed and setting things up with the bank account we are to use but could use a bit more explanation and direction on the XSLT file and Outbound Port creation as well as what goes on in AX when we produce a Positive Pay file. In this article I will give some insight into these topics.
Creating the Transform (XSLT) file:
In the TechNet article, when you expand step #2 you will see a nested bullet that can be expanded.
In here you will find sample code that can be used to produce an XML formatted Positive Pay file. Copy the entire block of code and paste it into a new Notepad file. Once the code is pasted in the Notepad file, save the file with an XSLT file extension such as ‘PosPay.xslt’.
Note: Since there are many, many banks around the world it would be near impossible for Microsoft to provide sample XSLT code to comply with each bank’s needs. As such, Partners or Customers will need to modify the sample code found within the TechNet or develop their own XSLT file to fit their specific bank’s requirements, including different file formats. In the case of different file formats, further development will be needed to include a ‘writer’ (ex. TextWriter) within the AX code to actually write the file in that format. To reiterate that last part, the sample code provided in the TechNet article will NOT produce a TXT Positive Pay file. Further development will be needed for Partners or Customers to fulfil this need.
Creating the Outbound Port:
Once the transform file is created and you have your folder structure configured per step #1 of the TechNet, we need to create our Outbound Port.
To create our Outbound Port we need to go to System Administration | Setup | Services and Application Integration Framework | Positive Pay Service | Outbound Ports for Positive Pay. This cut out of the Outbound Port form was created to aid in the setup of our Positive Pay functionality. In the Outbound Ports for Positive Pay form you will need to specify a Payment Format name. This can be any identification you want. The Outbound Port field will get filled in when we create it so leave it blank for the time being. Select the XSLT field and either use the folder icon to browse to the location of your XSLT Transform file or just type in the location yourself. The same process is used for the Outbound Folder. Select the field and then either browse to the location of our Out folder you already set up or manually type in the location.
Once you have all three fields filled in select the Create Ports button from the top of the form.
Once this is done an Outbound Port will be created in System Administration | Setup | Services and Application Integration Framework | Outbound Ports.
Once created the only changes you may need to make with it would be to change the Logging Mode or to restrict the port to a specific company. Outside of possible customizations you should not have to modify the Service Operations or the Outbound Pipelines selected by default. The Outbound Port will be Activated by default.
Note: As a general rule we recommend a domain account to run the AOS service. In the Positive Pay process the Batch job that we create as part of the setup is what actually writes the file to the Out location. Because of that, it is the service account on the AOS server that ultimately writes the file. If you use a network location or a UNC address (\\<machine name>\<folder>) you may run into network security issues if your AOS account is not a domain account.
Positive Pay file creation:
After getting things set up in AX for Positive Pay it is finally time to create our file. We can create our file from two locations:
–Cash and Bank Management | Periodic | Positive Pay file
–Cash and Bank Management | Common | Bank Accounts | Select bank account from list page | Manage Payments tab in Ribbon | Positive Pay
When we select the Periodic option we will need to select our Positive Pay format, company and bank account. If we select it from the bank account itself, all these fields are already selected.
After selecting our Cut-off date we click OK. After AX process the request the window will just close, no Infolog will be displayed that a file has been or will be created.
Once the window closes, I like to go to Cash and Bank Management | Inquiries | Positive Pay File Summary first to make sure my file generated with payments. In this window we can see if one was created, view details about it, or even recall the file if we did not want to include the payments in this file.
After the file is created, an AIF job is put into the AIF queue manager. This can be seen in System Administration | Periodic | Services and Application Integration Framework | Queue Manager.
Here the job sits until the Batch Job we created in our setup runs and processes the AIF job and ultimately writes our Positive Pay file to our Out location. Once the batch job processes the AIF job it should disappear from the Queue Manager.
Once the Batch Job finishes we should have a new file written to our Out Location with a file name like 20140619_150347_4550371_00001.xml.
To recap the file creation process:
1. Generate Positive Pay file from Cash and Bank Management Periodic Process or from the Bank Account itself
2. File is added to the Positive Pay File Summary
3. AIF Job is added to the AIF Queue Manager
4. AIF Job is picked up by Generate Positive Pay Batch job
5. File is written to Out location by the Batch Job