承接 bagoespantera/doku-laravel-library 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

bagoespantera/doku-laravel-library

最新稳定版本:1.0.1

Composer 安装命令:

composer require bagoespantera/doku-laravel-library

包简介

DOKU PHP Library for Laravel

README 文档

README

A Laravel wrapper for the DOKU Payment Gateway API. This library simplifies the integration of DOKU payment services into your Laravel application.

Requirements

  • PHP >= 7.4
  • Laravel >= 8.0
  • ext-curl
  • ext-json

Installation

You can install the package via composer:

composer require bagoespantera/doku-laravel-library

Configuration

You can use the library directly by instantiating the client or using the provided classes.

Usage

1. Initialize the Client

First, you need to initialize the DOKU\Client with your Client ID and Shared Key. You can obtain these from the DOKU Dashboard.

use DOKU\Client;

$client = new Client;

// Set your credentials
$client->setClientID('YOUR_CLIENT_ID');
$client->setSharedKey('YOUR_SHARED_KEY');

// Set environment (true for production, false for sandbox)
$client->isProduction(false);

2. Generate Payment Code (Virtual Account)

Here is an example of how to generate a Mandiri Virtual Account:

$params = [
    'customerEmail' => 'johndoe@example.com',
    'customerName' => 'John Doe',
    'amount' => 10000,
    'invoiceNumber' => 'INV-' . time(),
    'expiryTime' => 60, // in minutes
    'reusableStatus' => false, // false for one-time use
    'info1' => 'Payment Info 1',
    'info2' => 'Payment Info 2',
    'info3' => 'Payment Info 3',
];

try {
    $response = $client->generateMandiriVa($params);

    // Process the response
    if (isset($response['virtual_account_info'])) {
        $vaNumber = $response['virtual_account_info']['virtual_account_number'];
        return response()->json([
            'status' => 'success',
            'va_number' => $vaNumber,
            'data' => $response
        ]);
    } else {
        return response()->json([
            'status' => 'error',
            'message' => 'Failed to generate VA'
        ], 400);
    }
} catch (\Exception $e) {
    return response()->json([
        'status' => 'error',
        'message' => $e->getMessage()
    ], 500);
}

Available Services

The library supports various payment methods including:

  • Virtual Accounts:

    • generateMandiriVa($params)
    • generateBcaVa($params)
    • generateBriVa($params)
    • generateBsiVa($params)
    • generateDokuVa($params)
  • E-Wallets:

    • generateOvo($params)
    • generateShopeePay($params)
    • generateDokuWallet($params)
  • Credit Card:

    • generateCreditCard($params)

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固