This is the code for 4242.io, the website where I keep all my Stripe developer resources.
Pull requests and bug reports are welcome!
- Fetch or download the repo
- Go into the root directory of this repo
- Run
composer installto install dependencies - Make a copy of
secrets-EXAMPLE.iniand name itsecrets.ini - Fill in the required values in
secrets.ini - Perform a find and replace across the entire project for my Stripe publishable keys and replace them with your own:
- Stripe US Account:
pk_test_51O2hxMC4JnNRtz8VToJJbGHrFTPPr6TkP09h7ql3YJaqpNcxoSNxtk38glyzi9VrZKStns858YynOO2ZyGmU7VRi00CIUWuUdk - Stripe GB Account:
pk_test_51O2zNKCHlokEYlHRvTSxtf7Xhv6hVRBfnMObfmlxgPhtT5rGvfzSPIT11kQ3KdXQn1bxZASNYZ2RKaYuYLFjeuM400bjPRpvrM
- Stripe US Account:
- Run
php -S localhost:4242 -t public/to start PHP's built-in web server - Go to https://localhost:4242 in your browser and make sure everything works as expected
To create a new test integration:
- Duplicate the
public/test/_templatedirectory and it's contents - Rename
_templateas appropriate (see the other directories inpublic/testfor inspiration) - Modify the files inside your new directory
- Test it out locally
The web server should be configured to use public/404/ to handle not found errors. There's already an .htaccess included with the following for Apache:
ErrorDocument 404 /404/
The PHP script in the public/404/ directory will then take appropriate action, including redirecting from old URLs to new ones as needed, or will display a "not found" page.
When I push to this GitHub repo a webhook is sent to public/deploy.php which, in turn, runs commands on the server to pull main and do some other housekeeping. See public/deploy.php for more information.