定制 karen6630/omnipay-ameria 二次开发

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

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

karen6630/omnipay-ameria

最新稳定版本:v1.0.0

Composer 安装命令:

composer require karen6630/omnipay-ameria

包简介

Ameria gateway for Omnipay payment processing library

README 文档

README

License: MIT GitHub issues GitHub stars

Ameria driver for the Omnipay Laravel payment processing library
Added the ability to cancel payment (CancelRequest) and refund payment (RefundRequest)

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.5+. This package implements Ameria support for Omnipay.

Installation

Omnipay is installed via Composer. To install, simply add it to your composer.json file:

{
    "require": {
        "karen6630/omnipay-ameria": "dev-master"
    }
}

And run composer to update your dependencies:

composer update

Or you can simply run:

composer require karen6630/omnipay-ameria

Basic Usage

  1. Use Omnipay gateway class:
use Omnipay\Omnipay;
  1. Initialize Ameria gateway:
$gateway = Omnipay::create('Ameria');
$gateway->setClientId(env('AMERIA_CLIENT_ID'));
$gateway->setUsername(env('AMERIA_USERNAME'));
$gateway->setPassword(env('AMERIA_PASSWORD'));
$gateway->setReturnUrl(env('AMERIA_RETURN_URL')); // Return URL (webhook)
$gateway->setLanguage(\App::getLocale());
$gateway->setAmount(10); // Amount to charge
$gateway->setTransactionId(XXXX); // Transaction ID from your system
  1. Call purchase — it will automatically redirect to Ameria's hosted page:
$purchase = $gateway->purchase()->send();
$purchase->redirect();
  1. Handle the callback request at your AMERIA_RESULT_URL:
$gateway = Omnipay::create('Ameria');
$gateway->setUsername(env('AMERIA_USERNAME'));
$gateway->setPassword(env('AMERIA_PASSWORD'));

$purchase = $gateway->getOrderStatus()->send();

if ($purchase->isSuccessful()) {
    // Your logic here
}

return new Response('OK');
  1. Added the ability to cancel payment (CancelRequest):
public function cancel(array $parameters = []): \Omnipay\Common\Message\AbstractRequest
{
    return $this->createRequest('\Omnipay\Ameria\Message\CancelRequest', $parameters);
}
  1. Added the ability to refund payment (RefundRequest):
public function refund(array $parameters = []): \Omnipay\Common\Message\AbstractRequest
{
    return $this->createRequest('\Omnipay\Ameria\Message\RefundRequest', $parameters);
}

For general usage instructions, please see the main Omnipay repository.

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow — use the omnipay tag.

If you want to stay updated with release announcements or discuss ideas for the project,
you can join the mailing list.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-23