Sage 200 Report Designer - How to add a Pay Now button to your layout
Description

If you are using Sage 200 Professional Spring 2018 & above, please follow the steps in this article >

Cause
Resolution

In Sage 200 Professional 2016, if you are using Opayo (formerly Sage Pay), you can use the Pay Now button on invoices, statements and chase letters that you send as PDF files by email. When your customer views the PDF document, they can click the Pay Now button to make a payment straight away through Opayo.

How the Pay Now button works

The Pay Now button is an embedded image with the following settings in Properties > Drill Down:

  • The Go to a web address taken from the report data option is selected.
  • The web address is defined by an expression which uses the CreateSagePayButton function. This expression generates the Opayo website address when your customer clicks the image. The expression varies depending on the type of layout.
    The expressions can't be changed to show different information, as this forms part of the website address generated.

The Pay Now buttons use conditional formatting to ensure they only appear on layouts when appropriate. The button doesn't appear on a layout if:

  • You aren't using one of the Sage Pay layouts or using a customised layout not originally created from a standard Sage Pay layout.
  • The customer record is not set to the base currency.
  • The layout is used to generate a Credit Note, Sales Order or Quotation.
  • There is no balance due on an invoice or a statement.
  • The document is saved as a file type other than PDF.

These are steps that explain how to add a Pay Now button and Opayo information to your statement or invoice.

This article assumes that you have located the report or layout that you want to amend and opened it in Sage Report Designer. Read more >

Obtain the Pay Now image file

There are two image files available, if you right click on the one you would like to use and choose save picture as, then choose a relevant place to save it.

Image 1 Paynow1


Image 2 Paynow2

  1. Scroll to the footer section of the layout.
  2. Add the Pay Now image to the layout.

    a. Select Toolbox> Add Image/Logo
    b. Draw a box where you'd like the image to appear
    c. Choose to Browse my PC for an image and select the image saved on your PC
  3. Select the image. From the Properties section, select Behaviour > Drill Down and click

    Paynow3

  4. Select the Open a web page from the When this element is clicked drop-down list.
  5. Select Go to a web address taken from ... and click Edit. This opens the Expression Editor.
  6. Find the Pay Now functions: Functions > Sage200PayNow.
  7. Drag one of the following functions into the editor:

    a. CreateSagePayButton. This function does not include the customer's address. Use this if your customer uses multiple invoice addresses. This just means that the customer address is not added automatically on the card details. Your customer just needs to manually enter their address with their card details.
    b. CreateSagePayButtonWithAddress. This function adds the customers address to the Opayo website. This uses the customers invoice address. When your customer makes a payment, their address is entered automatically, making their Pay Now experience easier. Use this when your customers only uses a single address.
  8. Replace the place-holders with data fields.

    a. Highlight the place-holder name, e.g. PaymentVendorName.
    b. Double click the corresponding field from the Fields section, e.g. SysCompanies > PaymentVendorName. This replaces the place-holder with the data field name: SYSCompanies.PaymentVendorName.
    c. Repeat for each place-holder as shown below:
    Place holder nameChoose fields or add textExpressionUsed for:
    PaymentVendorNameSysCompanies > PaymentVendorNameSYSCompanies.PaymentVendorNameThe name of your Opayo Vendor account entered in the Settings.
    Used to access your Opayo account.
    customerRefSLCustomerAccounts > CustomerAccountNumberSLCustomerAccounts.CustomerAccountNumberThe customer account number. Used to match the payments with invoices in Sage 200.
    address1SOPInvCredAddresses > AddressLine1SOPInvCredAddresses.AddressLine1The invoice address set on the order or invoice
    address2SOPInvCredAddresses > AddressLine2SOPInvCredAddresses.AddressLine2Only required for WithAddress function.
    address3SOPInvCredAddresses > CitySOPInvCredAddresses.City
    address4SOPInvCredAddresses > CountySOPInvCredAddresses.County
    address5SOPInvCredAddresses > PostcodeSOPInvCredAddresses.Postcode
    countrySOPInvCredAddresses > CountrySOPInvCredAddresses.Country
    InvoiceNumberSOPInvoiceCredits > DocumentNoSOPInvoiceCredits.DocumentNoAdds the invoice number to the Opayo transaction
    amountSOPInvoiceCredits > InvoicedGrossValueSOPInvoiceCredits.InvoicedGrossValueThe amount requested to pay. The customer can change this when entering their card details.
    dateSOPInvoiceCredits > DocumentDateSOPInvoiceCredits.DocumentDateThe invoice date.
    currencySLCustomerAccounts > CurrencyISOCodeSLCustomerAccounts.CurrencyISOCodeThe currency the invoice is in. This will only be your base currency as the Pay Now button can't be used with foreign currency invoices.
    formatReplace with the following text: "invoice""invoice"Shows that it's an invoice that's being paid.
    tenantIDSYSCompanies > TenantIDSYSCompanies.TenantID
    companyIDSYSCompanies > CompanyNumberSYSCompanies.CompanyNumberUsed to link the Opayo transaction to the correct Sage 200 company.
    Your final expression should look like this
    Without Address:
    CreateSagePayButton(SYSCompanies.PaymentVendorName, SLCustomerAccounts.CustomerAccountNumber, SOPInvoiceCredits.DocumentNo, SOPInvoiceCredits.InvoicedGrossValue, SOPInvoiceCredits.DocumentDate, SLCustomerAccounts.CurrencyISOCode, "invoice",SYSCompanies.TenantID, SYSCompanies.CompanyNumber)

    With Address

    CreateSagePayButtonWithAddress(SYSCompanies.PaymentVendorName, SLCustomerAccounts.CustomerAccountNumber, SOPInvCredAddresses.AddressLine1, SOPInvCredAddresses.AddressLine2, SOPInvCredAddresses.City, SOPInvCredAddresses.County, SOPInvCredAddresses.Postcode, SOPInvCredAddresses.Country, SOPInvoiceCredits.DocumentNo, SOPInvoiceCredits.InvoicedGrossValue, SOPInvoiceCredits.DocumentDate, SLCustomerAccounts.CurrencyISOCode, "invoice",SYSCompanies.TenantID, SYSCompanies.CompanyNumber)
  9. Click Ok
  10. Save the layout in the relevant folder

If you are viewing this article from the Sage website, a list of Sage 200 Report Designer articles are available now.


Steps to duplicate
Related Solutions