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. fender

  • 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

Image one Paynow1


Image two 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 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:

    a. 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.
    b. 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.

    a. Highlight the place-holder name, for example, PaymentVendorName.
    b. 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.
    c. Repeat for each place-holder as shown below:
    Place holder name Choose fields or add text Expression Used for:
    PaymentVendorName SysCompanies > PaymentVendorName SYSCompanies.PaymentVendorName

    Enter your Opayo Vendor Account name in Settings. Sage uses this to access your Opayo account.

    customerRef SLCustomerAccounts > CustomerAccountNumber SLCustomerAccounts.CustomerAccountNumber The customer account number. Used to match the payments with invoices in Sage 200.
    address1 SOPInvCredAddresses > AddressLine1 SOPInvCredAddresses.AddressLine1 The invoice address set on the order or invoice
    address2 SOPInvCredAddresses > AddressLine2 SOPInvCredAddresses.AddressLine2 Only required for WithAddress function.
    address3 SOPInvCredAddresses > City SOPInvCredAddresses.City  
    address4 SOPInvCredAddresses > County SOPInvCredAddresses.County  
    address5 SOPInvCredAddresses > Postcode SOPInvCredAddresses.Postcode  
    country SOPInvCredAddresses > Country SOPInvCredAddresses.Country  
    InvoiceNumber SOPInvoiceCredits > DocumentNo SOPInvoiceCredits.DocumentNo Adds the invoice number to the Opayo transaction
    amount SOPInvoiceCredits > InvoicedGrossValue SOPInvoiceCredits.InvoicedGrossValue The amount requested to pay. The customer can change this when entering their card details.
    date SOPInvoiceCredits > DocumentDate SOPInvoiceCredits.DocumentDate The invoice date.
    currency SLCustomerAccounts > CurrencyISOCode SLCustomerAccounts.CurrencyISOCode

    Use your base currency for the invoice. Pay Now doesn't support foreign currency invoices.

    format Replace with the following text: "invoice" "invoice" Shows that it's an invoice that's being paid.
    tenantID SYSCompanies > TenantID SYSCompanies.TenantID  
    companyID SYSCompanies > CompanyNumber SYSCompanies.CompanyNumber Used 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’re viewing this article from the Sage website, a list of Sage 200 Report Designer articles are available now.

 

Steps to duplicate
Related Solutions