Demo app making use of Stripe's API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
admin
images
.gitignore
README.md
composer.json
config.php
index.php
order.php
success.php

README.md

Simple personal marketplace with Stripe

Demo application using Stripe API in vanilla PHP.

Deployment

  • Install dependencies
composer install
  • Create Stripe API keys
  • Create a SQL database
  • Edit config.php accordingly
  • Create items table
CREATE TABLE `items` (
  `id` int(11) NOT NULL,
  `name` varchar(254) NOT NULL,
  `image` varchar(254) DEFAULT NULL,
  `description` text NOT NULL,
  `nb_remaining` int(11) NOT NULL,
  `price` int(11) NOT NULL
);

ALTER TABLE `items`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
  • Create sold table
CREATE TABLE `sold` (
`id` int(11) NOT NULL,
`user_email` varchar(254) NOT NULL,
`item_id` int(11) NOT NULL,
`number` int(11) NOT NULL,
`delivered` tinyint(1) DEFAULT NULL
);

ALTER TABLE `sold`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `sold`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
  • Forbid access to the admin directory (with .htpasswd)

Usage

  • Add products in admin