定制 hovakimyannn/omnipay-epg 二次开发

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

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

hovakimyannn/omnipay-epg

最新稳定版本:v1.0.4

Composer 安装命令:

composer require hovakimyannn/omnipay-epg

包简介

SmartVista EPG (E-Commerce Payment Gateway) driver for Omnipay. Supports Arca, and any other EPG-based bank.

README 文档

README

SmartVista E-Commerce Payment Gateway (EPG) driver for the Omnipay PHP payment library.

Supports any bank running on SmartVista EPG. Comes with a pre-configured gateway for Arca / iPay (ipay.arca.am).

Latest Stable Version License

Installation

composer require hovakimyannn/omnipay-epg

Gateways

Class Description
Omnipay\Epg\Gateway Generic EPG — configure any bank's endpoint
Omnipay\Epg\ArcaGateway Arca / iPay — endpoints pre-configured

Usage

Arca / iPay

use Omnipay\Omnipay;

$gateway = Omnipay::create('Epg\Arca');
$gateway->setUsername('your_username');
$gateway->setPassword('your_password');
// $gateway->setTestMode(true); // use ipaytest.arca.am

Generic EPG (any bank)

use Omnipay\Epg\Gateway;

$gateway = new Gateway();
$gateway->setEndpoint('https://epg.yourbank.am/payment/rest');
$gateway->setTestEndpoint('https://epg-test.yourbank.am/payment/rest');
$gateway->setUsername('your_username');
$gateway->setPassword('your_password');

Supported Operations

Purchase (one-phase payment)

Registers the order and returns a redirect URL to the bank's hosted payment page.

$response = $gateway->purchase([
    'transactionId' => 'ORDER-001',       // your order number
    'amount'        => '10.00',
    'currency'      => 'AMD',
    'returnUrl'     => 'https://yoursite.com/payment/success',
    'failUrl'       => 'https://yoursite.com/payment/fail',  // optional
    'description'   => 'Order #001',                         // optional
    'language'      => 'en',                                 // optional
    'features'      => 'FORCE_TDS',                          // optional: FORCE_SSL | FORCE_TDS
])->send();

if ($response->isRedirect()) {
    // Store $response->getTransactionReference() (EPG orderId) for later status check
    $orderId = $response->getTransactionReference();

    $response->redirect(); // redirects customer to bank payment page
}

Complete Purchase (check payment status after redirect)

Called after the customer returns from the bank payment page.

$response = $gateway->completePurchase([
    'transactionId' => $orderId, // the EPG orderId saved during purchase
])->send();

if ($response->isSuccessful()) {
    // Payment confirmed — fulfill the order
} else {
    echo $response->getMessage();
}

Pre-Auth (two-phase payment)

Phase 1 — reserve funds:

$response = $gateway->registerPreAuth([
    'transactionId' => 'ORDER-002',
    'amount'        => '50.00',
    'currency'      => 'AMD',
    'returnUrl'     => 'https://yoursite.com/payment/success',
])->send();

$orderId = $response->getTransactionReference();

Phase 2 — confirm (deposit) reserved funds:

$response = $gateway->deposit([
    'transactionId' => $orderId,
    'amount'        => '50.00',
])->send();

Reverse (cancel / void)

$response = $gateway->reverse([
    'transactionId' => $orderId,
])->send();

Refund

$response = $gateway->refund([
    'transactionId' => $orderId,
    'amount'        => '10.00',
])->send();

Order Status

// Basic status
$response = $gateway->getOrderStatus([
    'transactionId' => $orderId,
])->send();

// Extended status (includes card info, binding info, etc.)
$response = $gateway->getOrderStatusExtended([
    'transactionId' => $orderId,
])->send();

echo $response->getOrderStatus();        // 0–6 (EPG status code)
echo $response->getTransactionReference();
print_r($response->getCardAuthInfo());

Verify Enrollment (3DS check)

$response = $gateway->verifyEnrollment([
    'pan' => '4111111111111111',
])->send();

Bindings (saved cards)

Pay with a saved card:

$response = $gateway->bindingPayment([
    'transactionReference' => $orderId,  // mdOrder
    'bindingId'            => $bindingId,
    'language'             => 'en',
])->send();

Get list of bindings for a customer:

$response = $gateway->getBindings([
    'clientId' => 'customer-123',
])->send();

Response Methods

Method Description
isSuccessful() true if payment is fully deposited
isRedirect() true if customer should be redirected to formUrl
getRedirectUrl() Hosted payment page URL
getTransactionReference() EPG orderId
getOrderNumberReference() Merchant orderNumber
getOrderStatus() EPG order status code
getMessage() Error message
getCode() Error code (0 = success)
getBindingId() Binding ID (if applicable)
getCardAuthInfo() Card info array (masked PAN, expiry, etc.)
getRequestId() Request-Id response header

Order status codes

Code Meaning
0 Registered, not paid
1 Pre-authorized (held)
2 Deposited (fully paid) ✅
3 Cancelled
4 Refunded
5 ACS authorization in progress
6 Authorization declined

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固