Skip to content

Installation

Mehmet Aydin Bahadir edited this page Apr 10, 2017 · 3 revisions

Add package to your composer.json file "iyzico/iyzipay-laravel": "dev-master", and run composer install.

Add service provider to your providers array in config/app.php file.

Iyzico\IyzipayLaravel\IyzipayLaravelServiceProvider::class

This package uses an IyzipayLaravel facade for creating and managing subscription plans for your Payable models easily. Add it to your aliases array in config/app.php file.

'IyzipayLaravel' => Iyzico\IyzipayLaravel\IyzipayLaravelFacade::class

Publish configuration file with

$ php artisan vendor:publish --provider="Iyzico\IyzipayLaravel\IyzipayLaravelServiceProvider"

You should modify config/iyzipay.php file and map your billable model. Think billable model as your customers. This is initially mapped to your App/User model, but you may change this to App/Organization model.

'billableModel' => 'App\User'

You must be sure that you have environment variables below, and be sure about they are correct credentials:

.env

IYZIPAY_BASE_URL=BASE_URL_HERE
IYZIPAY_API_KEY=YOUR_KEY_HERE
IYZIPAY_SECRET_KEY=YOUR_SECRET_KEY_HERE

At last, you must migrate package tables to your project.

$ php artisan migrate
Clone this wiki locally