tilloops / tillo
Tillo API客户端 V2
dev-master
2022-06-22 16:55 UTC
Requires
- php: >=7.1
- ext-json: *
- guzzlehttp/guzzle: ^6.2
This package is not auto-updated.
Last update: 2024-09-20 10:44:28 UTC
README
The Tillo API Client Library enables you to work with Tillo API v2.
要求
API 文档
安装
首选方法是使用 composer。如果您尚未安装 composer,请按照 安装说明 进行操作。
安装 composer 后,请在项目根目录中执行以下命令以安装此库
composer require tilloops/tillo:dev-master
最后,请确保包含自动加载器
require_once '/path/to/your-project/vendor/autoload.php';
示例
请参阅 examples/
目录以获取关键客户端功能的示例。
基本示例
控制台命令 / 终端
php examples/console/IssueCode.php --apiKey=xxxxxxx --apiSecret=xxxxxxx --apiBase=xxxxxxx --brand=xxxxxxx --amount=xx.xx
响应
Success to issue the code Request signature: 1a287fa9b034f428b4e892a6801803b613bc0f4e9468ced55a3f603e1ee37c10 Card created successfully Brand : amazon Amount : 42.00 GBP Code : FAA3-9YDQ8E-SMBF Expiration : 04/04/2029 22:59
文件 / 浏览器
// include your composer dependencies require_once 'vendor/autoload.php'; $apiKey = "YOUR_API_KEY"; $apiSecret = "YOUR_API_SECRET"; $apiBase = "YOUR_API_BASE_URL"; $client = new RewardCloud($apiKey, $apiSecret, $apiBase); $digitalCodeParams = [ 'client_request_id'=> '[[CLIENT_REQUEST_ID]]', 'brand'=> '[[brand_slug]]', 'face_value'=> [ 'amount'=> 6.00, 'currency'=> 'GBP' ], 'delivery_method'=> 'code', 'fulfilment_by'=> 'partner', 'fulfilment_parameters'=> [ 'to_name'=> 'Receiver', 'to_email'=> 'john@reward.cloud', 'from_name'=> 'Reward Cloud', 'from_email'=> 'noreply@reward.cloud', 'subject'=> 'Here is your gift card!' ], 'personalisation'=> [ 'to_name'=> 'Recipient', 'from_name'=> 'Sender', 'message'=> 'Here is your gift', 'template'=> 'standard' ], 'sector'=> 'cash-out' ]; $digitalCode = $client->digitalCode->issue($digitalCodeParams);
响应
$digitalCode [ 'status'=> 'success', 'code'=> '000', 'message'=> 'Human-readable message', 'data'=> [ 'url'=> 'http://revealyourgift.com/blah/blah', 'expiry'=> '2018-05-01', 'serial_number'=> 'Optional serial number', 'security_code'=> 'Optional security code', 'barcode'=> [ 'type'=> 'CODE128', 'string'=> 'ABS1234567', 'url'=> 'https://revealyourgift.com/barcode?code=ABS1234567' ], 'float_balance'=> [ 'currency'=> 'GBP', 'amount'=> 20763.3 ], 'face_value'=> [ 'amount'=> 129.5, 'currency'=> 'GBP' ], 'reference'=> 'Reward Cloud unique reference' ] ] */
可用方法
数字礼品卡
查看 Tillo API 文档 以获取更多关于参数的信息
实物礼品卡
查看 Tillo API 文档 以获取更多关于参数的信息
品牌信息
这些调用提供给您,以便您的系统可以检索您在账户上设置的品牌信息。
它们可以集成到您的系统中,以减少您定期访问我们的中心的需要,并在您的平台上自动更新品牌信息。
查看 Tillo API 文档 以获取更多关于参数的信息。
品牌模板
查看 Tillo API 文档 以获取更多关于参数的信息。