定制 yopify/yo-dev-php-sdk 二次开发

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

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

yopify/yo-dev-php-sdk

Composer 安装命令:

composer require yopify/yo-dev-php-sdk

包简介

Yo PHP SDK is the official SDK wrapper for the Yopify Yo API service

README 文档

README

Yo PHP SDK is the official SDK wrapper for the Yo API service

Requirements

  • PHP Version 5.3.0+

Installation

Install the latest version with

$ composer require yopify/yo-dev-php-sdk

Manual User Installation

Download src/Yo/Client.php and include the file in your PHP project.

Check out our examples in example/example.php, quick usage examples:

Basic Usage

Initialize Yo client via:

<?php
use Yopify\Yo\Client;
$client = new Client();

$yoClient->authToken = 'YOUR-TOKEN-HERE'; // auth token can be found here: https://local.yopify.com/settings#/api

// OR

$yoClient->setBasicAuth('me@mysite.com', 'secret'); // You can use basic auth also

#####To check authentication:

$isAuthenticated = $yoClient->ping(); // false if not authenticated, current timestamp if success

#####Get a single Event

$event = $yoClient->getEvent(EVENT_ID);

#####Get list of events

$events = $client->getEvents(10, 1);

// Check for success
if (isset($events->meta)) {
    echo 'Current page: ', $events->meta->pagination->current_page, "\n";
    echo 'Total pages: ', $events->meta->pagination->total_pages, "\n";
    echo 'Page page: ', $events->meta->pagination->per_page, "\n";
    echo 'Total count: ', $events->meta->pagination->total, "\n";
}

#####Create new event

$event = new Yopify\Yo\YoEvent();
$event->event_type_id = '1';
$event->unique_id1 = '10';
$event->unique_id2 = '1';
$event->title = 'This awesome product';
$event->first_name = 'Jon';
$event->last_name = 'snow';
$event->city = 'New York';
$event->province = 'XXXX';
$event->country = 'USA';
$event->url = 'https://example.com';
$event->message_template = '[FIRST-NAME] from [COUNTRY] just purchased [TITLE-WITH-LINK]';
$YoEvent = $yoClient->createEvent($event);

#####Update an event

$YoEvent = $yoClient->getEvent(EVENT_ID);

if (isset($YoEvent->data)) {
    $YoEvent = $YoEvent->data;
    $YoEvent->province = "AAAA";

    $updatedEvent = $yoClient->updateEvent($YoEvent);
}

#####Delete an event:

$deletedEvent = $yoClient->deleteEvent(20);

Support

If you have questions, email us at yo@yopify.com.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2016-10-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固