palpalani/bayrewards-laravel

BayRewards PHP SDK for Laravel Framework.

0.2.6 2024-05-15 13:38 UTC

This package is auto-updated.

Last update: 2024-10-08 14:54:29 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

BayRewards PHP SDK for Laravel Framework.

BayRewards revolutionizes e-commerce engagement with a comprehensive rewards platform. Seamlessly integrated with online stores, BayRewards offers point programs, referral incentives, and VIP perks to drive customer loyalty and sales. Elevate your e-commerce experience by incentivizing purchases, encouraging referrals, and rewarding VIP customers with exclusive benefits. With BayRewards, businesses can effortlessly cultivate customer relationships and foster brand advocacy, leading to increased retention and revenue.

Installation

You can install the package via composer:

composer require palpalani/bayrewards-laravel

You can publish the config file with:

php artisan vendor:publish --tag="bayrewards-laravel-config"

This is the contents of the published config file:

return [
    'bayrewards_base_url' => env('BAYREWARDS_BASE_URL')
];

Usage

Get store details, after integrate with BayRewards.io

use Palpalani\BayRewards\BayRewards;

$bayRewards = BayRewards::client();
$store = $client->storeDetails()->get('<Store-Access-Token>');

Create a new BayReward Activity

use Palpalani\BayRewards\BayRewards;

$bayRewards = BayRewards::client();
$activity = $bayRewards->createActivity()->post('<Store-Access-Token>', [
        "title" => "Title of the Activity name", //required
        "icon" => "<Icon URL>" //required
    ]);

Update the BayReward Activity

use Palpalani\BayRewards\BayRewards;

$bayRewards = BayRewards::client();
$activity = $bayRewards->updateActivity()->post('<Store-Access-Token>', [
        "title" => "Title of the Activity name", //required
        "icon" => "<Icon URL>", //required
        "activity_id" => ******* //required
    ]);

Update loyalty points

use Palpalani\BayRewards\BayRewards;

$bayRewards = BayRewards::client();
$updatePoints = $bayRewards->updatePoints()->post('<Store-Access-Token>', [
    "activity_id" => '<From activity payload>', //required
    'customer_email' => '<Customer Email>', //required
]);

Get all Customers List

use Palpalani\BayRewards\BayRewards;

$bayRewards = BayRewards::client();
$store = $bayRewards->allCustomers()->get(
'<Store-Access-Token>, //required  
0, //optional - page , default - 1    
0,//optional - limit , default - 25    
0,//optional - type  , default - NaN    
"" //optional - search'
);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.