PHPackages                             radial/retail-order-management - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. radial/retail-order-management

ActiveLibrary[API Development](/categories/api)

radial/retail-order-management
==============================

Software Development Kit for working with the Retail Order Management Web API

1.5.39(9y ago)01.7k11OSL-3.0PHPPHP &gt;=5.4

Since Jan 14Pushed 9y ago4 watchersCompare

[ Source](https://github.com/RadialCorp/RetailOrderManagement-SDK)[ Packagist](https://packagist.org/packages/radial/retail-order-management)[ RSS](/packages/radial-retail-order-management/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (9)Versions (72)Used By (1)

[![ebay logo](docs/static/logo-vert.png)](http://www.ebayenterprise.com/)

Retail Order Management Software Development Kit
================================================

[](#retail-order-management-software-development-kit)

[![unit test status](https://camo.githubusercontent.com/ed7bf34ef99d64f5826662683d0342a3776b8f9c147acf85138da3e81d788c31/68747470733a2f2f636972636c6563692e636f6d2f67682f65426179456e74657270726973652f52657461696c4f726465724d616e6167656d656e742d53444b2f747265652f6d61737465722e7376673f7374796c653d736869656c6426636972636c652d746f6b656e3d65363662656465353862616439323534346630323238636433363166316265646131343162373934)](https://circleci.com/gh/eBayEnterprise/RetailOrderManagement-SDK)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/906632d06c4c21bc0ec3c560ccf66e34777e5c7026a6535c77eef90fdfa91e5d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f65426179456e74657270726973652f52657461696c4f726465724d616e6167656d656e742d53444b2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/eBayEnterprise/RetailOrderManagement-SDK/?branch=master)

A PHP implementation of the Retail Order Management API(s) that hides unnecessary details such as request/response handling and XML parsing from the API user in order to provide a minimal interface for remote messages and procedure calls.

Requires PHP 5.4 and later.

Compatible with Retail Order Management schema version 1.8.20.

Setup
-----

[](#setup)

For best results, install via [Composer](https://getcomposer.org/).

In composer.json:

```
"require": {
    "ebayenterprise/retail-order-management": "~1.0"
}
```

Or with the Composer CLI:

```
php composer.phar require ebayenterprise/retail-order-management:~1.0
```

Payloads
--------

[](#payloads)

Payloads represent the data that is sent or received through the SDK.

```
// The payload factory can be used to create any of the
// supported payloads types.
$payloadFactory = new \eBayEnterprise\RetailOrderManagement\Payload\PayloadFactory;
// Instantiate a payload object with the factory by passing
// the full class name of the payload to the factory.
$payload = $payloadFactory
    ->buildPayload('\eBayEnterprise\RetailOrderManagement\Payload\Payment\StoredValueBalanceRequest');

// Payloads can be populated with data by:

// Calling setters for all of the required data.
$payload->setCardNumber('11112222')
    ->setPanIsToken(false)
    ->setRequestId('1234567890')
    ->setPin('5555')
    ->setCurrencyCode('USD');

// Deserializing a serialized set of data.
$payload->deserialize('...');

// Complete payload can now be validated.
try {
    $payload->validate();
} catch (\eBayEnterprise\RetailOrderManagement\Payload\Exception\InvalidPayload $e) {
    // The payload is invalid. The exception message, $e->getMessage(),
    // will contain details of the validation error.
}

// Serializing a payload will produce an XML representation of the payload.
$payload->serialize();
```

### Request Payloads

[](#request-payloads)

Request payloads represent a set of data to be sent across the SDK.

```
/** @var \eBayEnterprise\RetailOrderManagement\Api\HttpApi $api */
$api;

// Request payloads will be created as necessary by the transport mechanism
// that will be sending the payload.
$payload = $api->getRequestBody();

// The payload should be populated with data necessary to make the call
// using the SDK.

// Payload interfaces expose methods to set data the data piecemeal.
$payload->setCardNumber('11112222')
    ->setPanIsToken(false)
    ->setRequestId('1234567890')
    ->setPin('5555')
    ->setCurrencyCode('USD');

// A serialized payload may also be deserialized to set all of the data
// in the serialization on the payload.
$payload->deserialize('...');

// Once the payload has been populated, it can be given back to the
// API and sent.
$api->setRequestBody($payload)->send();
```

### Reply Payload

[](#reply-payload)

Reply payloads represent sets of data retrieved from the SDK.

```
// Get the reply payload from the API object, in this case the
// response from an HTTP API call. Assume $httpApi to be an
// \eBayEnterprise\RetailOrderManagment\Api\HttpApi object.
$payload = $httpApi->getResponseBody();

// If a payload was populated by the SDK, it will have been
// validated automatically. Validation can still be done on demand
// if desired.
try {
    $payload->validate();
} catch (\eBayEnterprise\RetailOrderManagement\Payload\Exception\InvalidPayload $e) {
    // The payload is invalid. The exception message, $e->getMessage(),
    // will contain details of the validation errors.
}

// Get methods will be present for any data in the payload.
$payload->getOrderId();
$payload->getCurrencyCode();
```

### Sub-Payloads

[](#sub-payloads)

The majority of payloads in the SDK are flat, all necessary data is set within a single payload object. In some cases, however, a payload will contain additional nested payloads.

```
/** @var \eBayEnterprise\RetailOrderManagment\Payload\OrderEvents\OrderShipped $payload */
$payload;

// Some payloads will contain an iterable of sub-payloads. In this case,
// $loyaltyPrograms will be an interable payload containing a collection
// of loyalty program payloads.
$loyaltyPrograms = $payload->getLoyaltyPrograms();

// The iterable is a complete payload and can be serialized, deserialized and
// validated like any other payload.
$loyaltyPrograms->validate();
$loyaltyPrograms->serialize();
$loyaltyPrograms->deserialize('......');

foreach ($loyaltyPrograms as $program) {
    // The objects in the iterable area also complete payloads.
    $program->validate();
    $program->setAccount('ABCDEFG');
}

// Iterable payloads will always provide a way of getting empty payloads
// that can be added to the iterable.
$loyaltyProgram $loyaltyPrograms->getEmptyLoyaltyProgram();

// Payload can now be filled out and added to the iterable.
$loyaltyProgram->setAccount('XYZ')->setProgram('RewardProgram');
$loyaltyPrograms->attach($loyaltyProgram);

// Sub-payloads may also be used to create a separate container of data
// within a payload or when a set of data cannot be trivially flattened
// into a single payload.
$destination = $payload->getShippingDestination();

// The shipping destination may be a mailing address (shipped to a customer)
// or a store front location (shipped to a retail store).
if ($destination instanceof \eBayEnterprise\RetailOrderManagement\Payload\OrderEvents\IMailingAddress) {
    $destination->getFistName();
    $destination->getLastName();
} elseif ($destination instanceof \eBayEnterprise\RetailOrderManagement\Payload\OrderEvents\IStoreFrontDetails) {
    $destination->getStoreName();
    $destination->getHours();
}

// In both cases, the object returned will still be a complete payload and
// can be treated as such.
$destination->validate();
$destination->deserialize();
```

HTTP API
--------

[](#http-api)

The HTTP API is a transport mechanism for communicating with the web service APIs. It facilitates creating, sending and recieving payloads of a message.

```
// Use an HttpConfig instance to configure an HttpApi object for a message.
$apiConfig = new \eBayEnterprise\RetailOrderManagement\Api\HttpConfig(
    $apiKey, // authentication token for connecting to the api
    $apiHostname,
    $apiMajorVersion, // major version number of the service
    $apiMinorVersion, // minor version number of the service
    $storeId, // Retail Order Management store identifier
    $service, // type of service to communicate with (e.g. payments)
    $operation, // string representing the operation to be performed (e.g. creditcard/auth)
    $endPointParams = [] // optional, extra parameters for the request.
);
$httpApi = new \eBayEnterprise\RetailOrderManagement\Api\HttpApi($apiConfig);

try {
    // get the request payload for the message.
    $request = $httpApi->getRequestBody();
    // set the payload as the message body and send the request.
    $httpApi->setRequestBody($request)
        ->send();
    $reply = $httpApi->getResponseBody();
    // process response data

} catch (\eBayEnterprise\RetailOrderManagement\Payload\Exception\UnsupportedOperation $e) {
    // Exception may be thrown from: { send, getRequestBody, getResponseBody }
    // Handle the case where the service and operation specified in the configuration has no matching payload.
    print $e->getMessage();

} catch (\eBayEnterprise\RetailOrderManagement\Api\Exception\UnsupportedHttpAction $e) {
    // Exception may be thrown from: { send }
    // handle the case where the http method is configured with an invalid value
    print $e->getMessage();

} catch (\eBayEnterprise\RetailOrderManagement\Api\Exception\NetworkException $e) {
    // Exception may be thrown from: { send }
    // handle the case where the request takes longer than the timeout threshold or if the connection cannot be made or is lost
    print $e->getMessage();

} catch (\eBayEnterprise\RetailOrderManagement\Payload\Exception\InvalidPayload $e) {
    // Exception may be thrown from: { send, getRequestBody, getResponseBody }
    // handle the case where a payload fails validation
    print $e->getMessage();
}
```

AMQP API
--------

[](#amqp-api)

Use the AMQP API to respond to batches of Retail Order Managment events.

```
// Similar to the HttpApi, start with by filling out a configuration object
$apiConfig = new Api\AmqpConfig(
    $connectionType, // string that configures the way the api connects to a queue.
                     // Use '\PhpAmqpLib\Connection\AMQPSSLConnection' to connect using ssl.
                     // Use '\PhpAmqpLib\Connection\AMQPConnection' to connect without ssl.
    $maxMessagesToProcess, // The number of message to process per batch
    $connectionHostname,
    $connectionPort,
    $connectionUsername,
    $connectionPassword,
    $connectionVhost,
    array $connectionContext,
    $connectionInsist,
    $connectionLoginMethod,
    $connectionLocale,
    $connectionTimeout,
    $connectionReadWriteTimeout,
    $queueName,
    // flags
    $queuePassive,
    $queueDurable,
    $queueExclusive,
    $queueAutoDelete,
    $queueNowait
);
$amqpApi = new Api\HttpApi($apiConfig);

// Get a PayloadIterator object in order to process messages.
$payloads = $amqpApi->fetch();

// Use `valid` to control the iteration over the messages. Each call attempts
// to retreive a message. If a message is received it is `ack`ed immediately.
while ($payloads->valid()) {
    try {
        // The AmqpApi does not deserialize payloads as it recieves them.
        // Deserialization happens during the call to PayloadIterator::current().
        $payload = $payloads->current();
    } catch (\eBayEnterprise\RetailOrderManagement\Payload\Exception\Payload $e) {
        // While iterating through the payloads, a Payload exception may be
        // thrown and cause the premature end of the loop unless caught.

        print $e->getMessage();
    }
    // advance the internal pointer to the next payload
    $payloads->next();
}
```

Tests
-----

[](#tests)

### Using [Docker](https://www.docker.com/)

[](#using-docker)

A [fig file](fig.yml) is included to automate creating and coordinating [Docker](https://www.docker.com/) containers to install and run tests.

To install and run tests using [Fig](http://www.fig.sh/):

```
# setup and install
fig run --rm setup
fig run --rm composer install
# run tests
fig run --rm phpunit
```

See [fig.yml](fig.yml) for additional commands for automated tests and static analysis.

See [Docker](https://www.docker.com/) and [Fig](http://www.fig.sh/) for additional installation and usage information.

### Local with [Composer](https://getcomposer.org/)

[](#local-with-composer)

After composer has installed all dependencies, tests can be run from the SDK's root directory.

```
vendor/bin/phpunit
vendor/bin/phpmd src text phpmd.xml
vendor/bin/phpcs --standard=psr2 src
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~10 days

Recently: every ~28 days

Total

71

Last Release

3455d ago

PHP version history (2 changes)1.3.6PHP &gt;=5.4

1.5.14PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/b102d75315b37de6c9ffbab3da2c02874ba115d38a6044b5b8b038277f0eae1f?d=identicon)[ryaan-anthony](/maintainers/ryaan-anthony)

---

Top Contributors

[![scottvanbrug](https://avatars.githubusercontent.com/u/682843?v=4)](https://github.com/scottvanbrug "scottvanbrug (80 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/radial-retail-order-management/health.svg)

```
[![Health](https://phpackages.com/badges/radial-retail-order-management/health.svg)](https://phpackages.com/packages/radial-retail-order-management)
```

###  Alternatives

[razorpay/razorpay

Razorpay PHP Client Library

2035.2M54](/packages/razorpay-razorpay)[pubnub/pubnub

This is the official PubNub PHP SDK repository.

1335.1M17](/packages/pubnub-pubnub)[culqi/culqi-php

Cliente Culqi API para PHP

41366.0k1](/packages/culqi-culqi-php)[ahmadawais/sendy-php-api

Sendy PHP API Wrapper: Complete API interfacing.

8578.6k](/packages/ahmadawais-sendy-php-api)[epayco/epayco-php

Epayco API client for PHP

24196.4k3](/packages/epayco-epayco-php)[yunchuang/appstore-connect-api

sdk for appstore connect api

3865.4k](/packages/yunchuang-appstore-connect-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
