定制 mdrazamani/asanpardakht-ipg-rest 二次开发

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

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

mdrazamani/asanpardakht-ipg-rest

最新稳定版本:1.0.26

Composer 安装命令:

composer require mdrazamani/asanpardakht-ipg-rest

包简介

AsanPardakht IPG REST API integration package

README 文档

README

This Laravel package provides a seamless integration with AsanPardakht's IPG REST API, allowing you to handle online payments, transaction verifications, and settlements effortlessly.

Features

  • Token Generation: Easily generate payment tokens.
  • Transaction Verification: Verify the status of transactions.
  • Settlement Processing: Manage post-transaction settlements.
  • Seamless Redirection: Redirect users to the AsanPardakht payment gateway with ease.

Installation

To get started with this package, follow these simple steps:

1. Install via Composer

Run the following command in your Laravel project:

composer require mdrazamani/asanpardakht-ipg-rest

2. Publish Configuration

Publish the package configuration file using the following Artisan command:

php artisan vendor:publish --provider="mdrazamani\AsanPardakhtIpgRest\AsanPardakhtIpgRestServiceProvider"

3. Update Environment Variables

Add the following variables to your .env file to configure the package:

ASANPARDAKHT_USERNAME=your_username
ASANPARDAKHT_PASSWORD=your_password
ASANPARDAKHT_MERCHANT_CONFIG_ID=your_merchant_config_id
ASANPARDAKHT_CALLBACK_URL=your_callback_url

Usage

1. Generate Token and Redirect

Initiate a payment by generating a token and redirecting the user to AsanPardakht's payment gateway:

$gateway = app('asanpardakht')->init($invoiceId, $amount);
$response = $gateway->token();
$gateway->redirect($response['token']);

2. Verify Transaction

After the user returns to your site, verify the transaction:

$verifyResponse = app('asanpardakht')->verify($transactionId);

3. Process Settlement

Once the transaction is verified, you can process the settlement:

$settlementResponse = app('asanpardakht')->settlement($transactionId);

Methods Overview

  • init($invoiceId, $amount): Initializes the payment with the given invoice ID and amount.
  • token(): Generates a payment token.
  • verify($transactionId): Verifies the transaction.
  • settlement($transactionId): Processes the settlement for the given transaction.
  • redirect($token, $mobile = null): Redirects the user to the payment gateway.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-08-21