Download the PHP package cuonghuynh/easypay2-laravel-5 without Composer

On this page you can find all versions of the php package cuonghuynh/easypay2-laravel-5. 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 easypay2-laravel-5

EasyPay V.2 Payment for Laravel 5

Laravel

After updating composer, add the PackageServiceProvider to the providers array in config/app.php

CuongHuynh\EasyPay2\PackageServiceProvider::class,

You can optionally use the facade for shorter code. Add this to your facades:

'EasyPay2' => CuongHuynh\EasyPay2\Facades\EasyPay2Facade::class

Publish the config-file.

php artisan vendor:publish

You will have easypay2.php in config folder

Usage

EasyPay Flow

workshop image

Settings

Switch to sandbox mode by set to true in config/easypay2.php

return [
    'sandbox_flag' => true,

    'sandbox' => [
        'endpoint' => 'https://test.wirecard.com.sg/easypay2/paymentpage.do?',
        'mid' => 'xxx',
        'security_key' => 'xxx',
        'security_seq' => 'xxx',
    ],

    'live' => [
        'endpoint' => 'url',
        'mid' => 'xxx',
        'security_key' => 'xxx',
        'security_seq' => 'xxx',
    ]
];

Make a Transaction

Set URL to receive payment status and return after customer make payment.

EasyPay2::set('statusurl', URL);
EasyPay2::set('returnurl', URL);

Set other payment parameters

Send Transaction

Use a Laravel helper to redirect customer to Payment page

return redirect($requestUrl);

Receive Payment status

This process totally in backend, customer can't see Status response. After customer do payment, EasyPay will send a POST request to statusurl with parameters (see workflow image).

In your controller, get all inputs

public function postEasyPayStatusResponse(Request $request)
{
     $response = $request->all();

    //...

For example, now security seq is amt,ref,cur,mid,transtype so full formula is

$mdHashed : hash512($amt, $ref, $cur, $mid, $transtype) . $status . $error . $security_key
$epSignature : get('TM_Signature')

Implement, cause Easypay make a new request so we need regenerate values for EasyPay instance. Upon security seq you will set parameters needed for the instance. In the case:

$status = $this->request->get('TM_Status');
$error = $this->request->get('TM_Error');
$security_key = EasyPay2::get('security_key');

EasyPay2::set('amt', $amtOfOldRefId);
EasyPay2::set('ref', $oldRefId);
EasyPay2::set('cur', $currencyOfOldRefId);
EasyPay2::set('transtype', $transtypeOfOldRefId);

$data = EasyPay2::getHashDataFromSecuritySeq() . $status . $error . $security_key;

$mdHashed = EPHelper::hashSha512($data);
$signature = $this->request->get('TM_Signature');

Check if $mdHashed is same $signature, the request is valid and make other steps.

Send Acknowledge Response

After check signature in status response, Merchant must to send ACK to EasyPay to confirm receiving request.

EasyPay2::set('ack', 'YES');
$requestUrl = EasyPay2::requestUrl();

Send REVERSAL / VOID request if don't receive status response

Content updating ...

License

This EasyPay2 for Laravel 5 is open-sourced software licensed under the MIT license


All versions of easypay2-laravel-5 with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version 5.0.x|5.1.x|5.2.x
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 cuonghuynh/easypay2-laravel-5 contains the following files

Loading the files please wait ....