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

add: dummy payment provider #484

Merged
merged 19 commits into from
Oct 14, 2022
Merged

add: dummy payment provider #484

merged 19 commits into from
Oct 14, 2022

Conversation

peelar
Copy link
Member

@peelar peelar commented Sep 21, 2022

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:

Nagranie.z.ekranu.2022-09-30.o.14.19.20.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 peelar self-assigned this Sep 21, 2022
@vercel
Copy link

vercel bot commented Sep 21, 2022

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)

@CLAassistant
Copy link

CLAassistant commented Oct 3, 2022

CLA assistant check
All committers have signed the CLA.

@peelar
Copy link
Member Author

peelar commented Oct 3, 2022

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.

apps/saleor-app-checkout/pages/api/dummy-pay.ts Outdated Show resolved Hide resolved
packages/checkout-storefront/src/pages/Root.tsx Outdated Show resolved Hide resolved
Comment on lines +35 to 38
dummy: {
dummyKey: "",
},
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to have this config? It looks like it's not used anywhere 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is due to the way the types are defined. I didn't find any easy way to change it, and I didn't want to change it drastically.

@peelar peelar force-pushed the feat/dummy-payment-provider branch from 80ab2e0 to 1cde27a Compare October 12, 2022 10:02
@peelar
Copy link
Member Author

peelar commented Oct 12, 2022

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

@peelar
Copy link
Member Author

peelar commented Oct 12, 2022

@mmiszy please merge if all is good

@typeofweb typeofweb merged commit 755b7be into canary Oct 14, 2022
@typeofweb typeofweb deleted the feat/dummy-payment-provider branch October 14, 2022 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants