aiarmada/chip 问题修复 & 功能扩展

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

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

aiarmada/chip

最新稳定版本:v1.0.0

Composer 安装命令:

composer require aiarmada/chip

包简介

Modern Laravel integration for CHIP payment gateway - Collect & Send APIs

README 文档

README

Laravel 12 integration for CHIP payment platform – CHIP Collect (payments) and CHIP Send (disbursements).

Features

  • Fully independent – works standalone without requiring other commerce packages
  • Seamless integration – auto-integrates with Cart when installed together
  • Universal Gateway – implements PaymentGatewayInterface for provider switching
  • Complete API coverage – purchases, refunds, subscriptions, payouts, webhooks
  • Laravel DX – facades, fluent builders, typed data objects, events
  • Production ready – PHP 8.4, PHPStan level 6, Pest test suite
  • Secure – webhook signature verification, sensitive data masking

Installation

composer require aiarmada/chip

Publish config and migrations:

php artisan vendor:publish --tag="chip-config"
php artisan vendor:publish --tag="chip-migrations"
php artisan migrate

Configuration

# CHIP Collect
CHIP_COLLECT_API_KEY=your-api-key
CHIP_COLLECT_BRAND_ID=your-brand-id

# CHIP Send
CHIP_SEND_API_KEY=your-send-api-key
CHIP_SEND_API_SECRET=your-send-api-secret

# Environment
CHIP_ENVIRONMENT=sandbox

# Webhooks
CHIP_COMPANY_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----..."
CHIP_WEBHOOK_VERIFY_SIGNATURE=true

Quick Start

Payment Gateway (Recommended)

Works with any CheckoutableInterface – Cart, Order, or custom implementations:

use AIArmada\Chip\Gateways\ChipGateway;

$gateway = app(ChipGateway::class);
$payment = $gateway->createPayment($checkoutable, $customer, [
    'success_url' => route('checkout.success'),
    'failure_url' => route('checkout.failed'),
]);

return redirect($payment->getCheckoutUrl());

When aiarmada/cart is installed, Cart automatically implements CheckoutableInterface:

$cart = app(\AIArmada\Cart\Cart::class);
$payment = $gateway->createPayment($cart, $customer, $options);

CHIP Collect

use AIArmada\Chip\Facades\Chip;

// Create purchase
$purchase = Chip::createPurchase([
    'client' => ['email' => 'customer@example.com'],
    'purchase' => [
        'currency' => 'MYR',
        'products' => [['name' => 'Product', 'price' => 9900]],
    ],
]);

// Fluent builder
$purchase = Chip::purchase()
    ->customer('customer@example.com', 'John Doe')
    ->addProductCents('Product', 9900)
    ->successUrl(route('success'))
    ->create();

CHIP Send

use AIArmada\Chip\Facades\ChipSend;

$instruction = ChipSend::createSendInstruction(
    amountInCents: 10000,
    currency: 'MYR',
    recipientBankAccountId: 'bank_123',
    description: 'Payout',
    reference: 'PAY-001',
    email: 'recipient@example.com',
);

Webhooks

Route::post('/chip/webhook', function (Request $request) {
    $handler = app(ChipGateway::class)->getWebhookHandler();
    $payload = $handler->verify($request);
    
    if ($payload->event === 'purchase.paid') {
        // Handle payment
    }
    
    return response('OK');
});

Health Check

php artisan chip:health

Documentation

License

MIT License. See LICENSE for details.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固