smlnordic / kupongsupport-api
Integration with Kupongsupport API
2.1.3
2023-10-10 18:20 UTC
Requires
- php: ^8.0
- guzzlehttp/guzzle: ^7.8
- illuminate/contracts: ^10.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.8
- pestphp/pest: ^2.20
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-10-08 17:23:53 UTC
README
Installation
You can install the package via composer:
composer require smlnordic/kupongsupport-api
Init .env variables:
php artisan ks-api-init
You can publish the config file with:
php artisan vendor:publish --provider="SMLNordic\KSApi\KSApiServiceProvider" --tag="kupongsupport-api-config"
This is the contents of the published config file:
return [ 'token' => env('KS_API_TOKEN'), 'base_url' => env('KS_BASE_URL', 'https://kupongsupport.se'), 'templates' => [ 'print' => env('KS_PRINT_TEMPLATE_ID'), 'mobile' => env('KS_MOBILE_TEMPLATE_ID'), ], ];
Usage
Create and send a coupon via SMS:
$options = [ 'template' => XXXX, // Template ID in Kupongsupport 'type' => 'mobile', // "print" or "mobile 'delivery_type' => 'sms', // "sms", "email" or "api" 'amount' => 10, 'valid_days' => 90, ]; $kupongsupport = new SMLNordic\KSApi(); $coupon = $kupongsupport->createCoupon($options);
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
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.