Approach
This article provides the information about the Electronic Payment and the creation of bank files to make the payments has changed dramatically in Microsoft Dynamics AX 2012.
The CustPaymentsService
and VendPaymentsService services
expose payment information for the AIF outbound processing service. These
services are based on Microsoft Dynamics AX queries. The queries capture all
the data that is required to generate electronic payment files for customers or
vendors. Developers can modify the service, document, and data object classes
by using the AIF document service wizard.
First, set up the AIF transforms and then
export payment data that is defined by the queries. An XSL transform can be
applied to this data to transform the AIF XML file to the payment file for a
specified format.
For every payment format that we intend to
generate by using AIF, we must have a corresponding XSLT file. This XSLT file
is based on the format that is specified by the bank. Several XSLT files are
provided with Microsoft Dynamics AX. However, we can create our own XSLT file
by using a text editor or XML editor.
For payment files that are not in XML
format, we must apply an outbound transform to convert the XML results to a
flat file. Outbound transforms can be of any file type, such as binary or XSLT.
When we apply the outbound transform to the XML file that is generated by AIF,
the XML tags are removed and the payment file is created in the format that is
required by the bank.
In addition to the master data, payment-specific data might be required for each file, depending on the requirements of the bank. This data can be associated with outbound ports, and can be defined in the Payment processing data form by the system administrator. Then, when users generate payments, the users can enter values in the fields.
The following Diagram shows the steps that are required to configure and use payment formats by using AIF services.
Payment integration process flow:
In Microsoft Dynamics AX, we can use a
service to create electronic payment files. Before we can use the service, we
must configure an outbound integration port. Set up an outbound integration
port for payments that use Application Integration Framework (AIF) and the
payment format XSL transforms.
In this, we need to export an XML style
sheet from the Application Object Tree (AOT), set up a batch job to generate
XML files, and set up an outbound port for electronic payments. We have added
an outbound transform, because of it’s a special XML format is required by the Banks that we are processing
payments for.
Create
a Directory to Export the XSLT file.
Select
the file type as “XML Document” and
the document in the created directory.
Create
a Directory to Export the XSLT file
Click
the View -> Payment processing data
button.
Click Area Page node: System administration -> Setup -> Services and Application
Integration Framework -> Outbound ports.
Click the Outbound pipelines button-> Configure
button
Click the Import XSLT button and provide XSL payment file.
Click the View button to view the uploaded XSL.
Click the
Outbound transforms button.
Click the Manage transforms button.
Create
transformation of type XSL and click the Load button and select transformation
XSL.
Close manage
transformation and select the newly created transformation under outbound
transformation form.
Click the Close toolbar button and Transforms
form.
Change
the adapter to FTP adapter and provide the FTP path.
Accounts payable -> Journals ->
Payments -> Payment journal.
A batch job runs
periodically. We must set up a batch job that automatically processes documents
that are created by the service.
- Log
on to Microsoft Dynamics AX as an administrator.
- Switch
to the legal entity that users will generate payments from.
- Click System
administration > Inquiries > Batch
jobs > Batch jobs.
- Press
CTRL+N to create a batch job.
- In
the Job description field, enter a description.
- Save
the batch job.
- Click View
tasks.
- Create
the following tasks.
Task description
|
Company accounts
|
Class name
|
1
|
Select the legal entity that users will generate payments
from.
|
AIFGatewaySendService
|
2
|
Select the legal entity that users will generate payments
from.
|
AIFOutboundProcessingService
|
- Close
the Batch tasks form.
- In
the Batch job form, select the batch that we created in
steps 4 and 5, and then click Recurrence.
- In
the Recurring pattern field group, select Minutes,
and then enter the number of minutes in the Count field.
For example, we might enter 1 to process payment files
every one minute.
- Click OK to
close the Recurrence form.
- In
the Batch job form, select the batch that we created in
steps 4 and 5, and then click Functions > Change
status.
- Select Waiting.
- Close the Batch job form.
Accounts payable -> Journals ->
Payments -> Payment journal.
This
Document is based on the Single Euro Payments Area (SEPA) Credit Transfer xslt
example as supplied by Microsoft.
Click the Lines button.
Click the Functions -> Generate payments menu
button.
Select “Export payment using service” and
select the new “Payment format.”
Click on OK.
Modify the “Payment processing data” of required and then click on “OK.”
Then, AIF services are running in batch,
the document will be processed and exported to the specified FTP folder.
Happy Daxing... :)