sandipchandela / bigcommerce-php
The bigcommerce php based on PHP
1.0.1
2024-08-11 17:48 UTC
Requires
- php: ^8.2
- bigcommerce/api: ^3.3
- mongodb/mongodb: ^1.10
- psr/log: ^3.0
- symfony/console: ^6.0
- symfony/dotenv: ^6.0
Requires (Dev)
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2025-03-11 19:16:37 UTC
README
Overview
This is a basic BigCommerce app built with PHP 8.3 that handles installation, uninstallation, and various callbacks.
Prerequisites
- PHP 8.3
- Composer
- MongoDB or MySQL
- Ngrok (for local testing)
Setup
-
Clone the repository:
git clone https://github.com/sandipchandela/bigcommerce-php.git cd bigcommerce-php
-
Install dependencies:
composer install -vvv
-
Configure environment variables:
Create a .env file in the root directory with the following content:
APP_HOSTNAME=<your_ngrok_hostname> DB_URI=<your_mongo_db_uri> BC_CLIENT_SECRET=<your_bigcommerce_client_secret> SCOPES=store_v2_content,store_v2_information,store_v2_settings DB_HOST=localhost DB_NAME=bigc-app DB_USER=root DB_PASS="@)@$CatchMe123 BC_CLIENT_SECRET=<bigcommerce_client_secret>
- local server with Ngrok
ngrok http 80
Routes
- Auth Callback URL: /bigcommerce/install
- Load Callback URL: /bigcommerce/load
- Uninstall Callback URL: /bigcommerce/uninstall
- Webhook Listener URL: /bigcommerce/webhook
Testing
Run PHPUnit tests:
./vendor/bin/phpunit tests -vvv