fullpipe/biglion-client

Simple Biglion api client

v2.0.3 2017-07-18 06:47 UTC

This package is auto-updated.

Last update: 2024-10-27 00:53:35 UTC


README

Usage

$bc = new \Fullpipe\Biglion\Client('email@example.com', 'password');

try {
    var_dump($bc->getCouponInfo('012345-0000-0001'));
    var_dump($bc->redeemCoupon('012345-0000-0001', '1234'));
    var_dump($bc->reserveCoupon('012345-0000-0001', '387'));
} catch (\Fullpipe\Biglion\BiglionException $e) {
    echo $e->getMessage();
}

try {
    var_dump($bc->getCouponInfo('012345-0000-0002'));
    var_dump($bc->redeemCoupon('012345-0000-0002', '1234'));
    var_dump($bc->reserveCoupon('012345-0000-0002', '387'));
} catch (\Fullpipe\Biglion\BiglionException $e) {
    echo $e->getMessage();
}

try {
    var_dump($bc->getCouponInfo('012345-0000-0003'));
    var_dump($bc->redeemCoupon('012345-0000-0003', '1234'));
    var_dump($bc->reserveCoupon('012345-0000-0003', '387'));
} catch (\Fullpipe\Biglion\BiglionException $e) {
    echo $e->getMessage();
}

Test

composer install --dev
BIGLION_EMAIL=email@example.com BIGLION_PASSWORD=password vendor/bin/phpunit