Skip to content

anktd/BlockonomicsSyliusPlugin

Repository files navigation

Progress so far

Installation

composer install
cd tests/application
php bin/console sylius:install
yarn install
yarn build
symfony start

Adding Blockonomics payment method

  • Todo: translations

image

Blockonomics gateway form

Todo:

  • Translations
  • Update callback url to correct url
  • Action to submit form

image

Added Blockonomics payment gateway on Admin

image

Customer selects Blockonomics

Todo:

  • Potentially add blockonomics icon in the bottom right corner?

image

Payment screen

Already working:

  • QR code generation
  • BTC address fetch
  • BTC price fetch
  • BTC price refresh every 10 min or on button click
  • Copy to clipboard for BTC address and amount

Todo:

  • Implement action on WS receiving unconfirmed payment
  • Improve UI

image

Post Payment screen

image

  • Add routes that can accept the callback
  • Test to make sure the order status is updated correctly
  • Add information about order (e.g. txid) instead of warning

Admin view of order

Todo:

  • Add Bitcoin icon instead of card icon next to Blockonomics?
  • Create callback that can mark payment as complete image

The below should to be updated when the Blockonomoics plugin works end to end

Plugin Skeleton

Skeleton for starting Sylius plugins.

Documentation

For a comprehensive guide on Sylius Plugins development please go to Sylius documentation, there you will find the Plugin Development Guide, that is full of examples.

Quickstart Installation

Traditional

  1. Run composer create-project blocknomics/blockonomics-plugin ProjectName.

  2. From the plugin skeleton root directory, run the following commands:

    $ (cd tests/Application && yarn install)
    $ (cd tests/Application && yarn build)
    $ (cd tests/Application && APP_ENV=test bin/console assets:install public)
    
    $ (cd tests/Application && APP_ENV=test bin/console doctrine:database:create)
    $ (cd tests/Application && APP_ENV=test bin/console doctrine:schema:create)

To be able to set up a plugin's database, remember to configure you database credentials in tests/Application/.env and tests/Application/.env.test.

Docker

  1. Execute docker compose up -d

  2. Initialize plugin docker compose exec app make init

  3. See your browser open localhost

Usage

Running plugin tests

  • PHPUnit

    vendor/bin/phpunit
  • PHPSpec

    vendor/bin/phpspec run
  • Behat (non-JS scenarios)

    vendor/bin/behat --strict --tags="~@javascript"
  • Behat (JS scenarios)

    1. Install Symfony CLI command.

    2. Start Headless Chrome:

    google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1
    1. Install SSL certificates (only once needed) and run test application's webserver on 127.0.0.1:8080:
    symfony server:ca:install
    APP_ENV=test symfony server:start --port=8080 --dir=tests/Application/public --daemon
    1. Run Behat:
    vendor/bin/behat --strict --tags="@javascript"
  • Static Analysis

    • Psalm

      vendor/bin/psalm
    • PHPStan

      vendor/bin/phpstan analyse -c phpstan.neon -l max src/  
  • Coding Standard

    vendor/bin/ecs check

Opening Sylius with your plugin

  • Using test environment:

    (cd tests/Application && APP_ENV=test bin/console sylius:fixtures:load)
    (cd tests/Application && APP_ENV=test bin/console server:run -d public)
  • Using dev environment:

    (cd tests/Application && APP_ENV=dev bin/console sylius:fixtures:load)
    (cd tests/Application && APP_ENV=dev bin/console server:run -d public)

About

Accept Bitcoin payments on Sylius

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published