palpalani / bayrewards-laravel
BayRewards PHP SDK for Laravel Framework.
Installs: 5 147
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.2
- illuminate/contracts: ^10.0|^11.0
- saloonphp/saloon: ^3.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- larastan/larastan: ^2.6.3
- laravel/pint: ^1.10.3
- nunomaduro/collision: ^7.0|^8.1
- orchestra/testbench: ^8.5|^9.0
- pestphp/pest: ^2.8.2
- pestphp/pest-plugin-arch: ^2.2.1
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.3.1
- phpstan/phpstan-deprecation-rules: ^1.1.3
- phpstan/phpstan-phpunit: ^1.3.13
README
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.