Opayo (SagePay) Integration Guide

Article author
Colin Rixom
  • Updated

What is the context?


Sage Pay is a leading independent payment service provider (PSP) and is one of the most trusted payment brands. Every year Sage Pay processes billions of pounds worth of secure payments for its 55,000+ customers and makes the process of accepting payments online, over the phone, or in-person simpler, faster, safer and more profitable for businesses.

Sage Pay is a subsidiary of FTSE 100 business management software and services company The Sage Group plc. For further information please visit: www.sagepay.co.uk.

With Sage Pay integration, Meddbase users can allow patients to pay their invoices online, either via the Patient Portal or simply by emailing them a link to an online payment page. Online patient payments are updated in real-time within Meddbase.

As of Mid 2020 SagePay's naming has changed to Opayo. Please note that this does not affect any of the integration steps.

What is the purpose of the article?


This article will walk you through the process of integrating Opayo (SagePay) in your Meddbase application.

This includes steps you need to take on Opayo (SagePay) website as well as within Meddbase.

 

Signing up for an Opayo (SagePay) account


To sign up for an Opayo (SagePay) account, simply register at opayo.co.uk/apply-for-an-opayo-account

Follow the instructions provided on the application form.

Please make sure to set the Partner field to 'Medical Management Systems Ltd.


 

After completing the first part of the application form and validating the email address used for registration, four more application steps will be made available.


Upon reaching 100% application completion, an email with the required account details will be sent out. Further instructions will also be included.

 

Authenticating Opayo (SagePay) and using the MySagePay portal


MySagePay is a cloud-based reporting & admin portal to manage your account and transactions. Two MySagePay environments will be created for you, test and live. 


Detailed instructions on accessing and configuring MySagePay will be provided in an email sent by Sage Pay immediately after creating a Sage Pay account. For the purpose of this guide, simply follow the link to the test MySagePay portal, select a password and log in.

Before you can start processing transactions through your account you will need to complete certain tests on your demo MySagePay portal. You will need to process at least one dummy transaction and refund in test MySagePay. This is to ensure that everything works as it should, before making any real transaction in your Meddbase chamber.

This SagePay article will take you through these steps: Testing your account - Opayo

 


 

Once this has been completed you should receive an email from Opayo (SagePay) providing your live MySagePay login details. 

 

Configuring Opayo (SagePay) in Meddbase


The first thing to do is to enable Online Payments. To do this:-

1. From the Start Page navigate to Admin > Configuration > Chargeable Feature.

2. In the Portals section, tick Online Payments

3. Click Yes on the pop-up informing you of automated charges for the feature.

4. Click Save once finished.

[Full alt text]

After Online Payments have been enabled, it’s time to set up one or more Online Payment Types. To do this:-

1. From the Start Page navigate to Admin > Common Catalogues.

2. Expand the Online Payment Types catalogue.

3. Click New Payment Type.


 

Making payments within your Meddbase chamber, from the Patient Portal and via emails containing online payment links will be covered in section 7 of this guide.

A group of configuration options needs to be set up for each payment type, for it to function correctly with Meddbase:-

- The ID and External ID are read-only fields that are set automatically upon saving the payment type.
- Name: The name of the payment method. This will be visible in the list of payment methods while making a payment.
- Account Code: The vendor name used to register the SagePay account.
- Description: A brief description of the payment type.
- Portal Default: This option will need to be selected in order for SagePay to be set as the default payment method online.
- Account Type: This is where you can choose E-Commerce or Mail Order payment types. You will likely want to set up one of each, E-Commerce should be used by the patient if paying by the portal, Mail Order should be used if processing the payment within Meddbase. (If portal default is ticked you will not be able to select Mail Order).
- Allow Gift Aid: In the UK, the government runs a scheme called Gift Aid that enables charities to claim the basic rate of tax on every pound. Only registered charities can use Gift Aid through the Sage Pay platform. If you are not a charity you will not be able to use this through Sage Pay.
- Company: The Meddbase chamber that this payment type will be added to.

 

Configuring Opayo (SagePay) on the Sage Pay portal


There are configuration steps that need to be completed on the Sage Pay portal:-

3D Secure rules and AVS/CV2 rules can be configured on the Sage Pay portal in additional to the below steps.

 

