定制 veem/sdk 二次开发

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

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

veem/sdk

Composer 安装命令:

composer require veem/sdk

包简介

Veem PHP SDK

README 文档

README

The Veem PHP SDK provides an interface to make it easier to call Veem Global Payments APIs.

Version information

  • Latest SDK Version: 1.0.0
  • Latest supported API Endpoint Version: v1.1

Documentation

System Requirements

  1. The SDK works on PHP 7 and beyond.
  2. A developer account
  3. An application with a customer account and the associated client id and secret (Authorization flow / Client Credentials flow)

First Use Instructions

  1. composer install with command: composer require veem/sdk
  2. Start to Use Veem SDK classes in your PHP project

Testing the Code

To test the code locally, follow the steps below:

  1. cd to the project directory
  2. Client can either integrate with Authorization flow or Client Credential Flow;
  3. For Authorization flow, create a VeemContext object, fill in the clientId, clientSecret, authorizationCode, and redirectUrl(optional).
  4. For Client Credentials flow, create a VeemContext object, fill in the clientId, and clientSecret.
  5. To exercise all Veem Global Payment APIs, pass the VeemContext object as constructor argument to VeemClient and calling access token methods for scenario of step 3 or step 4.

Getting the OAuth Tokens

In order to get the access tokens from the Developer Portal;

Sign In with Veem - Sign into developer Portal .

Create an Application- Create a new application by providing the Name, OAuth2 Redirection URLs and Payment Status Webhooks.

Create a Customer- Create a new customer by providing Business Name, Country and Primary Email

Get Credentials- Go the Application and select the Customer and copy the Access Token.

In order to get the access token programmatically, get the client id, client secrets (Optional redirect url for Authorization flow).

use Veem\VeemContext;
use Veem\clients\VeemClient;

$context = new VeemContext("Test-46ecbf0b", "34b20dcf-6e6c-4bd4-83c3-159d5b7c3c27");
$veem = new VeemClient($context, $loginFromClientCredentials = true);

// or

$veem = new VeemClient($context);
$veem->getTokenFromClientCredentials();

Invoice Client Example

The following example is to send invoice using Invoice Client


use Veem\VeemContext;
use Veem\clients\VeemClient;

// define a VeemClient Context Manager and auto login.
$context = new VeemContext("Test-46ecbf0b", "34b20dcf-6e6c-4bd4-83c3-159d5b7c3c27");
$veem = new VeemClient($context, $loginFromClientCredentials = true);

// define an InvoiceRequest

$account = new Account();
$account->setType('Business')
        ->setEmail('devsupport+gbp@veem.com')
        ->setFirstName('Wei')
        ->setLastName('Chen')
        ->setBusinessName('GBP Veem Wei')
        ->setCountryCode('GB')
        ->setPhoneCountryCode('44')
        ->setPhone('03700100222');
$amount = new Amount($number = 50, $currency = 'GBP');
$invoiceRequest = new Invoice();
$invoiceRequest->setAmount($amount)->setPayer($account);

// create an invoice
$invoice = $veem->getInvoiceClient()->create($invoiceRequest);

More Examples can be found under examples folder

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 4
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-09-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固