Giter Club home page Giter Club logo

hellopay-php-sdk's Introduction

helloPay SDK For PHP

Build Status Latest Stable Version

helloPay is a secure payment platform, created by a team that has brought together their extensive knowledge and experience in global payment systems to make sending and receiving money easier, both for personal and commercial use. It is legally established as HELLOPAY SINGAPORE PTE. LTD, 12 Prince Edward Road #06-08, Bestway Building, Singapore 079212.

When you register with us, you just need your mobile number and email address to get started. Our network will then enable you to safely make online purchases without revealing your payment details. All your data and transactions are kept 100% secure by our experienced anti-fraud team, and our security measures adhere to the highest safety and security standards.

helloPay was also created for businesses, offering flexible payment options to your customers to accelerate growth. A range of local Singaporean payment channels, including credit/debit card and Direct Debit for Internet Bank users via eNETS, is available both on mobile and online devices to enable you to provide a seamless checkout experience. We strive to meet your daily business needs with transparent and affordable price plans, a simple one-step integration process and daily payouts, so you can focus on what matters.

Installation

The helloPay PHP SDK can be installed with Composer. Add the helloPay PHP SDK package to your composer.json file.

{ 
  "require": { "hellopay/php-sdk": "dev-master" } 
}

Usage

Note: This version of the helloPay SDK for PHP requires PHP 5.4 or greater.

Cancel a transaction example

$helloPay = new \HelloPay\HelloPay([
    'shopConfig' => '{shop-config}',
    'apiUrl' => '{api-url}',
    //'sslEnabled' => true|false //optional
]);

try {
	$purchaseId = 'AAEAAADoKU642BAQq_wQDOlqdB5nbGFlWoZMKyz5tOFWC64mbMdXZMLm';
	$response = $helloPay->cancelTransaction($purchaseId);
} catch(HelloPay\Exceptions\HelloPayResponseException $e) {
	  // When helloPay returns an error
      echo 'There\'s an error: ' . $e->getMessage();
      exit;
} catch(HelloPay\Exceptions\HelloPaySDKException $e) {
	  // When validation fails or other local issues
      echo 'helloPay SDK returned an error: ' . $e->getMessage();
      exit;
}

if ($response) {
    echo "Transaction has been cancelled successfully!";
} else {
    echo $helloPay->getLastMessage();
}

Tests

  1. Composer is a prerequisite for running the tests. Install composer globally, then run composer install to install required files.

  2. The tests can be executed by running this command from the root directory:

$ ./vendor/bin/phpunit

License

Please see the license file for more information.

hellopay-php-sdk's People

Contributors

chienhoang avatar

Watchers

James Cloos avatar Thanh Nguyen Duc  avatar

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.