Install with composer:
composer require jms/payment-core-bundle
The configuration is as simple as setting an encryption key which will be used for encrypting data. You can generate a random key with the following command:
And then use it in your configuration:
# config/packages/payment.yaml jms_payment_core: encryption: secret: output_of_above_command
If you change the
secret or the
crypto provider, all encrypted data will become unreadable.
Create database tables¶
This bundle requires a few database tables, which you can create as follows.
If you’re not using database migrations:
Or, if you’re using migrations:
bin/console doctrine:migrations:diff bin/console doctrine:migrations:migrate
It’s assumed you have entity auto mapping enabled, which is usually the case. If you don’t, you need to either enable it:
# config/packages/doctrine.yaml doctrine: orm: auto_mapping: true
Or explicitly register the configuration from this bundle:
# config/packages/doctrine.yaml doctrine: orm: mappings: JMSPaymentCoreBundle: ~
Configure a payment backend¶
In addition to setting up this bundle, you will also need to install a plugin for each payment backend you intend to support. Plugins are simply bundles you add to your application, as you would with any other Symfony bundle.
See Available payment backends for the list of existing plugins.
Using the Paypal plugin as an example, you would install it with composer:
composer require jms/payment-paypal-bundle
And configure it:
# config/packages/payment.yaml jms_payment_paypal: username: your api username password: your api password signature: your api signature
Other plugins will require different configuration. Take a look at their documentation for complete instructions.