Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Latest commit

 

History

History
49 lines (32 loc) · 1.23 KB

installation.md

File metadata and controls

49 lines (32 loc) · 1.23 KB

Installation

This page explains how to install and configure Chargeable API with Symfony.

Composer

Install packages with composer:

$ composer require damax/chargeable-api # symfony/security-bundle - Make sure security component is installed.

You need to choose appropriate wallet implementation:

$ # For Redis
$ composer require predis/predis snc/redis-bundle

$ # For MongoDB
$ composer require mongodb/mongodb

Bundles

With introduction of symfony/flex you don't have to worry about enabling relevant bundles, but make sure below is present in your configuration.

// Symfony v4.0 example, but v3.x is also supported.
Damax\ChargeableApi\Bridge\Symfony\Bundle\DamaxChargeableApiBundle::class => ['all' => true],

// For Redis
Snc\RedisBundle\SncRedisBundle::class => ['all' => true],

Configuration

By default all routes are processed for payment. You can configure endpoints for paid APIs with below:

damax_chargeable_api:
    listener:
        matcher: ^/api/services/ # Regex

As all paid endpoints require authentication make sure it is covered by Security firewall.

Next

Read next about library concepts or skip right to configuration.