1. Adding valid IP's 

This will allow your Meddbase chamber to communicate with the Sage Pay API.

Navigate to Settings > Valid IPs and add the following set of details:

 

IP Address: 217.150.99.0 Subnet Mask:255.255.255.248
IP Address: 217.150.100.24 Subnet Mask:255.255.255.248
IP Address: 83.217.106.128 Subnet Mask:255.255.255.128
IP Address: 84.45.68.196 Subnet Mask:255.255.255.240
IP Address: 84.45.87.32 Subnet Mask:255.255.255.240

 

These can be named however you feel fit.

A recommendation would be "Meddbase IP range 1,2,3,4,5" as the naming of these IP Ranges does not affect the functionality, it's simply for your internal referencing.

If these are not configured correctly, the error below may appear:
"4020 : Information received from an Invalid IP address"

 

2. Setting up Users in MySagePay portal

The next thing to do on the MySagePay portal is to set up two user accounts, an admin and a non-admin user.

This can be done by navigating to Settings > Users. Please keep in mind that the account created via the Sage Pay registration email should already have admin privileges.




3. Making Sage Pay payments

After setting up an online payment type as described in section 4 of this guide, there will be three ways of making Sage Pay payments with Meddbase, in the main application, on the Patient Portal and via emails containing online payment links. Each of these three scenarios is described below.
Please bear in mind that some transaction types, such as pre-authorisations, may need to be enabled by contacting Sage Pay customer support. This will usually be indicated by an error with a code/status of ‘4006: INVALID’ when attempting to make that transaction. More about this can be found on the Sage Pay support site.

 

Making online payments within your Meddbase chamber


The most straightforward way of making online payments from within Meddbase is from an invoice. Simply navigate to Accounts > Invoices and open the invoice you want to make a payment on, alternatively, the invoice can be found by typing the invoice ID in the Quick Search bar on the top right. Once you are in the invoice as normal you would go to make a payment and mark the invoice as sent if not done so already. 

A new payment method will appear which will be labelled however you labelled it in section 4 of this article. In this case, you can see it is called SagePay.


mceclip0.png

 

You will then need to make sure the address and payer details are correct before clicking save.

From the next window that pops up on the screen, you can add the patient's card details After clicking the Save button to confirm the transaction, SagePay will authorise the transaction and return you to the invoice to show you that the payment has been made. 


mceclip1.png

From the next window that pops up on the screen, you can add the patient's card details.

After clicking the Save button to confirm the transaction, SagePay will authorise the transaction and return you to the invoice to show you that the payment has been made. 



mceclip2.png



If any error message appears at this stage you can search the code provided on the SagePay website to understand the reasoning for that error. 
https://www.opayo.co.uk/support/error-codes

Another way Sage Pay can be used within Meddbase is to pre-authorise payments from an appointment home page or from an unsent invoice. This allows a Meddbase user to temporarily store the patient’s card details, so when the appointment is arrived at a later date and the invoice is marked as sent, the user can charge the card without having to contact the patient for payment details.

 

 

SagePay can also be used to make payments on membership invoices or set up a recurring membership payment. This can be done from the patient home by clicking on the Membership Scheme field on the Account panel. Doing so causes the following pop-up window to display, and from here a Meddbase user can either open the invoice and make an online payment as described earlier in this section of the guide or set up a recurring membership payment which will use the stored card details to make payments against invoices raised by the membership scheme that the patient is a member of.

 

 

Making online payments against emailed invoices


After emailing an invoice from Meddbase, the patient can follow the online payment URL in the email which will take them to the Patient Portal linked to the chamber from which the invoice was emailed. Once on the payment page, the patient has two options, they can either make an anonymous online payment…




…or log into the Patient Portal and make a payment against the invoice directly from their Patient Portal account. Payments made from the Patient Portal will be covered in the next sub-section.

 

Making online payments via the Patient Portal


While logged into the Patient Portal, a patient can make an online payment against any unpaid invoice from the Invoices page. They can also pay membership invoices and/or set up a recurring membership payment from the Memberships page.





All payments made on the Patient Portal automatically reflect in your Meddbase chamber as well.

 

Review date


This article was last updated on 3rd of June 2022 in the context of Meddbase version 1.251.0.38775