Skip to content

An eBay SDK for PHP. Use the eBay Business Policies Management API in your PHP projects.

License

Notifications You must be signed in to change notification settings

thomaswacker/ebay-sdk-business-policies-management

 
 

Repository files navigation

EBAY-SDK-BUSINESS-POLICIES-MANAGEMENT

Build Status

This project enables PHP developers to use the eBay API in their PHP code, and build software using the Business Policies Management service. You can get started by installing the SDK via Composer and by following the Getting Started Guide.

Features

Resources

  • User Guides - Getting started guide and in-depth information.
  • SDK Versions - A complete list of each SDK, and the API version they support.
  • Sample Project - Provides several examples of using the SDK.
  • Google Group - Join for support with the SDK.
  • @devbaydotnet - Follow on Twitter for announcements of releases, important changes and so on.

Requirements

  • PHP 5.3.3 or greater with the following extensions:
    • cURL
    • libxml
  • 64 bit version of PHP recommended as there are some issues when using the SDK with 32 bit.
  • SSL enabled on the cURL extension so that https requests can be made.

Installation

The SDK can be installed with Composer. Please see the Installation section of the User Guide to learn about installing through other means.

  1. Install Composer.

    curl -sS https://getcomposer.org/installer | php
    
  2. Install the SDK.

    php composer.phar require dts/ebay-sdk-business-policies-management
    
  3. Require Composer's autoloader by adding the following line to your code.

    require 'vendor/autoload.php';

Example

List all business policies

<?php

require 'vendor/autoload.php';

use \DTS\eBaySDK\BusinessPoliciesManagement\Services\BusinessPoliciesManagementService;
use \DTS\eBaySDK\BusinessPoliciesManagement\Types\GetSellerProfilesRequest;
use \DTS\eBaySDK\Constants\GlobalIds;

// Instantiate an eBay service.
$service = new BusinessPoliciesManagementService(array(
    'authToken' => 'YOUR_PRODUCTION_USER_TOKEN_APPLICATION_KEY',
    'globalId' => GlobalIds::US
));

// Create the API request object.
$request = new GetSellerProfilesRequest();

// Send the request.
$response = $service->getSellerProfiles($request);

// Output the response from the API.
if (isset($response->paymentProfileList)) {
    echo "================\nPayment Profiles\n================\n";
    foreach ($response->paymentProfileList->PaymentProfile as $profile) {
        printf("(%s) %s: %s\n",
            $profile->profileId,
            $profile->profileName,
            $profile->profileDesc
        );
    }
}

if (isset($response->returnPolicyProfileList)) {
    echo "\n======================\nReturn Policy Profiles\n======================\n";
    foreach ($response->returnPolicyProfileList->ReturnPolicyProfile as $profile) {
        printf("(%s) %s: %s\n",
            $profile->profileId,
            $profile->profileName,
            $profile->profileDesc
        );
    }
}

if (isset($response->shippingPolicyProfile)) {
    echo "\n========================\nShipping Policy Profiles\n========================\n";
    foreach ($response->shippingPolicyProfile->ShippingPolicyProfile as $profile) {
        printf("(%s) %s: %s\n",
            $profile->profileId,
            $profile->profileName,
            $profile->profileDesc
        );
    }
}

Project Goals

Project Maturity

This is a personal project that has been developed by me, David T. Sadler. I decided to create this project to make up for the lack of an official SDK for PHP. It is in no way endorsed, sponsored or maintained by eBay.

As this is a brand new project you should expect frequent releases until it reaches the stable 1.0.0 target. I will endeavour to keep changes to a minimum between each release and any changes will be documented.

License

Licensed under the Apache Public License 2.0.

Copyright 2014 David T. Sadler

About

An eBay SDK for PHP. Use the eBay Business Policies Management API in your PHP projects.

Resources

Stars

Watchers

Forks