9. Payments

9. Payments

Introduction:

In payments we are handling bidirectional synchronization of payments. In payments we cannot modify we can create or delete the payments in Xero.

We establish a foreign key relationship between the items in our application and the one in Xero. We are accomplish this by storing the PaymentID returned by Xero in our application. Based on the xero PaymentID we are maintained synchronization between Payments in our application and in the xero.

Creation of Payments:

To create an Payment go to Payment details layout, fill the details then press the button “Push to xero”.

The following are the required fields to create an Payments

  • Contact
  • Invoice Number
  • Payment date
  • Amount

Contact:

To create payment we need a valid contact information.

Invoice Number:

To create payment we need a valid invoice number.

Payment date:

Date is required to create Payment.

Amount:

To create a payment amount is mandatory field.

Script:

For payments we have two different scripts for accessing the information from the xero and sending information to the xero.

  • Pull Payments from xero:

We are using this script to accessing the payments information from the xero. We are sending the request API URL based on the FileMaker version using Base Elements plugin functions or FileMaker functions with parameters like API key, Method as payments. Then we got a response which consists of all invoices information from the Xero in a json formate. By using that information we are creating the records in FM.

Example JSON :

Parameters JSON:
{
“api_key”: “fde07d0f60458ce429aae638bbcb4b496d444115”,
“method”: “payments”
}
Response JSON:
{
“Invoice”: { “InvoiceID”: “96df0dff-43ec-4899-a7d9-e9d63ef12b19” },
“Account”: { “Code”: “001” },
“Date”: “2009-09-08”,
“Amount”: 32.06
}
  • Create_payments_from_xero:

We are using this script to create or update the records in FileMaker by using Base Elements functions and FileMaker functions.

Invoice_build_xml:

We are using this script to create an XML file for a particular record.

Example XML :

<Payment>
<Invoice>
<InvoiceID> 96df0dff-43ec-4899-a7d9-e9d63ef12b19 </InvoiceID>
</Invoice>
<Account>
<Code> 001 </Code>
</Account>
<Date> 2009-09-08</Date>
<Amount> 32.06</Amount>
</Payment>
  • Push Payments to xero:

We are using this script to sending the Payments information to the xero. We are sending the request API URL based on the FileMaker version using Base Elements plugin functions or FileMaker functions with parameters like API key, Method as invoices and XML of the invoice. Here we are creating the XML for every record and sending to the xero then we got a response like success or error . We are displaying the response in the payment layout to know the status to the user.

Example Parameter Json :
{
“api_key”: “fde07d0f60458ce429aae638bbcb4b496d444115”,
“method”: payments,
“xml”: <Payment>
<Invoice>
<InvoiceID> 96df0dff-43ec-4899-a7d9-e9d63ef12b19 </InvoiceID>
</Invoice>
<Account>
<Code> 001 </Code>
</Account>
<Date> 2009-09-08</Date>
<Amount> 32.06</Amount>
</Payment>

}