Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update examples to v2 #165

Merged
merged 4 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,20 @@ Partial refunds are also supported.

# Examples

The [`examples`](https://github.com/a11rew/medusa-payment-paystack/blob/main/examples) directory contains a simple Medusa server with the Paystack plugin installed and configured.
The [`examples`](https://github.com/a11rew/medusa-payment-paystack/blob/main/examples) directory contains an example Medusa installation with the Paystack plugin installed and configured. The backend can be found in the [`backend`](https://github.com/a11rew/medusa-payment-paystack/blob/main/examples/backend) directory and the storefront can be found in the [`storefront`](https://github.com/a11rew/medusa-payment-paystack/blob/main/examples/storefront) directory.

It also contains a storefront built with Next.js that uses the inline-js Paystack library to complete the payment flow.
The storefront is built with Next.js and uses the inline-js Paystack library to complete the payment flow.

The examples are the default Medusa V2 storefront and backend starters. View all the changes made to the examples to add Paystack support in this commit: [feat: add paystack payment support](https://github.com/a11rew/medusa-payment-paystack/commit/3782286cb5693df1511d24bdaa2440efe6e747c5).

# V1

The [`v1` branch](https://github.com/a11rew/medusa-payment-paystack/tree/v1) contains the original version of this plugin with support for Medusa V1. The example storefront and backend for the v1 version can also be found in the [examples directory](https://github.com/a11rew/medusa-payment-paystack/tree/v1/examples) of the `v1` branch.

It can be installed from npm using the `1` version tag:

```bash
yarn add medusa-payment-paystack@1
```

The `v1` branch is no longer maintained and is only kept for reference.
12 changes: 0 additions & 12 deletions examples/backend/.babelrc.js

This file was deleted.

16 changes: 9 additions & 7 deletions examples/backend/.env.template
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
JWT_SECRET=something
COOKIE_SECRET=something

DATABASE_TYPE="postgres"
STORE_CORS=http://localhost:8000,https://docs.medusajs.com
ADMIN_CORS=http://localhost:5173,http://localhost:9000,https://docs.medusajs.com
AUTH_CORS=http://localhost:5173,http://localhost:9000,https://docs.medusajs.com
REDIS_URL=redis://localhost:6379

# Your Paystack secret key. See – https://support.paystack.com/hc/en-us/articles/360009881600-Paystack-Test-Keys-Live-Keys-and-Webhooks
PAYSTACK_SECRET_KEY=sk_something
JWT_SECRET=supersecret
COOKIE_SECRET=supersecret
DATABASE_URL=
DB_NAME=medusa-v2
POSTGRES_URL=
PAYSTACK_SECRET_KEY=
Empty file added examples/backend/.env.test
Empty file.
21 changes: 0 additions & 21 deletions examples/backend/.github/dependabot.yml

This file was deleted.

3 changes: 2 additions & 1 deletion examples/backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ coverage
!src/**

./tsconfig.tsbuildinfo
package-lock.json
medusa-db.sql
build
.cache
Expand All @@ -23,3 +22,5 @@ build
!.yarn/releases
!.yarn/sdks
!.yarn/versions

.medusa
22 changes: 5 additions & 17 deletions examples/backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</a>
</p>
<h1 align="center">
Medusa Paystack Backend Example
Medusa
</h1>

<h4 align="center">
Expand All @@ -34,31 +34,19 @@

## Compatibility

This starter is compatible with versions >= 1.8.0 of `@medusajs/medusa`.
This starter is compatible with versions >= 1.8.0 of `@medusajs/medusa`.

## Getting Started

Visit the [Docs](https://docs.medusajs.com/development/backend/prepare-environment) to learn more about Medusa system requirements.
Visit the [Quickstart Guide](https://docs.medusajs.com/learn) to set up a server.

Visit the [Quickstart Guide](https://docs.medusajs.com/create-medusa-app) to set up the server.

Add your Paystack API keys to the `.env` file.

```bash
PAYSTACK_SECRET_KEY=your_secret_key
```

Run the seed command to seed the database with sample data (optional)

```bash
yarn seed
```
Visit the [Docs](https://docs.medusajs.com/learn#get-started) to learn more about our system requirements.

## What is Medusa

Medusa is a set of commerce modules and tools that allow you to build rich, reliable, and performant commerce applications without reinventing core commerce logic. The modules can be customized and used to build advanced ecommerce stores, marketplaces, or any product that needs foundational commerce primitives. All modules are open-source and freely available on npm.

Learn more about [Medusa’s architecture](https://docs.medusajs.com/development/fundamentals/architecture-overview) and [commerce modules](https://docs.medusajs.com/modules/overview) in the Docs.
Learn more about [Medusa’s architecture](https://docs.medusajs.com/learn/advanced-development/architecture/overview) and [commerce modules](https://docs.medusajs.com/learn/basics/commerce-modules) in the Docs.

## Roadmap, Upgrades & Plugins

Expand Down
186 changes: 0 additions & 186 deletions examples/backend/data/seed.json

This file was deleted.

50 changes: 0 additions & 50 deletions examples/backend/index.js

This file was deleted.

Loading
Loading