定制 laraditz/payex 二次开发

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

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

laraditz/payex

Composer 安装命令:

composer require laraditz/payex

包简介

Simple laravel package for Payex Payment Gateway.

README 文档

README

Latest Version on Packagist Total Downloads GitHub Actions

A simple laravel package for Payex Payment Gateway.

Installation

You can install the package via composer:

composer require laraditz/payex

Before Start

Configure your variables in your .env (recommended) or you can publish the config file and change it there.

PAYEX_EMAIL=<your_payex_email_here>
PAYEX_KEY=<your_payex_key_here>
PAYEX_SECRET=<your_payex_secret_here>
PAYEX_SANDBOX_MODE=true # true or false for sandbox mode

(Optional) You can publish the config file via this command:

php artisan vendor:publish --provider="Laraditz\Payex\PayexServiceProvider" --tag="config"

Run the migration command to create the necessary database table.

php artisan migrate

Available Methods

Below are all methods available under this package.

  • createPayment(array $requestPayload) - Create payment intent.
  • getTransactions(array $params) - Get all transactions.
  • getTransaction(string $id) - Get specific transaction by txn_id.

Usage

Create Payment

To create payment and get the payment URL to be redirected to. You can use service container or facade.

// Create a payment

// Using service container
$payex = app('payex')->createPayment([
            'amount' => '100', //in cents
            'customer_name' => 'Farhan',
            'description' => 'some description here',
            'return_url' => 'https://yourreturn.url'
        ]);

// Using facade
$payment = \Payex::createPayment([
            'amount' => '100', //in cents
            'customer_name' => 'Farhan',
            'description' => 'some description here',
            'return_url' => 'https://yourreturn.url'
        ]);

Return example:

[
    "status" => true,
    "id" => "991f24s0-5470-41c5-9b3c-9841d72d32e5",
    "ref_no" => "Xvs9k43y",
    "currency_code" => "MYR",
    "key" => "f5e3168fef3b5ed7826c689a37dce58e",
    "payment_url" => "https://api.payex.io/Payment/Form/f5e3168fef3b5ed7826c689a37dce58e"
]

Redirect to the payment_url to proceed to Payex payment page. Once done, you will be redirected to the return_url. Below is the sample response returned.

{
  "amount": "1",
  "currency": "MYR",
  "customer_name": "Farhan",
  "description": "some description here",
  "reference_number": "Xvs9k43y",
  "mandate_reference_number": null,
  "payment_intent": "f5e3168fef3b5ed7826c689a37dce58e",
  "collection_id": "zg3RcR5y",
  "invoice_id": null,
  "txn_id": "PX1068201c1315547307",
  "external_txn_id": "20230502211212840110171535215420691",
  "response": "SUCCESS",
  "auth_code": "00",
  "auth_number": null,
  "txn_date": "20230502075957",
  "fpx_mode": null,
  "fpx_buyer_name": null,
  "fpx_buyer_bank_id": null,
  "fpx_buyer_bank_name": null,
  "card_holder_name": null,
  "card_number": null,
  "card_expiry": null,
  "card_brand": "N.A.",
  "card_issuer": null,
  "card_on_file": null,
  "signature": "bcd39079a409751ebb4c64c1f8acc53cd0439896a731a513b6753e9f909d6a08a79a04cd5a9cf8d6d27d93206dfa35074ee607e790e242ee547407fa5af9f05a",
  "txn_type": "Touch 'n Go eWallet",
  "nonce": "eMygaAdk3cryXM5DSLoidNIQrwhW7b0wCmQ6CG0B6z5VNeBbm8yXhLjAPQcXL0WL",
  "metadata": "{}"
}

Event

This package also provide some events to allow your application to listen to it. You can create your listener and register it under event below.

Event Description
Laraditz\Payex\Events\CallbackReceived Received backend response from Payex for a payment. Can use to update your payment status and other details

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 raditzfarhan@gmail.com instead of using the issue tracker.

Credits

License

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

laraditz/payex 适用场景与选型建议

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

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-09