syedaqeeqabbas/axcessms 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

syedaqeeqabbas/axcessms

Composer 安装命令:

composer require syedaqeeqabbas/axcessms

包简介

A Laravel package for integrating the Axcess Merchant Services (AMS) payment gateway, supporting single and recurring checkout flows.

README 文档

README

A Laravel package for Axcess Merchant Services (AxcessMS) — enabling seamless integration with Copy & Pay, Server-to-Server, and Scheduling APIs.

Features

  • ✅ Modular architecture (CopyAndPay, ServerToServer, Scheduling, Webhook)
  • 🔐 Secure webhook encryption support
  • ⚙️ Sandbox & production environments
  • 🧩 Service provider, config file & facade for Laravel
  • 💳 Easy checkout, payment, and subscription scheduling APIs

Installation

Use composer to manage your dependencies.

composer require syedaqeeqabbas/axcessms

Publish the configuration (Optional):

php artisan vendor:publish --tag=axcessms

Add credentials in your .env file:

AXCESSMS_ENVIRONMENT=production // use 'sandbox' for development or testing
AXCESSMS_ENTITY_ID=YOUR_ENTITY_ID
AXCESSMS_ACCESS_TOKEN=YOUR_ACCESS_TOKEN
AXCESSMS_ENCRYPTION_KEY=YOUR_ENCRYPTION_KEY_FOR_WEBHOOK

Example Usage

1️⃣ Copy & Pay Checkout

This feature allows you to initialize a checkout session for either a single payment or a scheduled (recurring) payment.

Once the checkout session is created, the API response provides a unique checkoutId.

This checkoutId is then passed to the view, where it is used to render the Copy and Pay payment widget (e.g., for VISA, MasterCard, or other supported brands).

Facade vs Helper (Quick Reference)

Both styles resolve to the same underlying service.

use Axcessms;

Axcessms::copyAndPay();   // Facade
copyAndPay();             // Helper

Axcessms::serverToServer();   // Facade
serverToServer();             // Helper
  • ✅ Use Facade if you prefer explicit imports
  • ✅ Use Helper for cleaner controllers & routes

For single or one time payment checkout:

$checkout = copyAndPay()->singlePaymentCheckout([
	            'amount' => 19.99,
	            'currency' => 'GBP',
	            'merchantTransactionId' => rand(10000, 99999), // Replace it with real unique Order ID or Checkout ID
	        ]);

return view('checkout')->with(['checkoutId' => $checkout['id']]);

For schedule or recurring payment checkout:

$checkout = copyAndPay()->schedulePaymentCheckout([
	            'amount' => 19.99,
	            'currency' => 'GBP',
	            'merchantTransactionId' => rand(10000, 99999), // Replace it with real unique Order ID or Checkout ID
	        ]); 

return view('checkout')->with(['checkoutId' => $checkout['id']]);

Frontend:

<form action="/payment/result" class="paymentWidgets" data-brands="VISA MASTER AMEX"></form>

<script src="{{ Axcessms::config()->baseUrl() }}/v1/paymentWidgets.js?checkoutId={{ $checkoutId }}" crossorigin="anonymous"></script>

<script>
    var wpwlOptions = {
        billingAddress: {},
        mandatoryBillingFields:{}, 
        style: "card"
    }
</script>

Check Payment Status:

// Inside of your Controller on /payment/result route

$response = copyAndPay()->status();

if ($response['status'])
{
	// Payment successfull
}
else
{
	// Payment failed
}

2️⃣ Server-to-Server

Use this mode when you want full control on your backend without using the Copy & Pay widget, or for operations like capturing, voiding, or refunding payments.

Exact parameters depend on your AxcessMS account and API documentation. The SDK sends them through as you provide.

Create Pre-authorize payment:

$payment = serverToServer()->preAuthorizePayment([
    'amount'          => 92,
    'currency'        => 'GBP',
    'paymentBrand'    => 'VISA',
    'card.number'     => '4200000000000000',
    'card.holder'     => 'Jane Jones',
    'card.expiryMonth'=> '05',
    'card.expiryYear' => '2034',
    'card.cvv'        => '123',
    'customer.givenName'     => 'Jane',
    'customer.surname'     => 'Jones',
    'customer.email'     => 'info@example.com',
    'customer.phone'     => '0123456789',
    'customer.browser.acceptHeader' => '3D Secure v2',
    'customer.browser.language' => 'english',
    'customer.browser.screenHeight' => '700',
    'customer.browser.screenWidth' => '1028',
    'customer.browser.userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36',
    'customer.browser.javaEnabled' => 'true',
]);

