定制 adnane-ka/omnipay-tap 二次开发

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

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

adnane-ka/omnipay-tap

最新稳定版本:1.2

Composer 安装命令:

composer require adnane-ka/omnipay-tap

包简介

Tap payments gateway for Omnipay payment processing library

README 文档

README

Tap payments gateway for Omnipay payment processing library

Build Status Latest Stable Version Total Downloads

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

Installation

composer require adnane-ka/omnipay-tap

Basic Usage

The following gateways are provided by this package:

  • Tap

This package ineteracts with Tap's Charges API.

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

Example usage

Configuration

use Omnipay\Omnipay;

$gateway = Omnipay::create('Tap');

/**
 * You can use the testing API key provided by Tap.
 * No worries on switching test & live mode since Tap provides 
 * Keys for both, and can distinguish between them
 * 
 * @see https://developers.tap.company/reference/api-endpoint
 * @see https://developers.tap.company/reference/testing-keys
*/
$gateway->setApiToken('sk_test_XKokBfNWv6FIYuTMg5sLPjhJ'); 

Creating a charge

$response = $gateway->purchase([
    'amount' => 1, // Required
    'currency' => 'KWD',  // Optional, Default is USD
    'customerName' => 'Test', // Optional, Default is Test
    'customerEmail' => 'test@test.com', // Optional, Default is Test
    'sourceId' => 'src_all',  //  Optional, Default is src_all @see https://developers.tap.company/reference/charges#the-payment-source-object
    'threeDSecure' => false, // Optional, Default is true
    'returnUrl' => 'http://your_website.com/redirect_url' // Required
])
->send();

if ($response->isRedirect()) {
    // Data is valid and you're ready to be redirected offsite
    $response->redirect(); 
} else {
    // An error occured
    // @see https://developers.tap.company/reference/charge-response-codes
    echo $response->getMessage();
}

Retrieving a charge

$response = $gateway->completePurchase([
    // tap_id is usually injected as a URL param when returned from gateway
    'tap_id' => 'TYPE_IN_THE_TARGET_CHARGE_ID'
])->send();

if($response->isSuccessful()){
    // Payment was successful and charge was captured
    // $response->getData()
    // $response->getTransactionReference() // payment reference
}else{
    // Charge was not captured and payment failed
    // $response->getData()
}

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-08-12