{"id":20742647,"url":"https://github.com/itinerisltd/gf-sagepay","last_synced_at":"2025-04-24T05:12:54.952Z","repository":{"id":32905369,"uuid":"128831256","full_name":"ItinerisLtd/gf-sagepay","owner":"ItinerisLtd","description":"Gravity Forms Add-on for SagePay","archived":false,"fork":false,"pushed_at":"2025-01-22T11:17:19.000Z","size":528,"stargazers_count":4,"open_issues_count":6,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-24T05:12:38.894Z","etag":null,"topics":["gravityforms","gravityforms-payment","sagepay","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ItinerisLtd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-09T20:41:28.000Z","updated_at":"2025-01-22T11:17:22.000Z","dependencies_parsed_at":"2023-12-27T14:30:23.000Z","dependency_job_id":"697d0468-c5a6-46ad-9ef9-927cb597abd0","html_url":"https://github.com/ItinerisLtd/gf-sagepay","commit_stats":{"total_commits":207,"total_committers":4,"mean_commits":51.75,"dds":"0.38647342995169087","last_synced_commit":"aaebac314086055685a15b6ab57c7e259a17c401"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItinerisLtd%2Fgf-sagepay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItinerisLtd%2Fgf-sagepay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItinerisLtd%2Fgf-sagepay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItinerisLtd%2Fgf-sagepay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ItinerisLtd","download_url":"https://codeload.github.com/ItinerisLtd/gf-sagepay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250566516,"owners_count":21451233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gravityforms","gravityforms-payment","sagepay","wordpress","wordpress-plugin"],"created_at":"2024-11-17T07:06:46.396Z","updated_at":"2025-04-24T05:12:54.935Z","avatar_url":"https://github.com/ItinerisLtd.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GF SagePay\n\n[![GitHub Actions](https://github.com/ItinerisLtd/gf-sagepay/actions/workflows/test.yml/badge.svg)](https://github.com/ItinerisLtd/gf-sagepay)\n[![Packagist Version](https://img.shields.io/packagist/v/itinerisltd/gf-sagepay.svg?label=release\u0026style=flat-square)](https://packagist.org/packages/itinerisltd/gf-sagepay)\n[![PHP from Packagist](https://img.shields.io/packagist/php-v/itinerisltd/gf-sagepay.svg?style=flat-square)](https://packagist.org/packages/itinerisltd/gf-sagepay)\n[![Packagist Downloads](https://img.shields.io/packagist/dt/itinerisltd/gf-sagepay.svg?label=packagist%20downloads\u0026style=flat-square)](https://packagist.org/packages/itinerisltd/gf-sagepay/stats)\n[![GitHub License](https://img.shields.io/github/license/itinerisltd/gf-sagepay.svg?style=flat-square)](https://github.com/ItinerisLtd/gf-sagepay/blob/master/LICENSE)\n[![Hire Itineris](https://img.shields.io/badge/Hire-Itineris-ff69b4.svg?style=flat-square)](https://www.itineris.co.uk/contact/)\n[![Twitter Follow @itineris_ltd](https://img.shields.io/twitter/follow/itineris_ltd?style=flat-square\u0026color=1da1f2)](https://twitter.com/itineris_ltd)\n[![Twitter Follow @TangRufus](https://img.shields.io/twitter/follow/TangRufus?style=flat-square\u0026color=1da1f2)](https://twitter.com/tangrufus)\n\nSagePay payment gateway for GravityForms.\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n\n- [Goal](#goal)\n- [Features](#features)\n- [Not Supported / Not Implemented](#not-supported--not-implemented)\n- [Minimum Requirements](#minimum-requirements)\n- [Installation](#installation)\n  - [Composer (Recommended)](#composer-recommended)\n  - [Build from Source (Not Recommended)](#build-from-source-not-recommended)\n- [Best Practices](#best-practices)\n  - [HTTPS Everywhere](#https-everywhere)\n  - [Payment Status](#payment-status)\n  - [Fraud Protection](#fraud-protection)\n- [Test Sandbox](#test-sandbox)\n- [Common Issues](#common-issues)\n  - [Missing Gift Aid Acceptance Box](#missing-gift-aid-acceptance-box)\n  - [GF SagePay is Missing on Form Settings](#gf-sagepay-is-missing-on-form-settings)\n- [Shipping Address](#shipping-address)\n  - [Use case: Not delivering any physical goods](#use-case-not-delivering-any-physical-goods)\n  - [Use case: Allow ship to billing address](#use-case-allow-ship-to-billing-address)\n- [FAQ](#faq)\n  - [Will you add support for older PHP versions?](#will-you-add-support-for-older-php-versions)\n  - [It looks awesome. Where can I find more goodies like this?](#it-looks-awesome-where-can-i-find-more-goodies-like-this)\n  - [Where can I give :star::star::star::star::star: reviews?](#where-can-i-give-starstarstarstarstar-reviews)\n- [Developing](#developing)\n  - [Public API](#public-api)\n    - [Build URL for continuing confirmation](#build-url-for-continuing-confirmation)\n    - [Redirect URL Retrieval Failure Handling](#redirect-url-retrieval-failure-handling)\n  - [Required Reading List](#required-reading-list)\n  - [Gravity Forms](#gravity-forms)\n  - [Testing](#testing)\n- [Feedback](#feedback)\n- [Change Log](#change-log)\n- [Security](#security)\n- [Credits](#credits)\n- [License](#license)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Goal\n\nAllow Gravity Forms accepts SagePay one-off payments via [SagePay Server](https://www.sagepay.co.uk/support/15/36/sage-pay-server-understanding-the-process).\n\n## Features\n\n- [SagePay Server](https://www.sagepay.co.uk/support/15/36/sage-pay-server-understanding-the-process)\n- [Gift Aid](https://www.sagepay.co.uk/support/12/36/gift-aid)\n- [3D Secure](https://www.sagepay.co.uk/support/12/36/3d-secure-explained)\n- [AVS/CV2](https://www.sagepay.co.uk/support/28/36/activating-adding-avs/cv2-rules)\n- [Gravity Forms Logging](https://docs.gravityforms.com/logging-and-debugging/)\n- [Gravity Forms Notification Events](https://docs.gravityforms.com/gravity-forms-notification-events/)\n- [Gravity Forms Confirmation](https://docs.gravityforms.com/configuring-confirmations-in-gravity-forms/)\n- [Gravity Forms Conditional Logic](https://docs.gravityforms.com/enable-conditional-logic/)\n\n## Not Supported / Not Implemented\n\nAlthough these features are not supported by this plugin, but you might able to do so via [MySagePay](https://live.sagepay.com/mysagepay/login.msp):\n- Card reference\n- Token billing\n- Deferred payment\n- Recurring payment\n- Void\n- Refund\n- Abort\n- Basket\n- Surcharges\n- Account Type M – for telephone (MOTO) transactions\n- Account Type C – for repeat transactions\n\n[Pull requests](https://github.com/ItinerisLtd/gf-sagepay) are welcomed.\n\n## Minimum Requirements\n\n- PHP v7.2\n- PHP cURL Extension\n- WordPress v4.9.5\n- [Gravity Forms](https://www.gravityforms.com/) v2.4.14.4\n\n## Installation\n\n### Composer (Recommended)\n\n```bash\ncomposer require itinerisltd/gf-sagepay\n```\n\n### Build from Source (Not Recommended)\n\n```bash\n# Make sure you use the same PHP version as remote servers.\n# Building inside docker images is recommanded.\nphp -v\n\n# Checkout source code\ngit clone https://github.com/ItinerisLtd/gf-sagepay.git\ncd gf-sagepay\ngit checkout \u003cthe-tag-or-the-branch-or-the-commit\u003e\n\n# Build the zip file\ncomposer release:build\n```\n\nThen, install `release/gf-sagepay.zip` [as usual](https://codex.wordpress.org/Managing_Plugins#Installing_Plugins).\n\n## Best Practices\n\n### HTTPS Everywhere\n\nAlthough SagePay accepts insecure HTTP sites, you should **always use HTTPS** to protect all communication.\n\n### Payment Status\n\nAlways double check payment status on [MySagePay](https://live.sagepay.com/mysagepay/login.msp).\n\n### Fraud Protection\n\nTo prevent chargebacks, enforce [3D Secure](https://www.sagepay.co.uk/support/12/36/3d-secure-explained) and [AVS/CV2](https://www.sagepay.co.uk/support/28/36/activating-adding-avs/cv2-rules) rules whenever possible.\n\n## Test Sandbox\n\nAlways test the plugin and your fraud protection rules in test sandbox before going live.\n\nIf you can't whitelist test server IPs, use `protxross` as `Vendor Code`.\n\nUse [ngrok](https://ngrok.com/) to make local notification URLs publicly accessible.\n\nUse one of the [test credit cards](https://www.sagepay.co.uk/support/12/36/test-card-details-for-your-test-transactions).\n\n## Common Issues\n\n### Missing Gift Aid Acceptance Box\n\nOnly registered charities can use [Gift Aid](https://www.sagepay.co.uk/support/12/36/gift-aid) through the Sage Pay platform.\nThe gift aid acceptance box only appears if your vendor account is Gift Aid enabled and using **Donation** as transaction type.\n\n### GF SagePay is Missing on Form Settings\n\nMake sure you meet the [minimum requirements](#minimum-requirements). Check your environment details at the [System Status Page](https://docs.gravityforms.com/checking-environment-details/).\n\n## Shipping Address\n\n[OmniPay](https://omnipay.thephpleague.com/) requires both billing address and shipping address.\n\n### Use case: Not delivering any physical goods\n\nMap the shipping address fields to the billing ones.\n\n### Use case: Allow ship to billing address\n\nThis is similar to the the WooCommerce way.\n\nUse Gravity Forms' built-in feature: [Display option to use the values submitted in different field](https://docs.gravityforms.com/address-field/#advanced-settings)\n\n## FAQ\n\n### Will you add support for older PHP versions?\n\nNever! This plugin will only work on [actively supported PHP versions](https://secure.php.net/supported-versions.php).\n\nDon't use it on **end of life** or **security fixes only** PHP versions.\n\n### It looks awesome. Where can I find more goodies like this?\n\n- Articles on [Itineris' blog](https://www.itineris.co.uk/blog/)\n- More projects on [Itineris' GitHub profile](https://github.com/itinerisltd)\n- More plugins on [Itineris](https://profiles.wordpress.org/itinerisltd/#content-plugins) and [TangRufus](https://profiles.wordpress.org/tangrufus/#content-plugins) wp.org profiles\n- Follow [@itineris_ltd](https://twitter.com/itineris_ltd) and [@TangRufus](https://twitter.com/tangrufus) on Twitter\n- Hire [Itineris](https://www.itineris.co.uk/services/) to build your next awesome site\n\n### Where can I give :star::star::star::star::star: reviews?\n\nThanks! Glad you like it. It's important to let my boss knows somebody is using this project. Please consider:\n\n- leave a 5-star review on [wordpress.org](https://wordpress.org/support/plugin/gf-sagepay/reviews/)\n- tweet something good with mentioning [@itineris_ltd](https://twitter.com/itineris_ltd) and [@TangRufus](https://twitter.com/tangrufus)\n- :star: star this [Github repo](https://github.com/ItinerisLtd/gf-sagepay)\n- :eyes: watch this [Github repo](https://github.com/ItinerisLtd/gf-sagepay)\n- write blog posts\n- submit [pull requests](https://github.com/ItinerisLtd/gf-sagepay)\n- [hire Itineris](https://www.itineris.co.uk/services/)\n\n## Developing\n\n### Public API\n\n#### Build URL for continuing confirmation\n\n`ConfirmationHandler::buildUrlFor(Entry $entry, int $ttlInSeconds = 3600): string`\n\nUsage:\n```php\n$entryId = 123;\n$rawEntry = GFAPI::get_entry($entryId);\nif (is_wp_error($rawEntry)) {\n    wp_die('Entry not found');\n}\n\n$url = ConfirmationHandler::buildUrlFor(\n    new Entry($rawEntry),\n    86400 // expires in 24 hours (24*3600=86400)\n);\n\necho $url;\n// https://example.com?entry=123\u0026gf-sagepay-token=XXXXXXXXXXXX\n```\n\nUse Case:\nWith [\"using confirmation query strings to populate a form based on another submission\"](https://docs.gravityforms.com/using-confirmation-query-strings-to-populate-a-form-based-on-another-submission/):\n1. User fills in formA\n1. User completes SagePay checkout form\n1. User comes back and hits `CallbackHandler`\n1. `CallbackHandler` sends user to formB according to confirmation settings\n1. User arrives formB url with merged query strings\n\nIf the user quits before completing formB, you could use `ConfirmationHandler::buildUrlFor` generate a single-use, short-lived url for the user to resume formB.\n\nNote:\n- The url continues Gravity Forms confirmation\n- Whoever got the url will go on confirmation, no authentication performed\n- The confirmation will use latest field values from database which could have changed\n- No payment status checking\n\n#### Redirect URL Retrieval Failure Handling\n\nAfter form submit, this plugin sends order information to SagePay in exchange for a redirect URL(the SagePay hosted checkout form URL).\n\nBy default, when redirect URL retrieval fails:\n1. Mark entry payment status as `Failed`\n1. [Log](https://docs.gravityforms.com/logging-and-debugging/) the error\n1. `wp_die` **immediately**\n\nCommon failure reasons:\n- Incorrect vendor code\n- Server IP not whitelisted\n\nTips: Check the [log](https://docs.gravityforms.com/logging-and-debugging/).\n\n\nYou can use `'gf_sagepay_redirect_url_failure_wp_die'` filter to:\n- continue Gravity Forms' feed and confirmation flow\n- perform extra operations\n- redirect to a different error page\n\n**Important:** If this filter returns `false`, normal Gravity Forms' feed and confirmation flow continues.\nImproper settings might lead to disasters.\n\nExample:\n```php\nadd_filter('gf_sagepay_redirect_url_failure_wp_die', function(bool $shouldWpDie, ServerAuthorizeResponse $response, Entry $entry, GFPaymentAddOn $addOn): bool {\n\n    // Do something.\n\n    return true; // Do `wp_die`\n    return false; // Don't `wp_die`, continue normal flow\n    return $shouldWpDie; // Undecisive\n}, 10, 4);\n```\n\n### Required Reading List\n\nRead the followings before developing:\n- [SagePay Server: Understanding the process](https://www.sagepay.co.uk/support/15/36/sage-pay-server-understanding-the-process)\n- [SagePay Server integration kits, protocols and documents](https://www.sagepay.co.uk/support/find-an-integration-document/server-integration-documents)\n- [Gravity Forms: GFPaymentAddOn](https://docs.gravityforms.com/gfpaymentaddon/)\n- [Gravity Forms: Entry Object](https://docs.gravityforms.com/entry-object/)\n- [Omnipay: Sage Pay](https://github.com/thephpleague/omnipay-sagepay)\n- [thephpleague/omnipay-sagepay#45 (comment)](https://github.com/thephpleague/omnipay-sagepay/pull/45#issuecomment-150667423)\n- [thephpleague/omnipay-sagepay#255 (comment)](https://github.com/thephpleague/omnipay/issues/255#issuecomment-90509446)\n\n### Gravity Forms\n\nGravity Forms has undocumented hidden magics, read its source code.\n\n### Testing\n\n```bash\ncomposer style:check\n```\n\nPull requests without tests will not be accepted!\n\n## Feedback\n\n**Please provide feedback!** We want to make this library useful in as many projects as possible.\nPlease submit an [issue](https://github.com/ItinerisLtd/gf-sagepay/issues/new) and point out what you do and don't like, or fork the project and make suggestions.\n**No issue is too small.**\n\n## Change Log\n\nPlease see [CHANGELOG](./CHANGELOG.md) for more information on what has changed recently.\n\n## Security\n\nIf you discover any security related issues, please email [dev@itineris.co.uk](mailto:dev@itineris.co.uk) instead of using the issue tracker.\n\n## Credits\n\n[GF SagePay](https://github.com/ItinerisLtd/gf-sagepay) is a [Itineris Limited](https://www.itineris.co.uk/) project created by [Tang Rufus](https://typist.tech).\n\nFull list of contributors can be found [here](https://github.com/ItinerisLtd/gf-sagepay/graphs/contributors).\n\n## License\n\n[GF SagePay](https://github.com/ItinerisLtd/gf-sagepay) is released under the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitinerisltd%2Fgf-sagepay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitinerisltd%2Fgf-sagepay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitinerisltd%2Fgf-sagepay/lists"}