This project based on alma-php-client allow you to contact Alma API endpoints
with different API keys for different environments (e.g. live
& test
) or projects - just like
stripe-cli does.
Tags: payments, payment gateway, ecommerce, e-commerce, alma, monthly payments, split payments, api, cli, alma-cli, command-line-interface
git clone
composer install
(@see get composer)
- Put your
ALMA_API_KEY
in a.env.*.local
file
Where*
define your environment & can be every word with only[a-Z]
characters - Optionally change alma api target by declaring
ALMA_API_MODE
in your.env.*.local
file (default istest
)
You can find all default values in the.env
file - Launch command as described bellow
Wheremyenvtest
=>.env.myenvtest.local
(the file containingALMA_API_KEY="sk_test_xxxxx"
for example)php bin/console --env myenvtest alma:merchant:get
alma:merchant:get
alma:eligibility:get
alma:payment:create
alma:payment:get
alma:accounting-transactions:get
You can found more about options & arguments with --help
option (ex: console alma:<command> --help
)
To manage many env (merchants, live, test, dev) you just have to:
- copy
.env
file to .env.<merch_name>[live|test|dev]
.local - remove lines before
ALMA_
variables - update
ALMA_API_KEY
at least (and other variable if needed) - launch your command with
--env
OR WITHOUT- if
--env
option is not provided: interactive select list with<mech_name>
-[live|test|dev]
will be purposed before launch command - if
ALMA_API_KEY
is not found: command will be failed - if
ALMA_API_KEY
is something likesk_live_***
and we are in write context (alma:payment:create
for example): interactive confirmation will be requested (until you add--force-live-env
option)
- if
- Auto-wiring commands into
Kernel.php
based on Alma api doc /\Alma\API\Client
available endpoints.