coreproc/paymaya-sdk
Composer 安装命令:
composer require coreproc/paymaya-sdk
包简介
A better PayMaya SDK
关键字:
README 文档
README
This is an unofficial SDK for PayMaya using PHP but offers improvements over the official PayMaya codebase.
Installation
You can install the package via composer:
composer require coreproc/paymaya-sdk
Usage
Read the documentation here: https://s3-ap-southeast-1.amazonaws.com/developers.paymaya.com.checkout/checkout.html
To get development API keys and credit cards, check the link here: https://developers.paymaya.com/blog/entry/api-test-merchants-and-test-cards
Initiate checkout of items
Here is an example of how to use this SDK with checkout. The example is based off the payload found in the documentation.
$payMayaApi = new \CoreProc\PayMaya\PayMayaApi('<SECRET_API_KEY>', '<PUBLIC_API_KEY>', \CoreProc\PayMaya\PayMayaApi::ENVIRONMENT_SANDBOX); $checkout = new \CoreProc\PayMaya\Requests\Checkout(); $checkout->setTotalAmount( (new \CoreProc\PayMaya\Requests\TotalAmount()) ->setCurrency('PHP') ->setValue(6304.90) ->setDetails( (new \CoreProc\PayMaya\Requests\AmountDetail()) ->setDiscount(300.00) ->setServiceCharge(50.00) ->setShippingFee(200.00) ->setTax(691.60) ->setSubtotal(5763.30)) )->setBuyer( (new \CoreProc\PayMaya\Requests\Buyer()) ->setFirstName('Juan') ->setMiddleName('dela') ->setLastName('Cruz') ->setContact( (new \CoreProc\PayMaya\Requests\Contact()) ->setEmail('paymayabuyer1@gmail.com') ->setPhone('+63(2)1234567890') )->setShippingAddress( (new \CoreProc\PayMaya\Requests\Address()) ->setLine1('9F Robinsons Cybergate 3') ->setLine2('Pioneer Street') ->setCity('Mandaluyong City') ->setState('Metro Manila') ->setZipCode('12345') ->setCountryCode('PH') )->setBillingAddress( (new \CoreProc\PayMaya\Requests\Address()) ->setLine1('9F Robinsons Cybergate 3') ->setLine2('Pioneer Street') ->setCity('Mandaluyong City') ->setState('Metro Manila') ->setZipCode('12345') ->setCountryCode('PH') ) ->setIpAddress('125.60.148.241') )->setItems([ (new \CoreProc\PayMaya\Requests\Item()) ->setName('Canvas Slip Ons') ->setCode('CVG-096732') ->setDescription('Shoes') ->setQuantity(3) ->setAmount( (new \CoreProc\PayMaya\Requests\ItemAmount()) ->setValue(1621.10) ->setDetails( (new \CoreProc\PayMaya\Requests\AmountDetail()) ->setDiscount(100.00) ->setSubtotal(1721.10) ) )->setTotalAmount( (new \CoreProc\PayMaya\Requests\TotalAmount()) ->setValue(4863.30) ->setDetails( (new \CoreProc\PayMaya\Requests\AmountDetail()) ->setDiscount(300) ->setSubtotal(5163.30) ) ), (new \CoreProc\PayMaya\Requests\Item()) ->setName('PU Ballerina Flats') ->setCode('CVG-096733') ->setDescription('Shoes') ->setQuantity(1) ->setAmount( (new \CoreProc\PayMaya\Requests\ItemAmount()) ->setValue(600) )->setTotalAmount( (new \CoreProc\PayMaya\Requests\TotalAmount()) ->setValue(600) ), ])->setRedirectUrl( (new \CoreProc\PayMaya\Requests\RedirectUrl()) ->setSuccess('http://shop.test/success') ->setFailure('http://shop.test/failure') ->setCancel('http://shop.test/cancel') )->setRequestReferenceNumber('0001'); $checkoutResponse = $payMayaApi->checkout($checkout); echo $checkoutResponse->getRedirectUrl();
Testing
No tests yet.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email chris.bautista@coreproc.ph instead of using the issue tracker.
Credits
Support us
CoreProc is a software development company that provides software development services to startups, digital/ad agencies, and enterprises.
Learn more about us on our website.
License
The MIT License (MIT). Please see License File for more information.
coreproc/paymaya-sdk 适用场景与选型建议
coreproc/paymaya-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.28k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2019 年 09 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「coreproc」 「paymaya-sdk」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 coreproc/paymaya-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 coreproc/paymaya-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 coreproc/paymaya-sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Easily add a virtual wallet to your Laravel models. Features multiple wallets and a ledger system to help keep track of all transactions in the wallets.
Store and handle devices connecting to your web application.
API builder for Laravel
Paymaya SDK for Laravel
统计信息
- 总下载量: 2.28k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 20
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-18