2017 © Pedro Peláez
 

library passhub-api

PassHub API Client

image

sightseeingtech/passhub-api

PassHub API Client

  • Thursday, June 21, 2018
  • by bymdev
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PassHub Api

PassHub API documentation, (*1)

Access PassHub with Php. This module offers high level and low level calls to the API., (*2)

Requirements

PHP 5.5 and later, (*3)

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:, (*4)

{
  "require": {
      "sightseeingtech/passhub-api": "1.0"
   }
}

Then run composer install, (*5)

Manual Installation

Download the files and include autoload.php:, (*6)

    require_once('/path/to///vendor/autoload.php');

Tests

To run the unit tests:, (*7)

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:, (*8)

setApiKey('X-Api-Key', 'YOUR_API_KEY');
    $config->setHost('YOUR_HOST');

    $orderRecordResource = new passhub\client\api\OrderRecordResourceApi(
        new GuzzleHttp\Client(['verify' => false]),
        $config
    );

    $item = new passhub\client\model\OrderItem([
        'customer_name' => 'My Name',
        'customer_type' => 'ADULT',
        'sku' => '1GL5_Child',
        'quantity' => 1,
        'price_paid' => 55.2,
        'tour_date' => new DateTime('2018-06-10')
    ]);

    $group = new passhub\client\model\GroupEntryDTO([
        'group_name' => 'TESTSDK_GROUP_NAME',
        'voucher_per_person' => true,
        'items' => [$item],
    ]);

    $order = new passhub\client\model\OrderRecordDTO([
        'amount' => 110.4,
        'customer_email' => 'test@test.com',
        'vendor_order_id' => 'TESTSDK_ORDER_1',
        'originiator' => 'TESTSDK_ORIGINATOR',
        'groups' => [$group],
    ]);

    $createdOrder = $orderRecordResource->createOrderRecord($order);

    echo $createdOrder->getId();
} catch (Exception $e) {
    print_r($e->getMessage());
}

?>

Documentation for API Endpoints

Class Method HTTP request Description
OrderRecordResourceApi createOrderRecord POST /api/v1/orderRecords createOrderRecord
OrderRecordResourceApi getAllOrderRecords GET /api/v2/orderRecords getAllOrderRecords
OrderRecordResourceApi getOrderRecord GET /api/v1/orderRecords/{id} getOrderRecord
OrderRecordResourceApi mergeVouchers POST /api/v1/orderRecords/mergeVouchers mergeVouchers
OrderRecordResourceApi updateOrderRecord PUT /api/v1/orderRecords updateOrderRecord
ProductResourceApi findProductsByVendor GET /api/v1/products/vendor/{vendorId} findProductsByVendor
ProductResourceApi getAllProducts GET /api/v2/products getAllProducts
VendorResourceApi getAllVendors GET /api/v2/vendors getAllVendors
VoucherResourceApi cancelValidation POST /api/v2/voucher/validate/cancel [V2] Cancel validation for the voucher
VoucherResourceApi cancelVoucher POST /api/v1/voucher/cancel cancelVoucher
VoucherResourceApi convertVoucher POST /api/v1/voucher/convert convertVoucher
VoucherResourceApi validateVoucher POST /api/v2/voucher/validate [V2] Validates voucher which represents single order item or group of them.

Documentation For Models

Documentation For Authorization

X-Api-Key

  • Type: API key
  • API key parameter name: X-Api-Key
  • Location: HTTP header

The Versions

21/06 2018

dev-master

9999999-dev http://sightseeing.tech

PassHub API Client

  Sources   Download

MIT

The Requires

 

The Development Requires

by BYM Development LLC

api api client passhub sightseeingpass

21/06 2018

v1.0.0

1.0.0.0 http://sightseeing.tech

PassHub API Client

  Sources   Download

MIT

The Requires

 

The Development Requires

by BYM Development LLC

api api client passhub sightseeingpass