storefront icon indicating copy to clipboard operation
storefront copied to clipboard

add: dummy payment provider

Open peelar opened this issue 2 years ago • 4 comments

Features:

  • pages/api/dummy-pay.ts - API endpoint for dummy payment (creates a transaction)
  • integrating the new payment method dummy into the existing structure (e.g. pages/api/pay.ts)
  • added checkout-storefront/src/views/DummyPayment.tsx view with a simple form that lets you pay either the entirety or a fraction of the order's total price
  • added the Views component in Root.tsx, as there are now three views that can be displayed: Checkout, OrderConfirmation, and DummyPayment. DummyPayment's URL is: host/checkout?order=:orderId&dummyPayment=true.

Media:

https://user-images.githubusercontent.com/44495184/193268382-4796058f-7378-4f9f-996a-3f5ccb047aca.mov

Questions:

  1. How do we restrict access to the dummy payment provider? Currently, it's turned on by default. Should we add an env var like IS_DUMMY_PROVIDER_ON set to false by default?

peelar avatar Sep 21 '22 10:09 peelar

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
react-storefront ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Oct 12, 2022 at 2:03PM (UTC)
saleor-app-checkout ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Oct 12, 2022 at 2:03PM (UTC)
saleor-checkout ✅ Ready (Inspect) Visit Preview Oct 12, 2022 at 2:03PM (UTC)
1 Ignored Deployment
Name Status Preview Comments Updated
saleor-checkout-ui-kit ⬜️ Ignored (Inspect) Oct 12, 2022 at 2:03PM (UTC)

vercel[bot] avatar Sep 21 '22 10:09 vercel[bot]

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 03 '22 11:10 CLAassistant

How do we restrict access to the dummy payment provider?

After a conversation with @witoszekdev, I think the best way would be to include the Dummy Payment in the Dashboard configuration UI (same as the rest of the payment providers). I will add it tomorrow.

peelar avatar Oct 03 '22 11:10 peelar

Added the ability to select the payment provider from the configuration. @witoszekdev @mmiszy

peelar avatar Oct 10 '22 08:10 peelar

@witoszekdev merged your suggestion & rebased. Please approve & merge if all is good.

peelar avatar Oct 12 '22 10:10 peelar

@mmiszy please merge if all is good

peelar avatar Oct 12 '22 18:10 peelar