承接 venditan/rapport-client 相关项目开发

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

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

venditan/rapport-client

Composer 安装命令:

composer require venditan/rapport-client

包简介

Rapport

README 文档

README

http://www.venditan.com/rapport

Table of Contents

Install with Composer

composer require venditan/rapport-client dev-master

Examples

In all the examples below, we will assume you have created a client object with the right credentials, like this:

// Create the client with your supplied client id and api key
$obj_client = new \Venditan\Rapport\Client('company', 'api-key');

Order Dispatch

// Add and configure the target recipient/user
$obj_client->addUser()->id('1955')->name('Marty')->email('marty@mcfly.com')->mobile('07019551985');

// Set-up the transaction
$obj_client->addTransaction()->id('2015')->courier('Western Union')->tracking('ELB1885');

// Set the type of event and publish
$obj_client->event('order_dispatched')->send();

Order Details

It is possible to provide order details (lines, delivery address, notes) as well.

This would normally only be provided once, using the order_detail event.

// Set-up the transaction
$obj_txn = $obj_client->addTransaction()->id('2015');

// Address
$obj_txn->deliverTo('123 Street, Town, County, POST CODE');

// Notes
$obj_txn->notes('Will be delivered by hand');

// Line. Only the description is required, other fields are optional
$obj_txn->addLine()->describe('Paul Smith Shirt')->quantity(1)->image('https://a.b.c/d.jpg')->attribute('Colour', 'Red')->attribute('Size', '12');

// Set the type of event and publish
$obj_client->event('order_detail')->send();

Estimated Delivery Dates

If your event templates support an estimated delivery date this can be sent along with your request.

The date will be included as provided so please send the date as you would like it to be displayed.

// Add and configure the target recipient/user
$obj_client->addUser()->id('1955')->name('Marty')->email('marty@mcfly.com')->mobile('07019551985');

// Set-up the transaction
$obj_client->addTransaction()->id('2015')->estimatedDelivery('10th May 2016');

// Set the type of event and publish
$obj_client->event('stock_arrived')->send();

Service Message

// Add and configure the target recipient/user
$obj_client->addUser()->id('1955')->name('Marty')->email('marty@mcfly.com')->mobile('07019551985');

// Set-up the transaction (optional, useful context)
$obj_client->addTransaction()->id('2015');

// Set a service message
$obj_client->addMessage()->title('Order Update')->body('Hi Marty. I am safe in 1885.')->from('ELB');

// Set the type of event and publish
$obj_client->event('service_message')->send();

Retrieve Thread Messages

Threads exist for either transaction (order) contexts or just plain user (customer) contexts.

// Retrieve any thread for Order "2015"
$obj_client->getThreadForTransaction('2015');

OR

// Retrieve any thread for User "12345"
$obj_client->getThreadForUser('12345');

The response will be a stdClass object decoded from the following JSON structure

{
    "id": "oid-2015",
    "topic": "Order 2015",
    "last_read": "2015-01-01 12:00:00",
    "last_read_device": "Mobile, iPhone",
    "messages": [
        {
            "title": "Order Accepted",
            "message": "Thank you for your order.",
            "created": "2015-01-01 12:00:00"
        }
    ]
}

Account Usage

// Retrieve basic account usage data
$obj_client->getAccountUsage();

The response will be a stdClass object decoded from the following JSON structure.

More usage statistics may be added in future.

{
    "this_month": {
        "name": "December 2015",
        "year": 2015,
        "month": 12,
        "sms": 199
    },
    "recent_months": [
        {
            "name": "October 2015",
            "year": 2015,
            "month": 10,
            "sms": 117
        },
        ...
    ]
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-11-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固