-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating stripe integration and updating our favicon and title
- Loading branch information
Karthick-Ramanathan
committed
Jul 27, 2020
1 parent
28cc81a
commit 9dce248
Showing
8 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/components/stripe-checkout-button/stripe-checkout-button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react' | ||
import StripeCheckout, { Token } from 'react-stripe-checkout' | ||
|
||
type StripeCheckoutButtonProps = { | ||
price: number | ||
} | ||
|
||
const StripeCheckoutButton = ({ price }: StripeCheckoutButtonProps) => { | ||
|
||
const priceForStripe = price * 100 | ||
const publishableKey = 'pk_test_51H9TzAIBCK5SdsgKA9KjlcoAlZ0brByReiPX4fuVmhe4lr2CMzfV4KbFFdLC48GStZtg9y28SS5GOnKsWZ8HBrTf00MCc54e0O' | ||
|
||
const onToken = (token: Token) => { | ||
console.log(token) | ||
alert('Payment Successful') | ||
} | ||
|
||
return ( | ||
<StripeCheckout | ||
label='Pay Now' | ||
name='E-Commerce POC' | ||
billingAddress | ||
shippingAddress | ||
image='https://svgshare.com/i/CUz.svg' | ||
currency='INR' | ||
description={`Your total is ₹ ${price}`} | ||
amount={priceForStripe} | ||
panelLabel='Pay Now' | ||
token={onToken} | ||
stripeKey={publishableKey} | ||
/> | ||
) | ||
} | ||
|
||
export default StripeCheckoutButton |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters