承接 net-tools/zettle-api 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

net-tools/zettle-api

最新稳定版本:1.0.2

Composer 安装命令:

composer require net-tools/zettle-api

包简介

Zettle by PayPal API PHP Client

README 文档

README

The Zettle by PayPal API provides a simple integration of the Zettle by PayPal API for your PHP project.

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version License

Installation

With composer, add:

$ composer require laulamanapps/izettle-api

Run Tests

To make sure everyting works you can run tests:

$ composer test

Usage

Get yourself an access token. you'll need an clientId and clientSecret for this (to get one apply here) for performance benefits, it might be wise to store the access token in a cache like Redis.

use GuzzleHttp\Client;
use LauLamanApps\IzettleApi\GuzzleIzettleClient;
use LauLamanApps\IzettleApi\IzettleClientFactory;

$izettleClient = new GuzzleIzettleClient(new Client(), 'clientId', 'clientSecret');
$accessToken = $izettleClient->getAccessTokenFromUserLogin('john.doe@example.com', 'password');

//-- store $accessToken in cache

$productClient = IzettleClientFactory::getProductClient($iZettleClient);
$library = $productClient->getLibrary();

Make call with existing AccessToken

use GuzzleHttp\Client;
use LauLamanApps\IzettleApi\GuzzleIzettleClient;
use LauLamanApps\IzettleApi\IzettleClientFactory;

$accessToken = ...; //-- Get from cache

$izettleClient = new GuzzleIzettleClient(new Client(), 'clientId', 'clientSecret');
$izettleClient->setAccessToken($accessToken);

$purchaseClient = IzettleClientFactory::getPurchaseClient($iZettleClient);
$library = $purchaseClient->getPurchaseHistory();

Upgrading

From v0.9 to v1.0

Version 1.0 requires PHP 8.1 and uses first-class Enums. This is a breaking change.

If you're using the enums, make sure you replace calls to get with an instance reference:

-if ($payout->getPeriodicity() === Periodicity::get(Periodicity::DAILY)) {
+if ($payout->getPeriodicity() === Periodicity::DAILY) {

Credits

iZettle Api has been developed by LauLaman.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固