Download the PHP package itinerisltd/gf-sagepay without Composer

On this page you can find all versions of the php package itinerisltd/gf-sagepay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package gf-sagepay

GF SagePay

GitHub Actions Packagist Version PHP from Packagist Packagist Downloads GitHub License Hire Itineris Twitter Follow @itineris_ltd Twitter Follow @TangRufus

SagePay payment gateway for GravityForms.

Goal

Allow Gravity Forms to accept SagePay (now Opayo by Elavon) one-off payments via SagePay Server.

Features

Not Supported / Not Implemented

These features are not supported by this plugin, but you might be able to use them via MySagePay:

Pull requests are welcome.

Minimum Requirements

Upgrading to 1.0

1.0.0 is a major release. Before upgrading from 0.12:

  1. Check the minimum requirements: PHP 8.4.1 with bcmath, WordPress 6.7 and Gravity Forms 3.1.
  2. If your project pins config.platform.php in composer.json, set it to 8.4.1 or higher (8.4 means 8.4.0 and is refused).
  3. Update the Composer constraint, letting only gf-sagepay's own dependencies move (it needs omnipay/common 3.5.1 or newer):

  4. If you extend any of the plugin's classes or call methods outside the public API, update that code:
    • every class is now final, protected members are private, and everything outside the public API is @internal
    • Entry::isTimeout(), Entry::expireConfirmationTokenNow(), Entry::setProperty() and Feed::isActive() are removed
    • GatewayFactory::build() is private (use GatewayFactory::buildFromFeed())
    • Entry::setMeta() requires a string key, and CallbackHandler::run() now ends the request (never)

Good to know:

Installation

Composer (Recommended)

Build from Source (Not Recommended)

Then, install release/gf-sagepay.zip as usual.

Best Practices

HTTPS Everywhere

Although SagePay accepts insecure HTTP sites, you should always use HTTPS to protect all communication.

Payment Status

Always double check payment status on MySagePay.

Fraud Protection

To prevent chargebacks, enforce 3D Secure and AVS/CV2 rules whenever possible.

Each feed's 3D-Secure setting decides how 3D Secure applies to its payments. New feeds default to "Use MSP Setting", which follows the 3D Secure rules in MySagePay; existing feeds keep their saved value, so check them after upgrading. Avoid "Disable", since card issuers can decline unauthenticated payments under SCA, and note that "Force Ignoring Rules" skips your MySagePay 3D Secure rules.

Test Sandbox

Always test the plugin and your fraud protection rules in the test sandbox before going live.

Your own test account only accepts registrations from IP addresses whitelisted in MySagePay (otherwise error 4020). If you can't whitelist yours, use the shared protxross vendor code, which accepts registrations from any IP.

SagePay must be able to reach the notification URL, so a local site needs a public tunnel. A Cloudflare quick tunnel works without an account, but SagePay only reaches it over plain http://; ngrok is an alternative.

Use one of the test cards, for example Visa 4929000000006 with CVV 123, or 4929602110085639 to simulate a decline.

Common Issues

Missing Gift Aid Acceptance Box

Only registered charities can use Gift Aid through the Sage Pay platform. The gift aid acceptance box only appears if your vendor account is Gift Aid enabled and using Donation as transaction type.

GF SagePay is Missing on Form Settings

Make sure you meet the System Status Page.

Shipping Address

SagePay requires both a billing address and a delivery address, so map both sets of fields in the feed (a missing delivery country fails with error 3140).

Use case: Not delivering any physical goods

Map the shipping address fields to the billing ones.

Use case: Allow ship to billing address

This is similar to the WooCommerce way.

Use Gravity Forms' built-in feature: Display option to use the values submitted in different field

FAQ

Will you add support for older PHP versions?

Never! This plugin will only work on actively supported PHP versions.

Don't use it on end of life or security fixes only PHP versions.

It looks awesome. Where can I find more goodies like this?

Where can I give :star::star::star::star::star: reviews?

Thanks! Glad you like it. It's important to let us know somebody is using this project. Please consider:

Developing

Public API

These are covered by semantic versioning, so they only change in a major release:

Everything else may change in any release. That includes every other class and method (all classes are final, and internals are marked @internal), the gf_sagepay_terminate action, GFSagePay::VERSION (read the version from the plugin header instead) and the entry meta keys the plugin writes (gf_sagepay_* and transaction_reference).

The failure filter passes omnipay's Omnipay\SagePay\Message\ServerAuthorizeResponse, so a major upgrade of omnipay/sagepay would be a breaking change for this plugin.

Build URL for continuing confirmation

Itineris\SagePay\ConfirmationHandler::buildUrlFor(Itineris\SagePay\Entry $entry, int $ttlInSeconds = 3600): string

Usage:

Use Case: With "using confirmation query strings to populate a form based on another submission":

  1. User fills in formA
  2. User completes the SagePay checkout form
  3. SagePay notifies CallbackHandler, which records the payment and replies with a single-use confirmation URL
  4. SagePay sends the user to that URL, where ConfirmationHandler runs formA's confirmation and sends the user to formB
  5. User arrives at formB's URL with merged query strings

If the user quits before completing formB, you could use ConfirmationHandler::buildUrlFor to generate a single-use, short-lived url for the user to resume formB.

Note:

Redirect URL Retrieval Failure Handling

After form submission, this plugin sends the order to SagePay in exchange for a redirect URL (the SagePay hosted checkout form URL).

By default, when redirect URL retrieval fails:

  1. Mark entry payment status as Failed
  2. Log the error
  3. wp_die immediately

Common failure reasons:

Tips: Check the log.

You can use 'gf_sagepay_redirect_url_failure_wp_die' filter to:

Important: If this filter returns false, normal Gravity Forms' feed and confirmation flow continues. Improper settings might lead to disasters.

Example:

When registration ends in an exception instead of a reply from SagePay (for example SagePay cannot be reached, or omnipay cannot build the request), there is no ServerAuthorizeResponse. The entry is still marked as Failed with the exception in its notes, and the 'gf_sagepay_redirect_url_exception_wp_die' filter decides whether to wp_die. It receives the exception instead of the response, and returning false has the same effect as above:

Required Reading List

Read the following before developing:

Gravity Forms

Gravity Forms has undocumented behaviour; read its source code when in doubt.

Testing

See CLAUDE.md for the local setup each one needs.

Pull requests without tests will not be accepted!

Feedback

Please provide feedback! We want to make this library useful in as many projects as possible. Please submit an issue and point out what you do and don't like, or fork the project and make suggestions. No issue is too small.

Change Log

Please see CHANGELOG for more information on what has changed recently.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker. You can also report it privately through GitHub's private vulnerability reporting.

Credits

GF SagePay is an Itineris Limited project created by Tang Rufus and maintained by Lee Hanbury-Pickett.

Full list of contributors can be found here.

License

GF SagePay is released under the MIT License.


All versions of gf-sagepay with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4.1
ext-bcmath Version *
ext-curl Version *
league/omnipay Version ^3.2
omnipay/common Version ^3.5.1
omnipay/sagepay Version ^4.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package itinerisltd/gf-sagepay contains the following files

Loading the files please wait ...