yadahan/laravel-cardcom
Composer 安装命令:
composer require yadahan/laravel-cardcom
包简介
Laravel Cardcom provides an expressive, fluent interface to Cardcom's billing services.
README 文档
README
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 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 yadahan/laravel-cardcom 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Alfabank REST API integration
Advanced Payment Gateway Package for Laravel with eSIM-based unified checkout, slug routing, CardCom API v11, Maya Mobile, and ResellerClub Integration
Laravel package for Accurate Online API integration.
Shared RCX Laravel DataTables UI and configuration helpers.
Boot a Laravel project on any machine with one command: app:serve installs missing tools (PHP, Node, Composer, Herd, Docker), creates .env, sets up the database, runs migrations, builds assets, starts a queue worker and serves via Herd, Sail or artisan serve; app:down cleanly stops everything it sta
Branded, diagnostic error pages (500, 403, 404, 419, 503) for Filament — native Filament UI, dark mode and translations out of the box.
统计信息
- 总下载量: 8.83k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-07-26