定制 xfoxawy/2checkout 二次开发

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

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

xfoxawy/2checkout

Composer 安装命令:

composer require xfoxawy/2checkout

包简介

2Checkout API Service Provider

README 文档

README

Providing Simple Integration and expressive interface for 2Checkout Payment Gateway

Requirements

  • php >= 5.6
  • Laravel >= 5

Installation

  • Use following command to install:
composer require "xfoxawy/2checkout:dev-master"
  • Add the service provider to your $providers array in config/app.php file like:
TwoCheckout\TwoCheckoutServiceProvider // Laravel 5
TwoCheckout\TwoCheckoutServiceProvider::class // Laravel 5.1 or greater
  • Add the alias to your $aliases array in config/app.php file like:
'TwoCheckout' => TwoCheckout\Facades\TwoCheckout // Laravel 5
'TwoCheckout' => TwoCheckout\Facades\TwoCheckout::class // Laravel 5.1 or greater
  • Run the following command to publish configuration:
php artisan vendor:publish

Usage

Configuration

  • after creating 2checkout account and creating API credentials fill in API creds in config/2checkout.php

Class DI Example

class ExampleController
{
    public function __construct(\TwoCheckout\TwoCheckout $tco)
    {
        $this->tco = $tco;
    }

    public function product()
    {
        $this->tco->Product()->get($product_id);
    }
}

Using Facade

class ExampleController
{

    public function product()
    {
        TwoCheckout::Sale()->list();
    }
}

TwoCheckout API

TwoCheckout Provides expressive OOP access interface, each EndPoint / Event is Represented by Class with regular CRUD interface (get/create/update/delete) representing 2Checkout Restful API.

TwoCheckout Admin API is represented By Resources classes, and TwoCheckout Webhooks Events are represented by Events classes, for more information please review 2Checkout Documentation.
the following Walkthrough will guide you to each class normal usage.

Resources

Account

Payment

Prouduct

Coupon

Option

Sale

Events

to receive 2Checkout Webhook Event, in your route method.
listenTo method verifies and returns Event as Array.
for more info about the return data for each event please review the Documentation.

public function receive($event_data)
{
    $event = TwoCheckout::listenTo($event_data);
}

Supported Events

  • FraudStatusChanged
  • InvoiceStatusChanged
  • OrderCreated
  • RecurringComplete
  • RecurringInstallmentFailed
  • RecurringInstallmentSuccess
  • RecurringRestarted
  • RecurringStopped
  • RefundIssued
  • ShipStatusChanged

统计信息

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

GitHub 信息

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

其他信息

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