Skip to content

Latest commit

 

History

History

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Examples of Rebilly SDK for PHP

This directory contains examples of how to use the Rebilly PHP SDK for PHP version v3.0. Below, there are instructions for running the code examples. Check out Rebilly API docs for more SDK examples.

Requirements

Running the examples

  1. Install package dependencies via Composer:

    composer install
  2. Go to the examples directory:

    cd ./examples
  3. Add the API key and organization ID to the client parameters in the purchase.php and pagination.php files.

    $client = new Client([
        'baseUrl' => Client::SANDBOX_HOST,
        'organizationId' => '{organizationId}',
        'apiKey' => '{secretKey}',
    ]);
  4. Run the purchase script:

    php purchase.php
  5. Run the pagination script:

    php pagination.php

Additional examples

  • authJwt.php: This example shows how to use the JWT authentication method. The result should be the list of products for the given organization as in the pagination.php; the difference is that when creating the client object, the parameter sessionToken is provided.

  • createEntity.php: This example shows how to create a new entity in two ways, one through the setters methods and another with the from array method.