worldoptions/php-sdk 问题修复 & 功能扩展

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

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

worldoptions/php-sdk

Composer 安装命令:

composer require worldoptions/php-sdk

包简介

PHP SDK for Ecommerce REST API

README 文档

README

The World Options SDK for PHP makes it easy for developers to access World Options Web Services in their PHP code, and build robust applications and software. You can get started in minutes by installing the SDK through Composer or by downloading a single zip or phar file from our latest release.

Jump To:

Getting Started

  1. Sign up for World Options – Before you begin, you need to sign up for an World Options account and retrieve your World Options credentials.
  2. Minimum requirements – To run the SDK, your system will need to meet the minimum requirements, including having PHP >= 7.1. We highly recommend having it compiled with the cURL extension and cURL 7.16.2+ compiled with a TLS backend (e.g., NSS or OpenSSL).
  3. Install the SDK – Using [Composer] is the recommended way to install the World Options SDK for PHP. The SDK is available via [Packagist] under the worldoptions/php-sdk package. If Composer is installed globally on your system, you can run the following in the base directory of your project to add the SDK as a dependency:
    composer require worldoptions/php-sdk
    
  4. Using the SDK – The best way to become familiar with how to use the SDK is to read the Documentation. The Quick Examples will help you become familiar with the basic concepts.

Quick Examples

World Options API client

<?php
// Require the Composer autoloader.
require 'vendor/autoload.php';

use WorldOptions\WorldOptions as WorldOptionsApi;

// Instantiate an World Options API client.
$siteUrl = 'http://example.com'; 
$username = 'WOTest'; 
$meternumber = 'ddffg3rfdweq22rffeiwijew'; // You can check it on Customer Portal -> Integrations Tab

$worldOptionsApi = new WorldOptionsApi($siteUrl, $username, $meternumber);

Create Shop

<?php
try {
    use WorldOptions\WorldOptions as WorldOptionsApi;
    use WorldOptions\Model\Shop;
    use WorldOptions\Model\Core\Customer;
    use WorldOptions\Model\Localization\Country;

    $siteUrl = 'http://example.com';
    
    $api = new WorldOptionsApi($siteUrl);

    $customer = new Customer();
    $customer->setUsername("WOTest");
    $customer->setPassword("WOTestPSW");
    $customer->setMeternumber("ddffg3rfdweq22rffeiwijew");

    $country = new Country();
    $country->setCode("GB");
    $customer->setCountry($country);

    $shop = new Shop();
    $shop->setUrl($url);
    $shop->setPlatform(Shop::PLATFORM_CUSTOM);
    $shop->setCustomer($customer);

    /**
     * @return WorldOptions\Model\Shop
     */
    $shop = $api->shops()->authorize($shop);
} catch (WorldOptions\Utils\ResponseException $e) {
    echo "There was an error when try creating shop.\n";
}

Getting Help

If you have any problems, found a security issue, please contact the maintainers directly at arkadiusz.tobiasz@theifactory.com.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2022-03-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固