-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from sequra/chore/add-set-up-script
Add script to launch Magento instance with the sequra plugin.
- Loading branch information
Showing
21 changed files
with
426 additions
and
626 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
MAGENTO_VERSION=2 | ||
|
||
SQ_M2_CORE_VERSION=* | ||
# Use "local" to run code in local directory | ||
#SQ_M2_CORE_VERSION=local | ||
SQ_MERCHANT_REF=dummy | ||
SQ_USER_NAME=dummy | ||
SQ_USER_SECRET=ZqbjrN6bhPYVIyram3wcuQgHUmP1C4 | ||
SQ_ASSETS_KEY=ADc3ZdOLh4 | ||
SQ_ENDPOINT=https://sandbox.sequrapi.com/orders | ||
|
||
MAGENTO_HTTP_PORT=8018 | ||
MAGENTO_EXTERNAL_HTTP_PORT_NUMBER=${MAGENTO_HTTP_PORT} | ||
MAGENTO_HTTPS_PORT=8019 | ||
MAGENTO_EXTERNAL_HTTPS_PORT_NUMBER=${MAGENTO_HTTPS_PORT} | ||
MAGENTO_MYSQL_PORT=8020 | ||
|
||
# More options available at https://hub.docker.com/r/bitnami/magento | ||
MAGENTO_HOST=localhost | ||
MAGENTO_DATABASE_HOST=mariadb | ||
MAGENTO_DATABASE_PORT_NUMBER=3306 | ||
MAGENTO_DATABASE_USER=bn_magento | ||
MAGENTO_DATABASE_NAME=bitnami_magento | ||
ELASTICSEARCH_HOST=elasticsearch | ||
ELASTICSEARCH_PORT_NUMBER=9200 | ||
MAGENTO_EMAIL=magento@sequra.com | ||
MAGENTO_FIRST_NAME=admin_first_name | ||
MAGENTO_LAST_NAME=admin_last_name | ||
MAGENTO_USERNAME=admin | ||
MAGENTO_PASSWORD=password123 | ||
MAGENTO_FRONTNAME=admin | ||
MAGENTO_COUNTRY=ES | ||
|
||
MAGENTO_LOCALE=es_ES | ||
MAGENTO_CURRENCY=EUR | ||
MAGENTO_TIMEZONE=Europe/Berlin | ||
MAGENTO_SAMPLEDATA=yes | ||
MAGENTO_EXTRA_INSTALL_ARGS="--currency=${MAGENTO_CURRENCY} --timezone=${MAGENTO_TIMEZONE} --language=${MAGENTO_LOCALE} --cleanup-database" | ||
MAGENTO_ENABLE_HTTP_CACHE=no | ||
|
||
# ALLOW_EMPTY_PASSWORD is recommended only for development. | ||
ALLOW_EMPTY_PASSWORD=yes | ||
#MAGENTO_DATABASE_PASSWORD=supersecret | ||
COMPOSER_AUTH='{"http-basic":{"repo.magento.com":{"username":"<public-key>","password":"<private-key>"}}}' | ||
# Outside /bitnami/magento/ | ||
COMPOSER_CACHE_DIR=/opt/.composer/cache | ||
# Enable xdebug | ||
PHP_XDEBUG_ENABLED=no | ||
BITNAMI_DEBUG=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
.idea | ||
vendor | ||
docker-compose.override.yml | ||
.composer_cache | ||
.env | ||
default.vcl | ||
id_rsa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,125 @@ | ||
# sequra-magento2-rework | ||
SeQura magento2 payment gateway module. | ||
# Magento module for SeQura payment gateway | ||
|
||
1. [About seQura](#about-sequra) | ||
2. [Installation guide](https://sequra.atlassian.net/wiki/spaces/DOC/pages/1377304583/MAGENTO+2) | ||
3. [Sign-up](#sign-up) | ||
4. [For developers](#for-developers) | ||
|
||
## About seQura | ||
### Description | ||
|
||
seQura is the flexible payment platform that will help your business improve conversion and recurrence. | ||
The easiest, safest, and quickest way for your customers to pay on installments. | ||
|
||
+6.000 e-commerce and +1.5 million delight shoppers already use seQura. Are you still thinking about it? | ||
|
||
This WooCommerce plugin allows you to make payments with [seQura](https://sequra.es). | ||
|
||
### Benefits for merchants | ||
|
||
> Flexible payment solutions adapted to your business. | ||
Widest flexible payment solutions in the market: | ||
|
||
* Buy now pay later | ||
* Pay in 3, no interest | ||
* Installments, up to 24 months | ||
* Flexi, combines interest-free BNPL with long-term financing in a single purchase experience | ||
|
||
Your customers in good hands: | ||
|
||
* Cost transparency and clarity | ||
* Local support teams to deliver the best shopper experience | ||
* Secure data, we don’t share your data with anyone or use your information to sell our own or third-party products | ||
|
||
|
||
Obsessed with conversion and recurrence | ||
|
||
* We adapt to your business, solutions for every sector, and buyer profile | ||
* The highest acceptance rate in Southern Europe thanks to our own risk algorithm, created and optimized for the local market | ||
* Instant approval. A frictionless credit-purchase experience, buy-in seconds without document uploads | ||
* seQura marketing collateral to support your campaigns | ||
|
||
### Benefits for customers | ||
|
||
* Widest range of flexible payment solutions available on the market, up to 4 different solutions to pay as you want. | ||
* Access to credit with no paperwork, just complete 5 fields to be instantly approved | ||
* Security and privacy, we do not sell your personal data to third parties nor share with other companies | ||
|
||
## Installation guide | ||
|
||
Check the [installation guide](https://sequra.atlassian.net/wiki/spaces/DOC/pages/1377304583/MAGENTO+2) | ||
|
||
## Sign-up | ||
|
||
Si tu comercio no está dado de alta en seQura, puedes hacerlo [aquí](https://sqra.es/signupmes) para recibir credenciales de sandbox y empezar. | ||
|
||
If you are not a seQura merchant yet, you can sign up [here](https://sqra.es/signupmen) to get sandbox credentials and get started. | ||
|
||
## For developers | ||
|
||
### How to try the module | ||
The repository includes a docker-compose file to easily test the module. You can start the environment with the following command: | ||
|
||
```bash | ||
./setup.sh | ||
``` | ||
|
||
This will start a Magento 2 instance with the seQura module installed. You can access the admin panel at `http://localhost:8018/admin` with the credentials `admin`/`password123`. | ||
|
||
Once installed you could start/stop the magento instance with `docker compose up` and `docker compose down` commands. | ||
|
||
### Customizing the environment | ||
You could create you own .env file to customize the environment. You can copy the .env.example file and modify the values as needed. | ||
|
||
In order to use magento sample data you MUST set your credentials for https://repo.magento.com/ in you .env file at | ||
|
||
```bash | ||
COMPOSER_AUTH='{"http-basic":{"repo.magento.com":{"username":"<public-key>","password":"<private-key>"}}}' | ||
``` | ||
|
||
Otherwise you will get a warning message: | ||
> "warning": "You haven't provided your Magento authentication keys. For instructions, visit https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html" | ||
and the installation will fail. | ||
|
||
#### Other examples | ||
* You can customize the Magento version by setting the `MAGENTO_VERSION` environment variable. | ||
* You can customize the sequra/magento module version by setting the `SQ_M2_CORE_VERSION` environment variable. Leave it as local to use the local version of the module. | ||
* You can customize the host and ports by setting the `MAGENTO_HOST` and `MAGENTO_HTTP_PORT` environment variable. | ||
|
||
### Loading sample data | ||
You can load sample data with the following command: | ||
|
||
```bash | ||
./bin/install-sampledata | ||
``` | ||
|
||
or setting the `MAGENTO_SAMPLEDATA` environment variable to `yes` when before running the ./setup.sh script. | ||
|
||
|
||
> After installing sample data you may get 404 errors for http://${MAGENTO_HOST}/%7B%7BMEDIA_URL%7D%7Dstyles.css. | ||
> To fix this issue go to Content -> Design -> Configuration -> Edit your theme -> HTML Head -> Scripts and Style Sheets and change the line with `{{MEDIA_URL}}styles.css` to `media/styles.css` | ||
### Other helper scripts | ||
You can run commands in the Magento container with the following command: | ||
|
||
```bash | ||
./bin/magento <command> | ||
``` | ||
To run magento commands in the container. | ||
|
||
```bash | ||
./bin/composer <command> | ||
``` | ||
To run composer commands in the container. | ||
|
||
```bash | ||
./bin/mysql | ||
``` | ||
To open mysql terminal in the container. | ||
|
||
```bash | ||
./bin/shell | ||
``` | ||
To open a bash shell commands in the container. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
docker compose exec -u daemon -w /bitnami/magento magento php vendor/bin/composer $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
echo " Installing sample data..." | ||
docker compose exec -w /bitnami/magento magento bash -c "rm -rf var/di/* var/generation/*" | ||
docker compose exec -u daemon -w /bitnami/magento magento bin/magento sampledata:deploy | ||
docker compose exec -u daemon -w /bitnami/magento magento bin/magento setup:upgrade | ||
docker compose exec -u daemon -w /bitnami/magento magento bin/magento cache:clean | ||
docker compose exec -u daemon -w /bitnami/magento magento bin/magento cache:flush |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
docker compose exec -u daemon -w /bitnami/magento magento bin/magento $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
docker compose exec -u daemon -w /bitnami/magento magento bash -c \ | ||
"mysql -h \$MAGENTO_DATABASE_HOST -P \$MAGENTO_DATABASE_PORT_NUMBER -u \$MAGENTO_DATABASE_USER \$MAGENTO_DATABASE_NAME" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
docker compose exec -u daemon -w /bitnami/magento magento bash -c \ | ||
"[ ! -f 'vendor/bin/n98-magerun2' ] && vendor/bin/composer require n98/magerun2-dist" | ||
docker compose exec -u daemon -w /bitnami/magento magento vendor/bin/n98-magerun2 $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
if [ -z "$1" ]; then | ||
docker compose exec -u daemon -w /bitnami/magento magento bash | ||
else | ||
docker compose exec -u daemon -w /bitnami/magento magento bash -c "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
docker compose exec magento /docker-entrypoint-init.d/xdebug.sh |
Oops, something went wrong.