Perform debit payment:

$payment = serverToServer()->debitPayment([
    'amount'          => 92,
    'currency'        => 'GBP',
    'paymentBrand'    => 'VISA',
    'card.number'     => '4200000000000000',
    'card.holder'     => 'Jane Jones',
    'card.expiryMonth'=> '05',
    'card.expiryYear' => '2034',
    'card.cvv'        => '123',
    'customer.givenName'     => 'Jane',
    'customer.surname'     => 'Jones',
    'customer.email'     => 'info@example.com',
    'customer.phone'     => '0123456789',
    'customer.ip' => '59.103.124.217',
]);

Manage the payment:

$response = serverToServer()->status('PAYMENT_ID_FROM_AXCESSMS');

if ($response['status'])
{
	// Payment successfull
}
else
{
	// Payment failed
}

Manage bank receipt confirmations:

$params = [
    'amount'   => 92,
    'currency' => 'GBP',
];

$response = serverToServer()->receipt($params, 'PAYMENT_ID_FROM_AXCESSMS');

Capture the payment:

$params = [
    'amount'   => 92,
    'currency' => 'GBP',
];

$response = serverToServer()->capture($params, 'PAYMENT_ID_FROM_AXCESSMS');

Refund either the full captured amount or a part of the captured amount:

$params = [
    'amount'   => 90.50,
    'currency' => 'GBP',
];

$response = serverToServer()->refund($params, 'PAYMENT_ID_FROM_AXCESSMS');

Rebill the processed order for additional products:

$params = [
    'amount'   => 90.50,
    'currency' => 'GBP',
];

$response = serverToServer()->rebill($params, 'PAYMENT_ID_FROM_AXCESSMS');

Reflect the chargeback processed by the bank:

$params = [
    'amount'   => 90.50,
    'currency' => 'GBP',
];

$response = serverToServer()->chargeBack($params, 'PAYMENT_ID_FROM_AXCESSMS');

Reflect the chargeback reversal processed by the bank:

$params = [
    'amount'   => 90.50,
    'currency' => 'GBP',
];

$response = serverToServer()->chargeBackReversal($params, 'PAYMENT_ID_FROM_AXCESSMS');

3️⃣ Scheduling API

While schedulePaymentCheckout() creates a schedule via Copy & Pay, the Scheduling module is for managing schedules entirely from backend.

use Axcessms;

$schedule = Axcessms::scheduler()->schedule([
    'amount' => 65,
    'currency' => 'GBP',
    'registrationId' => '8ac7a***********************',
    'job.startDate' => date('Y-m-d', strtotime('+1 days')) . ' 00:01:00',
    'job.dayOfWeek' => '2,3,4,5,6',
    'job.hour' => 18,
    'job.minute' => 10,
    'job.endDate' => date('Y-m-d', strtotime('+10 days')) . ' 00:01:00',
]);

// Handle $schedule['id'] etc.

Cancel a Schedule:

use Axcessms;

$response = Axcessms::scheduler()->cancel('SCHEDULE_ID_FROM_AXCESSMS');

4️⃣ Webhooks

AxcessMS can send asynchronous notifications (e.g. payment result, chargebacks, schedule events) to your application.

This package provides a helper to decrypt and validate webhook payloads using AXCESSMS_ENCRYPTION_KEY.

The SDK automatically:

  • Validates headers
  • Decrypts payload (AES-256-GCM)
  • Parses JSON
  • Exposes clean payload data

Defining the Route:

In routes/web.php or routes/api.php:

use App\Http\Controllers\AxcessmsWebhookController;

Route::post('/axcessms/webhook', [AxcessmsWebhookController::class, 'handle'])
    ->name('axcessms.webhook');

Controller Example:

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Axcessms;

class AxcessmsWebhookController extends Controller
{
    public function handle(Request $request)
    {
        return Axcessms::webhook()->handle($request, function ($payload) {
            // $payload is already decrypted & verified
            \Log::info('AxcessMS Webhook', $payload);
        });
    }
}

syedaqeeqabbas/axcessms 适用场景与选型建议

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

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-06