Giter Site home page Giter Site logo

payfast-common's Introduction

payfast-common

Payfast common class for modules

This is the Payfast common class for modules.

Installation

You can install this module using composer:

composer require payfast/payfast-common

Module parameters for pfValidData()

Declare the relevant $moduleInfo values when using the pfValidData() method, for example:

$moduleInfo = [
    "pfSoftwareName"       => 'OpenCart',
    "pfSoftwareVer"        => '4.0.2.0',
    "pfSoftwareModuleName" => 'PF_OpenCart',
    "pfModuleVer"          => '2.3.1',
];

$pfValid = $payfastCommon->pfValidData($moduleInfo, $pfHost, $pfParamString);

Debug Mode

Configure debug mode by passing true|false when instantiating the PayfastCommon class.

$payfastCommon = new PayfastCommon(true);

Breaking Change since v1.1.0

We have migrated from static to instance methods.

For example, prior to v1.1.0 we used:

// Debug mode
define('PF_DEBUG', true);

// Module parameters for pfValidData
define('PF_SOFTWARE_NAME', 'GravityForms');
define('PF_SOFTWARE_VER', '2.8.7');
define('PF_MODULE_NAME', 'PayFast-GravityForms');
define('PF_MODULE_VER', '1.5.4');

// Calling methods on PayfastCommon
$pfData = PayfastCommon::pfGetData();
PayfastCommon::pflog('Verify data received');

But this has now become:

// Debug mode
$payfastCommon = new PayfastCommon(true);

// Module parameters for pfValidData
$moduleInfo = [
    "pfSoftwareName"       => 'GravityForms',
    "pfSoftwareVer"        => '2.8.7',
    "pfSoftwareModuleName" => 'PayFast-GravityForms',
    "pfModuleVer"          => '1.5.4',
];
$pfValid = $payfastCommon->pfValidData($moduleInfo, $pfHost, $pfParamString);

// Calling methods on PayfastCommon
$pfData = $payfastCommon->pfGetData();
$payfastCommon->pflog('Verify data received');

payfast-common's People

Contributors

appinlet avatar

Watchers

John Clarke avatar  avatar

Forkers

appinlet

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.