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

If you’re using Sage 200 Professional Spring 2018 and above, follow the Sage 200 - Adding a PayNow button to a custom layout.

Cause
Resolution

In Sage 200 Professional 2016, you can use the Pay Now button on invoices, statements and chase letters sent as PDF emails through Opayo.

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:

  • Select the Go to a web address taken from the report data option.
  • 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
  • You can't change the expressions to show different information because they form part of the generated website address

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
  • Select the Go to a web address taken from the report data option
  • Use the layout to generate a Credit Note, Sales Order or Quotation
  • There’s no balance due on an invoice or a statement
  • Save the document as a 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’ve 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

Two image files are available. Right-click the one you want, then save it to a suitable location.

Image one Paynow1


Image two Paynow2

  1. Scroll to the footer section of the layout.
  2. Add the Pay Now image to the layout.
    • Select Toolbox> Add Image/Logo
    • Draw a box where you'd like the image to appear
    • 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 Open a web page from the When this element is clicked dropdown 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:
    • CreateSagePayButton. This function doesn’t include the customer's address. Use this if your customer uses multiple invoice addresses. The customer address doesn't automatically appear in the card details. Your customer just needs to manually enter their address with their card details.
    • CreateSagePayButtonWithAddress. This function adds the customer's invoice address to the Opayo website. When your customer makes a payment, Sage enters their address automatically, making the Pay Now process easier. Use this option when your customers use a single address.
  8. Replace the place-holders with data fields.
    • Highlight the place-holder name, for example, PaymentVendorName.
    • Double-click the corresponding field from the Fields section, for example, SysCompanies > PaymentVendorName. This replaces the place-holder with the data field name: SYSCompanies.PaymentVendorName.
    • Repeat for each place-holder as shown below:
    Place holder name Choose fields or add text Expression
    PaymentVendorName SysCompanies > PaymentVendorName SYSCompanies.PaymentVendorName
    customerRef SLCustomerAccounts > CustomerAccountNumber SLCustomerAccounts.CustomerAccountNumber
    address1 SOPInvCredAddresses > AddressLine1 SOPInvCredAddresses.AddressLine1
    address2 SOPInvCredAddresses > AddressLine2 SOPInvCredAddresses.AddressLine2
    address3 SOPInvCredAddresses > City SOPInvCredAddresses.City
    address4 SOPInvCredAddresses > County SOPInvCredAddresses.County
    address5 SOPInvCredAddresses > Postcode SOPInvCredAddresses.Postcode
    country SOPInvCredAddresses > Country SOPInvCredAddresses.Country
    InvoiceNumber SOPInvoiceCredits > DocumentN SOPInvoiceCredits.DocumentNo
    amount SOPInvoiceCredits > InvoicedGrossValue SOPInvoiceCredits.InvoicedGrossValue
    date SOPInvoiceCredits > DocumentDate SOPInvoiceCredits.DocumentDate
    currency SLCustomerAccounts > CurrencyISOCode SLCustomerAccounts.CurrencyISOCode
    format Replace with the following text: "invoice" "invoice"
    tenantID SYSCompanies > TenantID SYSCompanies.TenantID
    companyID SYSCompanies > CompanyNumber SYSCompanies.CompanyNumbe

    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’re viewing this article from the Sage website, a list of Sage 200 Report Designer articles are available now.

Steps to duplicate
Related Solutions