定制 kimoslim/omnipay-merchant-warrior 二次开发

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

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

kimoslim/omnipay-merchant-warrior

最新稳定版本:0.1.2

Composer 安装命令:

composer require kimoslim/omnipay-merchant-warrior

包简介

Omnipay package for the Merchant Warrior payment gateway based on https://github.com/soda-framework/omnipay-merchant-warrior

README 文档

README

Merchant Warrior API implemention

Omnipay is a framework agnostic, multi-gateway payment processing library. This package implements components of the Merchant Warrior Direct API.

Installation

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

{
    "require": {
        "composer require kimoslim/omnipay-merchant-warrior": "dev-master"
    }
}

Basic Usage

The following gateways are provided by this package:

  • Merchant warrior Direct API (Following methods are done, although currently untested)
    • processAuth
    • processCapture
    • processCard

Purchase Example

$gateway = Omnipay::create('MerchantWarrior');
$gateway->setMerchantUUID('merchant UUID');
$gateway->setApiKey('API KEY');
$gateway->setApiPassphrase('API PASS');

$card = new CreditCard(array(
    'firstName'          => 'Joe',
    'lastName'           => 'Bloggs',
    'number'             => '4444333322221111',
    'expiryMonth'        => '01',
    'expiryYear'         => '2019',
    'billingAddress1'    => 'street',
    'billingCountry'     => 'AU',
    'billingCity'        => 'SUBURB',
    'billingPostcode'    => 'POSTCODE',
    'billingState'       => 'STATE',
    'email'              => 'me@emailaddress.com',
));
$purchase = [
    'amount'            => '1.00',
    'currency'          => 'AUD',
    'transactionType'   => 'Purchase',
    'transactionId'     => 'TRANSACTION ID',
    'transactionProduct'=> 'Test Transaction Description',
    'card'              => $card
];
$request = $gateway->purchase($purchase);
$response = $request->send();
if ($response->isSuccessful()) {
    // insert the transaction
    $txn_id = $response->getTransactionReference();
    $auth_code = $response->getAuthCode();
    $message = $response->getMessage();
    echo 'Payment successful: TXN ID - '.$txn_id.' auth code: '.$auth_code.' message:'.$message.PHP_EOL;
}
else
{
    echo 'Credit Card Failed: '.$response->getMessage().PHP_EOL;
}

Authorize Example

$authorize = [
    'amount'            => '1.00',
    'currency'          => 'AUD',
    'transactionType'   => 'Authorize',
    'transactionId'     => 'TRANSACTION ID',
    'transactionProduct'=> 'Test Authorisation Description',
    'card'              => $card
];
$request = $gateway->authorize($authorize);
$response = $request->send();
if ($response->isSuccessful()) {
    // insert the transaction
    $txn_id = $response->getTransactionReference();
    $auth_code = $response->getAuthCode();
    $message = $response->getMessage();
    echo 'Payment successful: TXN ID - '.$txn_id.' auth code: '.$auth_code.' message:'.$message.PHP_EOL;
}
else
{
    echo 'Credit Card Failed: '.$response->getMessage().PHP_EOL;
}

More details of Merchant Warrior's API can be found at Merchant Warrior

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2018-05-28