piggy/piggy-php-sdk 问题修复 & 功能扩展

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

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

piggy/piggy-php-sdk

最新稳定版本:3.12.2

Composer 安装命令:

composer require piggy/piggy-php-sdk

包简介

php sdk piggy

README 文档

README

With Piggy's all-in-one platform you can strengthen loyalty and automate every step. From reward programs, to branded giftcards and smart email marketing - Piggy takes care of it all.

You can use this package to connect your application / POS-system (Register) to a Piggy account. Please make sure to choose the right API Client for your needs.

Full documentation about our API can be found here https://docs.piggy.eu/

Versions

You should use v3 of this SDK. However this is not backward compatible with v1.* of this SDK.

Requirements

This SDK requires PHP 7.2 or higher. Currently our test suite runs against PHP 7.2, 7.3, 7.4, 8.0, 8.1

Setup

Composer:

composer require piggy/piggy-php-sdk

Quickstart

Example with Register Client

$apiKey = 'xxxx-xxxx-xxxx';  
$client = new Piggy\Api\RegisterClient($apiKey);

try {
    $contact = $client->contacts->findOneBy('test@domain.com'); // Example call to find a Contact by e-mail address
} catch(Piggy\Api\Exceptions\MaintenanceModeException $e) {
    // Catch maintenance mode specific.
} catch(Piggy\Api\Exceptions\PiggyRequestException $e) {
    // If no Contact is found, you'd know that from this exception
} catch(\Exception $e) {
    // Handle any other exceptions 
}

Example with Static Functions using API Key

$apiKey = 'xxxxxxxx';
$baseUrl = "https://api.piggy.eu";

ApiClient::configure($apiKey, $baseUrl);

try {
    // Example call to update a Contact by UUID
    Contact::update("1234ab-7890-asdf-1234-a1b2c3d4", ["attributes" => ["firstname" => "henk", "housenumber" => 10]]);
} catch(Piggy\Api\Exceptions\MaintenanceModeException $e) {
    // Catch maintenance mode specific.
} catch(GuzzleHttp\Exception\GuzzleException $e) {
    // If no Contact is found, you'd know that from this exception
} catch(\Exception $e) {
    // Handle any other exceptions 
}

统计信息

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

GitHub 信息

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

其他信息

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