Skip to content

1. Getting started

Michel edited this page Feb 4, 2026 · 1 revision

If you are a merchant and want to install the app to your shop, you can find it here.

Quick start

  1. First setup devenv
  2. Clone the repository
    git clone https://github.com/shopware/braintree-app
  3. Install dependencies
    composer install
    npm install
  4. Start devenv
    devenv up
  5. Setup database, manifest and hardcoded urls
    composer setup
  6. Symlink correct directory into <shopware-root>/custom/apps
    ln -s "<braintree-root>/apps/<shopware-major>" "<shopware-root/custom/apps/SwagBraintreeApp"
  7. Install and activate the app
  8. Rebuild shopware's storefront js

Command reference

Instance control

  • composer setup: (Re-)create database, generate manifest.xml and replace hardcoded URLs
  • composer setup:manifest: Generate the manifest.xml for prod or dev depending on your APP_ENV
  • composer setup:url: Replace hardcoded URLs with for APP_URL in:
    • Resources/app/storefront/src/checkout/swag-braintree.hosted-fields.js
  • composer setup:test: (Re-)create test database
  • npm run dev: Build administration for development
  • npm run build: Build administration for production
  • npm run watch: Start administration hot reloading. Note that the admin needs to be refreshed once after starting this.

Testing and quality control

  • composer ecs-fix: Lint PHP files with php-cs-fixer
  • composer phpstan: Statically analyze PHP files
  • composer phpunit: Run PHPUnit tests
  • composer infection: Run infection for mutation testing
  • npm run eslint-fix: Lint JS/TS files
  • npm run tsc: Type check JS/TS files

Clone this wiki locally