定制 orkhanahmadov/goldenpay 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

orkhanahmadov/goldenpay

Composer 安装命令:

composer require orkhanahmadov/goldenpay

包简介

GoldenPay payment library for PHP and Laravel framework

README 文档

README

If you are using Laravel, you can use laravel-goldenpay package instead for better integration with extra features.

Latest Stable Version Latest Unstable Version Total Downloads GitHub license

Build Status Test Coverage Maintainability Quality Score StyleCI

Requirements

PHP 7.2 or higher, with json extension.

Installation

composer require orkhanahmadov/goldenpay

Usage

First, instantiate Orkhanahmadov\Goldenpay\Goldenpay and call authenticate() method with "auth key" and "merchant name". Both can be acquired from Goldenpay merchant dashboard.

use Orkhanahmadov\Goldenpay\Goldenpay;

$goldenpay = new Goldenpay();
$goldenpay->authenticate('auth-key-here', 'merchant-name-here');

Getting payment key

To get new payment key use payment method.

Method accepts following arguments:

  • Amount - Amount to charge. Only integer accepted. For example 10.25 needs to be converted to 1025
  • Card type - Requires instance of Orkhanahmadov\Goldenpay\Enums\CardType. CardType::VISA() for VISA, CardType::MASTERCARD() for MasterCard
  • Description - Payment related description
  • Language (optional) - Sets payment page interface language. Requires instance of Orkhanahmadov\Goldenpay\Enums\Language. Language::EN() for english, Language::RU() for russian, Language::AZ() for azerbaijani. Default is azerbaijani
$paymentKey = $goldenpay->payment(100, CardType::VISA(), 'item-description', Language::EN());

Method will return instance of Orkhanahmadov\Goldenpay\Response\PaymentKey. You can access payment key and payment url from this object instance.

$paymentKey->getCode(); // endpoint response code
$paymentKey->getMessage(); // endpoint response message
$paymentKey->getPaymentKey(); // unique payment key
$paymentKey->paymentUrl(); // payment url. you should redirect user to this url to start payment

Important! Goldenpay charges all payments only in AZN.

Checking payment result

To check payment result use result method.

Method accepts following arguments:

  • Payment key - Previously available payment key
$paymentResult = $goldenpay->result('payment-key-here');

Method also accepts instance of Orkhanahmadov\Goldenpay\Response\PaymentKey as an argument.

Method will return instance of Orkhanahmadov\Goldenpay\Response\PaymentResult. You can access following properties from this object instance:

$paymentResult->getCode(); // status code
$paymentResult->getMessage(); // status message
$paymentResult->getPaymentKey(); // instance of Orkhanahmadov\Goldenpay\Response\PaymentKey
$paymentResult->getMerchantName(); // merchant name
$paymentResult->getAmount(); // charged amount in integer format. 100 = 1.00
$paymentResult->getCheckCount(); // shows how many times this payment key result checked
$paymentResult->getPaymentDate(); // \DateTimeImmutable instance of payment date
$paymentResult->getCardNumber(); // charged card number. only first 6 digits and last 4 digits. Example: 422865******8101
$paymentResult->getLanguage(); // 2 letter interface language: 'lv', 'en' or 'ru'
$paymentResult->getDescription(); // description used for payment
$paymentResult->getReferenceNumber(); // payment reference number

You can also use global helper function. Calling this function requires passing "auth key" and "merchant name".

$goldenpay = goldenpay('auth-key-here', 'merchant-name-here'); // returns instance of "Orkhanahmadov\Goldenpay\Goldenpay"
$goldenpay->payment(100, CardType::VISA(), 'your-description', Language::EN());

Orkhanahmadov\Goldenpay\Goldenpay implements Orkhanahmadov\Goldenpay\GoldenpayInterface. You can use this interface as abstraction for dependency injection.

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email ahmadov90@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

orkhanahmadov/goldenpay 适用场景与选型建议

orkhanahmadov/goldenpay 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 502 次下载、GitHub Stars 达 10, 最近一次更新时间为 2019 年 05 月 01 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 orkhanahmadov/goldenpay 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 502
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 10
  • 点击次数: 13
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 10
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-05-01