Add a Pay Now button to custom documents for Opayo (Sage Pay)

Note - information

Opayo is the new name for Sage Pay. If you're using Sage 200 Professional versions up to 2020 R1, where you see references to "Sage Pay" in the app, these are referring to the Opayo payment service.

This explains how to add a Pay Now button to documents that you've already customised for your business, such as invoices or orders. This applies to Opayo.

The Pay Now button is an embedded image in the report, with these properties:

  • The web address for your Opayo account. This is defined by an expression which uses the Sage200PayNow function. This expression links to the Opayo website when your customer clicks the image.
  • The expression also includes details such as the amount to pay, date, invoice number, your vendor name, and the customer's account code.
Tip:

If you haven't yet created a custom layout, you can customise one of the default layouts provided with Sage 200. To do this, open the layout from the defaults > layouts folder. These layouts already contain a Pay Now button.

To use a Pay Now button on your own custom layout, you will need to:

  1. Get the Pay Now button image.
  2. Set email options on the layout.
  3. Add the Pay Now button.

Get the Pay Now button image

We have provided these image files for the Pay Now button. You can use one of these images, edit the image provided, or create your image file.

  1. Right-click the image and choose Save image as, or the link next to an image and choose to Save link as.

    Pay_Now110x30.png

    Pay_Now160x44.jpg

  2. Save the image to a location on your PC.

Set email options on the layout

You must set up the email settings for the layout in Report Designer, as all documents with the Pay Now button must be sent to customers via email. Email options are not set on documents by default.

If you've already added email settings to your custom layouts, then you can skip this step.

Open: Tools > Run Sage Report Designer.

  1. Select the SOP Invoice layout that you want to use: File Explorer > Layouts.

    Custom layouts that you've already saved can be found in custom > layouts or company > layouts folder.

  2. Select Report > Email settings from the toolbar, to set the report email settings.

  3. Choose the header section of the layout.

    From the Email message should contain drop-down list, choose the group with the highest number (e.g. if there are 7 groups, select group 7). This makes each invoice is included on a separate email.

    In this example, for the SOP Invoice (Single) layout, select Group 7 - SOPInvoiceCredits.SOPInvoiceCreditID.

    Note: If you want to include your company logo, make sure that your logo is included the header section that you choose here.

  4. Add the customer account email address. Invoices are sent to the address stored on the customer account.

    Click To, then copy and paste this text in to the expression editor:

  5. Click Subject and enter the subject for the email.

    This can be plain text, or you can use an expression to include details from Sage 200.

    The following expression includes your company name and the invoice number. You can copy and paste this text into the expression editor:

  6. Choose to send the invoices as an attachment.

    1. Enter the required message text.
    2. Set the Attachment Format to PDF.
    3. Click Filename and enter a filename for the attachment.

      This can be plain text, or you can use an expression to include details from Sage 200.

      The following expression includes your company name and the invoice number. You can copy and paste this text into the expression editor:

      Copy
      REPORT.DESCRIPTION
  7. Select Save email to mailbox.

    The emails are sent to your email drafts folder, so you can check them before sending to your customers.

  8. Choose your email account provider.

    • MAPI: Select this if your email application uses a MAPI (Outlook / Exchange) mail server.

    • Microsoft Outlook: Select this if you are using Microsoft Outlook.

  9. To save the new invoice layout, select File > Save As.

    Note: When you change a default layout, letter or report, you must save the new layout, letter or report in the custom or company folder.

Add the Pay Now button

  1. Scroll to the footer section of the layout.
  2. Add the Pay Now image to the layout.
    1. Select Toolbox > Add Image / Logo.
    2. Draw the a box where you'd like the image to appear.
    3. 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 .

  4. Set When this element is clicked to Open a web page.
  5. Select Go to a web address taken from the report data, and then click Edit. This opens the Expression Editor.

    Use the expressions provided forOpayo.

  6. Once you've entered the expression, click OK.

  7. Save the layout.

    • If you want to use the layout for all companies, make sure you save it in the Custom > Layouts folder.
    • If the layout is for a specific company (if you have more than one on your site), save it in the Company > Layouts folder.

    Note: If this a new layout, don't forget to assign set it as a default layout, or assign it to the relevant customer accounts.