定制 websystem/gp-webpay-sdk 二次开发

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

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

websystem/gp-webpay-sdk

最新稳定版本:0.1.3

Composer 安装命令:

composer require websystem/gp-webpay-sdk

包简介

This is my package gp-webpay-sdk

README 文档

README

This package provides a simple way to integrate GPWebpay payment gateway into Laravel applications.

Requirements for the package

  • PHP 8.2 or higher
  • Laravel 10 or higher

Installation

Install the package via composer

    composer require websystem/gp-webpay-sdk

Publish the configuration file

    php artisan vendor:publish --tag=webpay-config

Define environment variables

Save the following environment variables to the .env file in the root directory of the project. Locate your keys and certificates in the storage directory.

GPWEBPAY_PRIVATE_KEY_PATH= # Storage path to the private key
GPWEBPAY_PRIVATE_KEY_PASSWORD= # Password for the private key
GPWEBPAY_PUBLIC_KEY_PATH= # Storage path to the public key
GPWEBPAY_MERCHANT_NUMBER= # Merchant number
GPWEBPAY_URL=https://test.3dsecure.gpwebpay.com/pgw/order.do
GPWEBPAY_ADD_INFO_SCHEMA= # Storage path to the additional info schema

Available methods

Create payment

use Websystem\Gpwebpay\Enums\Currency;
use Websystem\Gpwebpay\Facades\Gpwebpay;

$paymentData = [
    'orderNumber' => 1001, # Unique order number
    'amount' => 150.50, # Float value
    'currency' => Currency::EUR,
    'depositFlag' => 1, 
    'returnUrl' => 'https://example.com/callback',
    'addInfo' => [
        'name' => 'John Doe',
        'email' => 'doe@invelity.com',
    ],
    'addInfoSchemaPath' => config('gpwebpay.add_info_schema'),
];

    $requestUrl = Gpwebpay::createPaymentRequestUrl($paymentData);

    return redirect($requestUrl);

Credits

This library originates from adamstipak/webpay-php. I have adapted it into a package for Laravel and made slight code modifications.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-01