承接 giftd/giftd-php-client 相关项目开发

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

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

giftd/giftd-php-client

Composer 安装命令:

composer require giftd/giftd-php-client

包简介

GIFTD API PHP client. Allows to check promo codes

关键字:

README 文档

README

This repository contains a PHP Client for the API of Giftd.tech project.

Check out the full API documentation.

Requirements

  • PHP version >= 5.3.3

  • php-cURL extension

Take a look at example.php to find usage examples.

Installation

composer require giftd/giftd-php-client

Basic usage example

<?php
$basketTotal = 900;
$promoCode = '1234-5678-9876-4321';

$giftdUserId = 1234;
$giftdApiKey = '7815696ecbf1c96e6894b779456d330e';

$apiClient = new Giftd\ApiClient($giftdUserId, $giftdApiKey);
$card = $apiClient->checkByToken($promoCode, $basketTotal);
if ($card) {
  if ($card->is_available) {
    echo "Available amount: {$card->amount_available}; minimum amount total: {$card->min_amount_total}";
    // You may redeem this promocode after user finishes the order (i.e. charge the card):
    // $apiClient->charge($promoCode, $card->amount_available)
  } else {
    echo "No amount available on the gift card";
  }
} else {
  echo "Wrong token passed, gift card not found!";
}
?>

Support

Please send your questions and suggestions to support@giftd.tech.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固