Giter Club home page Giter Club logo

plott-global-payments's Introduction

Plott / Freightport

Global Payments API

A small set of tools to allow an invoice to be paid via Global Payments hosted payments page, after capturing the minimum required information from the user first.

Design to sit on a sub-folder of a website, e.g. freightport.co.uk/invoices, etc.

Config

composer install
cp .env.example .env

And populate the following variables in .env:

# The full URI the application is running on
APP_URL=

# Global Payments merchant ID, Account ID, Secret Key, and sandbox or production hosted payment page
GP_MERCHANT_ID=
GP_ACCOUNT_ID=
GP_SECRET=
GP_PAYMENT_URL=https://pay.sandbox.realexpayments.com/pay

What This Does...

index.php starts by determining what state we're in (information has been captured or not, etc.) as well as loading in packages and .env vars. For a first hit, it will load includes/form.php and display to the user.

Once the user has populated the form, we'll validate it, and then use include/dispatch.php to spin up a new classes/GlobalPaymentsService.php instance, wrap up the information along with the .env variables and generate some JSON. This JSON is generated by the Global Payments PHP SDK and contains information about the order, and some hashes, account IDs, etc.

When the JSON has been generated, our app will then spin up a second page (includes/iframe.php) with a button and the Global Payments JS SDK included. Upon clicking the button, the JS SDK populates an iframe with the hosted payment page.

Upon successful payment, the iframe posts a message back to the SDK allowing us to alert the user that their payment has been successful or failed.

Resources

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.