承接 arielmejiadev/pagalogt 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

arielmejiadev/pagalogt

Composer 安装命令:

composer require arielmejiadev/pagalogt

包简介

PagaloGT payment processing library that provides a fluent syntax, testing methods and has Cybersource implementation.

README 文档

README

Latest Version on Packagist Total Downloads

It provides a fluent syntax to make payments in Laravel with PagaloGT payment gateway.

To learn more about the package here the documentation site

Installation

You can install the package via composer:

composer require arielmejiadev/pagalogt

Publish config file

Its not necessary but you can publish the config file:

php artisan vendor:publish --tag=pagalogt-config

Usage

  • Add your PagaloGT credentials on the app .env file:

You can get the credentials Here, you need to create an account and follow some steps with PagaloGT.

PAGALO_TEST_IDEN_EMPRESA='{TestPagaloIdenEmpresa}'
PAGALO_TEST_TOKEN='{TestPagaloToken}'
PAGALO_TEST_KEY_PUBLIC='{TestPagaloKeyPublic}'
PAGALO_TEST_KEY_SECRET='{TestPagaloKeySecret}'
PAGALO_ENVIRONMENT='test'
  • For development and testing (to avoid real transactions):
$payment = new PagaloGT();
return $payment->add(1, 'Test transaction', 100.00)
    ->setClient('John', 'Doe', 'john@doe.com')
    ->withTestCard('John Doe')
    ->withTestCredentials()
    ->pay();
  • Using the Facade
return PagaloGT::add(1, 'Test transaction', 100.00)
    ->setClient('John', 'Doe', 'john@doe.com')
    ->withTestCard('John Doe')
    ->withTestCredentials()
    ->pay();
  • On production
PAGALO_IDEN_EMPRESA='{LivePagaloIdenEmpresa}'                                             
PAGALO_TOKEN='{LivePagaloToken}'
PAGALO_KEY_PUBLIC='{LivePagaloKeyPublic}'
PAGALO_KEY_SECRET='{LivePagaloKeySecret}'
PAGALO_ENVIRONMENT='live'
return PagaloGT->add(1, 'Test transaction', 100.00)
    ->setClient('John', 'Doe', 'john@doe.com')
    ->setCard('JOHN JOSEPH DOE DULLIE', 'XXXX XXXX XXXX XXXX', 12, 2022, 742)
    ->pay();

Validate response

In Laravel 5.5 to Laravel 6.x

The package provide constants to validate response you can do something like:

$response['decision'] === 'ACCEPT';
$response['reasonCode'] === 100;

To avoid magic numbers you can do something like this:

use \ArielMejiaDev\PagaloGT\PagaloGT;
// ...
$response = PagaloGT::add(1, 'Test transaction from Laravel 5.5', 100.00)
        ->setClient('John', 'Doe', 'john@doe.com')
        ->withTestCard('John Doe')
        ->withTestCredentials()
        ->pay();
    if($response['decision'] === PagaloGT::APPROVE_DECISION && 
       $response['reasonCode'] === PagaloGT::APPROVE_REASON_CODE ) {
        // do something
    }

In Laravel 7 and 8

You can use the old validation way (since Laravel 5.5 - 6.x)

In laravel 7 and 8 the library change response, so you can validate like this:

$response = PagaloGT::add(1, 'product', 100.00)->withTestCard()->withTestCredentials()->pay();
if($response->successful()) {
    // do something
}

Other methods to validate:

$response->fail();
$response->successful();
$response->ok()
$response->header('single header');
$response->headers();

Support Cybersource:

The library is ready to support cybersource transactions, it only needs to add a config variable:

PAGALO_USE_CYBERSOURCE=true

You need to add a script to generate the deviceFingerPrint on your checkout form.

In the docs you can get scripts ready to use for:

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email arielmejiadev@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 75
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固