sahlowle/tappayment
Composer 安装命令:
composer require sahlowle/tappayment
包简介
:package_description
README 文档
README
Laravel Tap Payment
Laravel Tap Payment makes integration with payment gateway easier for Laravel developers, and that's by offering a wide range of functions to consume the tap transactions API.
Requirements
This package requires php 7.4 or higher.
Installation
You can install the package via composer:
composer require sahlowle/tappayment
Setup and configuration
You can also publish the config file using
php artisan vendor:publish --tag="tap_payment.config"
After that, you can see the file in app/tap_payment.php and update it. You might need to change the model variable to use your custom User model.
Tap Keys
Before being able to use this package, you should configure your tap environment in your application's congig\tap_payment.php file.
<?php
return [
/*
|--------------------------------------------------------------------------
| Tap Payment Config
*/
'base_url' => 'https://api.tap.company/v2/',
'token' => 'your-key',
'currency' => 'SAR',
'redirect_url' => 'http://localhost:8000/redirect_url',
];
Usage
Create Charge Transaction
first create charge transaction
use Sahlowle\TapPayment\Tap; $body = [ 'amount'=> 200, 'description'=> 'iphone 14 pro max', 'first_name'=> 'Ahmed', 'last_name'=> 'Ali', 'email'=> 'ahmed@gmail.com', 'country_code'=> 966, 'phone_number'=> 0555551122, ]; $response = Tap::charge($body); return redirect($response->transaction->url);
get payment details
here you can get details of payment transaction and check payment status
use Sahlowle\TapPayment\Tap; $tap_id = request()->tap_id; $response = Tap::getCharge($tap_id); if ($response->status == "CAPTURED"){ return "successful payment"; }
response will be like this
{
"id": "chg_TS06A5720231845i8D90606533",
"object": "charge",
"live_mode": false,
"customer_initiated": true,
"api_version": "V2",
"method": "GET",
"status": "CAPTURED",
"amount": 200,
"currency": "SAR",
"threeDSecure": true,
"card_threeDSecure": false,
"save_card": false,
"merchant_id": "",
"product": "GOSELL",
"statement_descriptor": "iphone 14 pro max",
"description": "iphone 14 pro max",
"metadata": {
"udf1": "test 1",
"udf2": "test 2"
},
"order": {
"id": "ord_Ddhv57231545uhb761r5Q40"
},
"transaction": {
"authorization_id": "098807",
"timezone": "UTC+03:00",
"created": "1686077202117",
"expiry": {
"period": 30,
"type": "MINUTE"
},
"asynchronous": false,
"amount": 200,
"currency": "SAR"
},
"reference": {
"track": "tck_TS05A5720231845Ka680606548",
"payment": "5706231845065483602",
"gateway": "123456789012345",
"acquirer": "315715098807",
"transaction": "txn_0001",
"order": "ord_0001"
},
"response": {
"code": "000",
"message": "Captured"
},
"security": {
"threeDSecure": {
"id": "3ds_TS02A4220231846Zl460606117",
"status": "Y"
}
},
"acquirer": {
"response": {
"code": "00",
"message": "Approved"
}
},
"gateway": {
"response": {
"code": "0",
"message": "Transaction Approved"
}
},
"card": {
"object": "card",
"first_six": "411111",
"scheme": "VISA",
"brand": "VISA",
"last_four": "1111"
},
"receipt": {
"id": "205806231845068295",
"email": false,
"sms": true
},
"customer": {
"id": "cus_TS05A4320231846Rh4u0606555",
"first_name": "Ahmed",
"last_name": "Ali",
"email": "ahmed@gmail.com",
"phone": {
"country_code": "966",
"number": "95867474"
}
},
"merchant": {
"country": "AE",
"currency": "AED",
"id": "18829646"
},
"source": {
"object": "token",
"type": "CARD_NOT_PRESENT",
"payment_type": "CREDIT",
"payment_method": "VISA",
"channel": "INTERNET",
"id": "tok_OocX342315464haQ6N75d607"
},
"redirect": {
"status": "SUCCESS",
"url": "http://localhost:8000/redirect_url"
},
"post": {
"status": "SUCCESS",
"url": "http://localhost:8000/redirect_url"
},
"activities": [
{
"id": "activity_TS06A4320231846Xj810606587",
"object": "activity",
"created": 1686077202117,
"status": "INITIATED",
"currency": "SAR",
"amount": 200,
"remarks": "charge - created"
},
{
"id": "activity_TS06A5520231846p2J10606181",
"object": "activity",
"created": 1686077215181,
"status": "CAPTURED",
"currency": "SAR",
"amount": 200,
"remarks": "charge - captured"
}
],
"auto_reversed": false
}
Test Cards
use card number and any future date
Card Num : 4111 1111 1111 1111 Date : any future date CVV : any cvv
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email sahlowle@gmail.com instead of using the issue tracker.
Credits
License
MIT. Please see the license file for more information.
sahlowle/tappayment 适用场景与选型建议
sahlowle/tappayment 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 06 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payment」 「laravel」 「paytabs」 「tap payment」 「TapPayment」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sahlowle/tappayment 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sahlowle/tappayment 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sahlowle/tappayment 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Official laravel package to implement PayTabs integration with laravel apps
Official laravel package to implement PayTabs integration with laravel apps
Alfabank REST API integration
Laravel Paytabs
Paytabs API for Laravel.
Laravel Paytabs
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-06-06