承接 yadahan/laravel-cardcom 相关项目开发

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

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

yadahan/laravel-cardcom

Composer 安装命令:

composer require yadahan/laravel-cardcom

包简介

Laravel Cardcom provides an expressive, fluent interface to Cardcom's billing services.

README 文档

README

Build Status StyleCI Total Downloads GitHub license

Installation

Note: Laravel Cardcom is currently in beta.

Laravel Cardcom requires Laravel 5.4 or higher, and PHP 7.0+. You may use Composer to install Laravel Cardcom into your Laravel project:

composer require yadahan/laravel-cardcom

Configuration

Laravel 5.5 and higher the service provider and facade will automatically get registered.

In Laravel 5.4, after installing the Laravel Cardcom, register the Yadahan\Cardcom\CardcomServiceProvider in your config/app.php configuration file:

'providers' => [
    // Other service providers...

    Yadahan\Cardcom\CardcomServiceProvider::class,
],

Also, add the Cardcom facade to the aliases array in your app configuration file:

'Cardcom' => Yadahan\Cardcom\Facades\Cardcom::class,

Next, publish its config using the vendor:publish Artisan command:

php artisan vendor:publish --tag="cardcom-config"

You will also need to add credentials for your terminal. These credentials should be placed in your config/cardcom.php configuration file, For example:

'terminals' => [
    'default' => [
        'terminal' => 'your-terminal',
        'username' => 'your-username',
        'api_name' => 'your-api-name',
        'api_password' => 'your-api-password',
    ]
]

Basic Usage

Charge a credit card:

Cardcom::card('4580000000000000', '01', '2020')->charge(10, 'ILS');
// With optional payments parameter
Cardcom::card('4580000000000000', '01', '2020')->charge(10, 'ILS', 3);

Refund a credit card:

Cardcom::card('4580000000000000', '01', '2020')->refund(10, 'ILS');
// With optional payments parameter
Cardcom::card('4580000000000000', '01', '2020')->refund(10, 'ILS', 3);

Cancel a transaction:

// The first (required) parameter is the transaction number
// The second (optional, default false) parameter, is cancel or refund transaction
Cardcom::cancel('12345678', true);
// With optional pertialy amount parameter (The second parameter must be false)
Cardcom::cancel('12345678', false, 10);

Create a credit card token:

Cardcom::card('4580000000000000', '01', '2020')->createToken();

Create and charge a credit card token:

$response = Cardcom::card('4580000000000000', '01', '2020')->createToken();

Cardcom::token($response['token'], '01', '2020')->charge(10, 'ILS');

Charge and create invoice

Cardcom::card('4580000000000000', '01', '2020')->charge(10, 'ILS')
    ->invoice([
        'customer_name'    => 'Test Test',
        'send_email'       => 'true',
        'invoice_language' => 'he',
        'email'            => 'test@test.com',
        'address_1'        => 'Address line 1',
        'address_2'        => 'Address line 2',
        'city'             => 'Test city',
        'phone'            => '031234567',
        'mobile'           => '0501234567',
        'customer_id'      => '1',
        'comments'         => 'Test comments',
        'currency'         => 'ILS',
        'vat_free'         => 'false',
        'account'          => 'true',
        'key'              => '1',
    ])
    ->invoiceItem([
        'description' => 'Test Product 1',
        'price'       => '10',
        'quantity'    => '1',
        'id'          => '1',
        'vat_free'    => 'false',
    ]);

Of course you can config the terminal you want to use:

Cardcom::setConfig(config('cardcom.terminals.other'))->card('4580000000000000', '01', '2020')->charge(10, 'ILS');
// Or
Cardcom::setConfig(['terminal' => '1000', 'username' => 'barak9611'])->card('4580000000000000', '01', '2020')->charge(10, 'ILS');

Contributing

Thank you for considering contributing to the Laravel Cardcom.

License

Laravel Cardcom is open-sourced software licensed under the MIT license.

yadahan/laravel-cardcom 适用场景与选型建议

yadahan/laravel-cardcom 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8.83k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2017 年 07 月 26 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「cardcom」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 yadahan/laravel-cardcom 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 yadahan/laravel-cardcom 我们能提供哪些服务?
定制开发 / 二次开发

基于 yadahan/laravel-cardcom 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 8.83k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 14
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-07-26