fatoorahpayment/gatewayintegration
Composer 安装命令:
composer require fatoorahpayment/gatewayintegration
包简介
package created for crazy idea company to handle the gateway integration for myfatoorah
README 文档
README
composer require fatoorahpayment/gatewayintegration
Guide of use
config file
please run this command to publish the config file that has essential keys
php artisan vendor:publish --tag=crazyfatoorahpackage-config php artisan vendor:publish --tag=crazyfatoorahpackage-views
-
after you publish your config file you will find key
test_modeits value istrueas default you can change it tofalseif you want to turn to live mode -
there are
api_token_keykey this key will have your token from myfatoorah account it have defualt token for test you can overwrite it any time later for your live token
please remember to add the key
MYFATOORAH_API_TOKEN_KEYto your .env file in your project
api endpoints
- for the Gateway integreation
there are two main endpoint
-
Call
initial_data()endpoint (optional step) => post request,- when you call this endpoint you have to send this keys request
{ "InvoiceAmount": 879564546546, // this is your amount you want "CurrencyIso": "KWD" // and this is the currency you prefer } -
Call
execute_payment()endpoint: => post request- the request you have to send is
{ "PaymentMethodId": 6, // this one you will get from the initial_data() endpoint "CustomerName": "fname lname", "DisplayCurrencyIso": "KWD", "MobileCountryCode": "965", "CustomerMobile": "12345678", "CustomerEmail": "mail@company.com", "InvoiceValue": 10, }
-
steps for creating this package
-
create new laravel project
-
packages folder
-
composer init
-
your composer.json file structure
-
your package structure
-
source code
-
publish the package
-
submit your package to packagist.org
references
-
publish-laravel-packagist
-
laravel-docs-packages
-
myfatoorah-docs
-
git tags references
-
write README file tutorial
some useful commands
- git tag // fetch all tags
- git tag {tag-name ex. v1.0.1} // create new tag
- git tag -d {tag name or many tags } delete one or many tags
- git push origin {tag name} // to push the tag you created after commit your updates
create laravel project
create your required version of laravel framework project, its preferable to be the latest version
packages folder
inside the base path of the created project
- create packages folder
- inside it create your prefered vendor name {any name you'd like } (this will be the vendor name of the package that composer will be creating )
- inside the vendor folder create your package folder {give it any name you'd prefer}
composer init
- after finishing previous steps navigate to your package folder and run this command composer init
-
this command will define the composer inside your package folder
- and will create src folder , your specific composer.json for this package
- then will ask you for details like your package name , description, etc
your composer.json file structure
your composer.json file should be like something like this
{
"name": "your-vendor-name/your-package-name",
"minimum-stability": "dev",
"prefer-stable": true,
"version": "1.0.0",
"description": "your package description ",
"type": "library", // this will be one of reserved key [library , project , etc what ever your package type will be ]
"license": "MIT", // your licence type will be here
"homepage": "https://github.com/crazyideaco/fatoorahPackage", //your-package-github-repo link
"keywords": ["laravel", "gateway", "fatoorah", "payment"], //key words that want to be found with on packagist.org
"autoload": {
"psr-4": {
"Fatoorahpayment\\Gatewayintegration\\": "src/"
}
},
"authors": [
{
/**
its prfered to be your git username, email
you may add this key homepage: and add your website url
*/
"name": "crazyideaco",
"email": "crazyideacompany@gmail.com"
}
],
/**
require and require-dev keys for the used or needed packages
*/
"require": {
"illuminate/support": "*"
},
"require-dev": {
"illuminate/support": "*"
},
"extra": {
"laravel": {
"providers": [
"Fatoorahpayment\\Gatewayintegration\\GatewayintegrationServiceProvider"
]
}
}
}
your package structure && source code
- it should be inside src folder
- create your prefered package structure that you will build it may be something like this
Fatoorahpayment └── Gatewayintegration └── src ├── Database │ └── migrations ├── Http │ └── controllers ├── Models ├── resources │ └── views └── routes
or what ever structure your want
- inside this sturcture your put your source code of the package
publish the package
-
inside the package folder run the git command git init
-
create your git repo whether it's github, gitlab, gitbucket ,etc
-
commit your code
-
push it
-
after pushing your package create tag based on your package version git tag v1.0.0 then git push --tags
-
after pushing your tags goto your repo and create release based on your tag
-
keep in mind that packagist keep track of the releases from your github and if you want to update your package you need to push to the main and your tag of the release
-
also the version key in your package composer.json file need to be the same as the release title
-
tags dont't accept updates so each update to the package you will creat tag for it
-
please keep this in your mind the tags are not updateable so if you want to update the package , so after implementing your updates remember to update the
versionkey in your composer.json file
submit your package to packagist.org
make sure your git repo has only the code or folders inside your package-name folder
then login to the packagist then submit your repo clone link
fatoorahpayment/gatewayintegration 适用场景与选型建议
fatoorahpayment/gatewayintegration 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 52 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 12 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payment」 「gateway」 「laravel」 「fatoorah」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 fatoorahpayment/gatewayintegration 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fatoorahpayment/gatewayintegration 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 fatoorahpayment/gatewayintegration 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
repository php library
Payyo Gateway for the Omnipay payment processing library
Client library to send SMS using Comilio SMS Gateway API (https://www.comilio.it)
Alfabank REST API integration
GovPayNet driver for the Omnipay payment processing library
BlueSnap driver for the Omnipay payment processing library
统计信息
- 总下载量: 52
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-20