rbech/economic-api 问题修复 & 功能扩展

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

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

rbech/economic-api

Composer 安装命令:

composer require rbech/economic-api

包简介

Lightweight wrapper for the E-conomic REST API heavily inspired by drewm/mailchimp-api

README 文档

README

Lightweight wrapper for the E-conomic REST API. Heavily inspired by the excellent drewm/mailchimp-api wrapper.

Installation

You can install economic-api using Composer:

composer require rbech/economic-api

Examples

Get a list of customers

use \RBech\Economic\Economic;

$economic = new Economic('your-app-secret', 'your-grant-token');

Then, get a list of all customers (by issuing get request to the customers endpoint)

$customers = $economic->get('customers');

print_r($customers);

Createa customer in e-conomic

$result = $economic->post('customers', [
    'address' => 'My fancy address',
    'city' => 'Fancyville',
    'zip' => '9999',
    'customernumber' => 900000000,
    'email' => 'test@example.com',
    'name' => 'John Doe',
    'telephoneAndFaxNumber' => '11223344',
    'currency' => 'DKK',
    'customerGroup' => [
        'customerGroupNumber' => 1,
    ],
    'vatZone' => [
        'vatZoneNumber' => 1,
    ],
    'paymentTerms' => [
        'paymentTermsNumber' => 1
    ]
]);

Test for a successful request with the success() method:

if ($economic->success()) {
    print_r($result);
} else {
    //getLastError will return a simple string
    echo $economic->getLastError();
    
    //getErrors returns an array of errors returned
    print_r($economic->getErrors());
}

Contributing

Improvements and bug fixes are more than welcome, if come up with an improvement, please create an issue to discuss it before making a pull request.

If you find a bug please explain the bug throughly and the steps needed to reproduce it.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固