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 clonecomposer install(@see get composer)
- Put your
ALMA_API_KEYin a.env.*.localfile
Where*define your environment & can be every word with only[a-Z]characters - Optionally change alma api target by declaring
ALMA_API_MODEin your.env.*.localfile (default istest)
You can find all default values in the.envfile - 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:getalma:eligibility:getalma:payment:createalma:payment:getalma: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
.envfile to .env.<merch_name>[live|test|dev].local - remove lines before
ALMA_variables - update
ALMA_API_KEYat least (and other variable if needed) - launch your command with
--envOR WITHOUT- if
--envoption is not provided: interactive select list with<mech_name>-[live|test|dev]will be purposed before launch command - if
ALMA_API_KEYis not found: command will be failed - if
ALMA_API_KEYis something likesk_live_***and we are in write context (alma:payment:createfor example): interactive confirmation will be requested (until you add--force-live-envoption)
- if
- Auto-wiring commands into
Kernel.php
based on Alma api doc /\Alma\API\Clientavailable endpoints.