behzadbabaei/omnipay-coinbase-commerce 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

behzadbabaei/omnipay-coinbase-commerce

最新稳定版本:v2.1.3

Composer 安装命令:

composer require behzadbabaei/omnipay-coinbase-commerce

包简介

Coinbase Commerce driver for the Omnipay payment processing library

README 文档

README

Coinbase Commerce gateway for Omnipay payment processing library This package has implemented the Commerce API of Coinbase Payment systems For more information please visit the following link:Developer Document

Installation

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

{
    "require": {
        "behzadbabaei/omnipay-coinbase-commerce": "dev-master"
    }
}

And run composer to update your dependencies:

composer update

Or you can simply run

composer require behzadbabaei/omnipay-coinbase-commerce

Basic Usage

  1. Use Omnipay gateway class:
    use Omnipay\Omnipay;
  1. Initialize CoinbaseCommerce gateway:
        $gateway = Omnipay::create('CoinbaseCommerce');

        $gateway->setAccessToken('your-api-key');
        $gateway->setApiVersion('your-api-version');
        $gateway->setLanguage(App::getLocale());

Creating an charge order

Call purchase, it will return the response which includes the public_id for further process. Please refer to the Developer Document for more information.

            $redirectUrl = 'success-url'
            $cancelUrl = 'cancel-url'

            $metaData = [
                'orderId' => $data['orderId']
            ];

            return $this->gateway->purchase([
                'name'        => $data['name'],
                'description' => $data['description'],
                'amount'      => $data['amount'],
                'currency'    => $data['currency'],
                'customData'  => $metaData,
                'redirectUrl' => $redirectUrl,
                'cancelUrl'   => $cancelUrl,
            ])->send()->getData();

Cancel an order

Please refer to the Developer Document for more information.

       return $this->gateway->cancel([
              'orderId' => $orderId
            ])->send()->getData();
        } catch (Throwable $exception) {
            return null;
        }

Retrieve an order

Please refer to the Developer Document for more information.

        return $this->gateway->fetchTransaction([
            'orderId' => $orderId
        ])->send()->getData();

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. Be sure to add the omnipay tag so it can be easily found.

If you want to keep up to date with release announcement, 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.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-07