-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from manishkatyan/package-update
New : added new 3 payment
- Loading branch information
Showing
17 changed files
with
300 additions
and
89 deletions.
There are no files selected for viewing
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
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,54 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Box } from '@strapi/design-system/Box'; | ||
import { Grid, GridItem } from '@strapi/design-system/Grid'; | ||
import { Typography } from '@strapi/design-system/Typography'; | ||
|
||
const Banner = ({ leftChild, rightChild, leftChildCol, rightChildCol, header, isHeader }) => { | ||
return ( | ||
<Box | ||
shadow="tableShadow" | ||
background="neutral0" | ||
paddingTop={6} | ||
paddingLeft={7} | ||
paddingRight={7} | ||
paddingBottom={6} | ||
hasRadius | ||
> | ||
{isHeader ? ( | ||
<Box paddingBottom={2}> | ||
<Typography variant="delta">{header}</Typography> | ||
</Box> | ||
) : null} | ||
|
||
<Box paddingTop={2}> | ||
<Grid gap={4}> | ||
<GridItem col={leftChildCol} s={12}> | ||
{leftChild} | ||
</GridItem> | ||
<GridItem col={rightChildCol} s={12}> | ||
{rightChild} | ||
</GridItem> | ||
</Grid> | ||
</Box> | ||
</Box> | ||
); | ||
}; | ||
|
||
// Props validation | ||
Banner.propTypes = { | ||
leftChild: PropTypes.node.isRequired, | ||
rightChild: PropTypes.node.isRequired, | ||
leftChildCol: PropTypes.number.isRequired, | ||
rightChildCol: PropTypes.number.isRequired, | ||
header: PropTypes.string, | ||
isHeader: PropTypes.bool, | ||
}; | ||
|
||
// Default props | ||
Banner.defaultProps = { | ||
header: '', | ||
isHeader: false, | ||
}; | ||
|
||
export default Banner; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ import { Switch } from '@strapi/design-system/Switch'; | |
import { Flex } from '@strapi/design-system/Flex'; | ||
import currencies from './constant'; | ||
import { saveStripeConfiguration, getStripeConfiguration } from '../../utils/apiCalls'; | ||
import Banner from './banner'; | ||
|
||
const Configuration = () => { | ||
const [stripeConfiguration, setStripeConfiguration] = useState({ | ||
|
@@ -35,6 +36,7 @@ const Configuration = () => { | |
checkoutCancelUrl: '', | ||
currency: undefined, | ||
callbackUrl: '', | ||
paymentMethods: ['card'], | ||
}); | ||
|
||
const [showAlert, setShowAlert] = useState(false); | ||
|
@@ -49,7 +51,7 @@ const Configuration = () => { | |
checkoutCancelUrl: '', | ||
currency: '', | ||
}); | ||
console.log('stripe configuration', stripeConfiguration); | ||
|
||
useEffect(() => { | ||
(async () => { | ||
const response = await getStripeConfiguration(); | ||
|
@@ -65,6 +67,7 @@ const Configuration = () => { | |
checkoutCancelUrl, | ||
currency, | ||
callbackUrl, | ||
paymentMethods, | ||
} = response.data.response; | ||
setStripeConfiguration({ | ||
...stripeConfiguration, | ||
|
@@ -77,6 +80,7 @@ const Configuration = () => { | |
checkoutCancelUrl, | ||
currency, | ||
callbackUrl, | ||
paymentMethods, | ||
}); | ||
} | ||
})(); | ||
|
@@ -394,61 +398,108 @@ const Configuration = () => { | |
/> | ||
</Box> | ||
</GridItem> | ||
</Grid> | ||
</Box> | ||
</Box> | ||
<br /> | ||
<Box | ||
shadow="tableShadow" | ||
background="neutral0" | ||
paddingTop={6} | ||
paddingLeft={7} | ||
paddingRight={7} | ||
paddingBottom={6} | ||
hasRadius | ||
> | ||
<Box paddingBottom={2}> | ||
<Typography variant="delta">Email Settings</Typography> | ||
</Box> | ||
|
||
<Box paddingTop={2}> | ||
<Grid gap={4}> | ||
<GridItem col={6} s={12}> | ||
<Link | ||
href="https://support.stripe.com/questions/set-up-account-email-notifications" | ||
isExternal | ||
<Select | ||
id="paymentMethod" | ||
label="Choose Payment Methods" | ||
onClear={() => | ||
setStripeConfiguration({ ...stripeConfiguration, paymentMethods: [] }) | ||
} | ||
value={ | ||
stripeConfiguration.paymentMethods ? stripeConfiguration.paymentMethods : [] | ||
} | ||
onChange={values => | ||
setStripeConfiguration({ ...stripeConfiguration, paymentMethods: values }) | ||
} | ||
multi | ||
withTags | ||
> | ||
Setup seller notification | ||
</Link> | ||
</GridItem> | ||
<GridItem col={6} s={12}> | ||
<Link href=" https://stripe.com/docs/receipts" isExternal> | ||
Setup buyer notification | ||
</Link> | ||
<Option value="card">Credit Card/Debit Card</Option> | ||
<Option value="sepa_debit"> SEPA Direct Debit</Option> | ||
<Option value="us_bank_account">ACH Direct Debit</Option> | ||
<Option value="alipay">Alipay</Option> | ||
<Option value="klarna">Klarna</Option> | ||
<Option value="ideal">iDEAL</Option> | ||
<Option value="sofort">SOFORT</Option> | ||
</Select> | ||
</GridItem> | ||
</Grid> | ||
</Box> | ||
</Box> | ||
<br /> | ||
<Box | ||
shadow="tableShadow" | ||
background="neutral0" | ||
paddingTop={6} | ||
paddingLeft={7} | ||
paddingRight={7} | ||
paddingBottom={6} | ||
hasRadius | ||
> | ||
<Box paddingTop={2}> | ||
<Grid gap={4}> | ||
<GridItem col={6} s={12}> | ||
<Typography variant="pi"> | ||
Need help? Contact us at : [email protected] | ||
</Typography> | ||
</GridItem> | ||
</Grid> | ||
</Box> | ||
</Box> | ||
<Banner | ||
leftChild={ | ||
<Link | ||
href="https://support.stripe.com/questions/set-up-account-email-notifications" | ||
isExternal | ||
> | ||
Setup seller notification | ||
</Link> | ||
} | ||
rightChild={ | ||
<Link href=" https://stripe.com/docs/receipts" isExternal> | ||
Setup buyer notification | ||
</Link> | ||
} | ||
rightChildCol={6} | ||
leftChildCol={6} | ||
header="Email Settings" | ||
isHeader | ||
/> | ||
|
||
<br /> | ||
|
||
<Banner | ||
leftChild={ | ||
<img | ||
src="https://res.cloudinary.com/dvotpztje/image/upload/v1671441868/paypal-logo_tifrf5.webp" | ||
alt="paypal" | ||
height={25} | ||
width={80} | ||
/> | ||
} | ||
rightChild={ | ||
<Typography variant="omega" fontWeight="bold"> | ||
Want to use Paypal?{' '} | ||
<a | ||
href="https://market.strapi.io/plugins/strapi-paypal" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Download our free plugin | ||
</a> | ||
. | ||
</Typography> | ||
} | ||
leftChildCol={2} | ||
rightChildCol={10} | ||
/> | ||
<br /> | ||
<Banner | ||
leftChild={ | ||
<img | ||
src="https://higheredlab.com/wp-content/uploads/hel_icon.png" | ||
alt="hel-logo" | ||
height={30} | ||
width={50} | ||
/> | ||
} | ||
rightChild={ | ||
<Typography variant="omega" fontWeight="bold"> | ||
Facing technical issues?{' '} | ||
<a | ||
href="https://github.com/manishkatyan/strapi-stripe/issues" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Raise an issue on Github | ||
</a> | ||
or email at [email protected] | ||
</Typography> | ||
} | ||
leftChildCol={2} | ||
rightChildCol={10} | ||
/> | ||
</ContentLayout> | ||
</Main> | ||
); | ||
|
Oops, something went wrong.