Skip to content

Commit

Permalink
Merge pull request #63 from manishkatyan/package-update
Browse files Browse the repository at this point in the history
New : added new 3 payment
  • Loading branch information
nishekh-e-r authored Dec 19, 2022
2 parents 6154888 + a40adf4 commit ce5b173
Show file tree
Hide file tree
Showing 17 changed files with 300 additions and 89 deletions.
1 change: 1 addition & 0 deletions .eslintrc.back.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ module.exports = {
'node/no-callback-literal': 'error',
'node/handle-callback-err': 'error',
'one-var': ['error', 'never'],
'node/no-extraneous-require': 'off',
},
};
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</div>
<h1 align="center">Stripe Payments</h1>
<p align="center">Online payments and subscriptions made simple, secure and fast.</p>
<p align="center">This free plugin enables you to accept online payments and create subscriptions using Credit Card, Apple pay and Google pay on your Strapi app via Stripe.</p>
<p align="center">This free plugin enables you to accept online payments and create subscriptions using Credit and Debit Cards, SEPA Direct Debit, ACH Direct Debit, AliPay, Apple pay and Google pay on your Strapi app via Stripe.</p>

<br />

Expand All @@ -21,7 +21,7 @@

<br>

<img style="width: 100%; height: auto;" src="https://higheredlab.com/wp-content/uploads/strapi-stripe_payment.gif" alt="strapi-stripe-payment" /> <br/>
<img style="width: 100%; height: auto;" src="/static/strapi-stripe-payment.gif" alt="strapi-stripe-payment" /> <br/>

<br/><br/>

Expand Down Expand Up @@ -50,16 +50,16 @@ That's all you need to do to turn your Strapi website or application into an e-c

## ✨ Features

1. Quick installation and setup.
1. Easily accept online payment for any products (or services) you want to sell on your Strapi site.
1. Automatically creates payment buttons for you to embed anywhere on your site.
1. Add multiple “Buy Now” payment buttons on a page.
1. View transaction details for all your products from your Strapi admin dashboard.
1. Specify a custom name, image and description for a product.
1. Setup email notification to the buyer and seller (aka you) after the purchase.
1. Customize the message on the checkout result page.
1. Configure the currency type for the payment.
1. Run in test mode for debudding
1. Accept payments via Credit and Debit Cards, SEPA Direct Debit, ACH Direct Debit, AliPay, Apple pay and Google pay.
2. Request one-time payments or create subscriotions on your Strapi application.
3. Quick installation and setup. Run in test mode for debugging.
4. Automatically creates payment buttons for you to embed anywhere on your site.
5. Add multiple “Buy Now” payment buttons on a page.
6. View transaction details for all your products from your Strapi admin dashboard.
7. Specify a custom name, image and description for a product.
8. Setup email notification to the buyer and seller (aka you) after the purchase.
9. Customize the message on the checkout page
10. Configure multiple currencies

<br/><br/>

Expand All @@ -78,7 +78,7 @@ We are following the [official Node.js releases timelines](https://nodejs.org/en

**Supported Strapi versions**:

- Strapi v4.5.0 (recently tested)
- Strapi v4.5.3 (recently tested)

- Strapi v4.x

Expand Down
54 changes: 54 additions & 0 deletions admin/src/components/Configuration/banner.js
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;
4 changes: 4 additions & 0 deletions admin/src/components/Configuration/constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ const currencies = [
label: 'COP - Colombian Peso',
value: 'cop',
},
{
label: 'CNY - Chinese Yuan',
value: 'cny',
},
{
label: 'EGP - Egyptian Pound',
value: 'egp',
Expand Down
149 changes: 100 additions & 49 deletions admin/src/components/Configuration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -35,6 +36,7 @@ const Configuration = () => {
checkoutCancelUrl: '',
currency: undefined,
callbackUrl: '',
paymentMethods: ['card'],
});

const [showAlert, setShowAlert] = useState(false);
Expand All @@ -49,7 +51,7 @@ const Configuration = () => {
checkoutCancelUrl: '',
currency: '',
});
console.log('stripe configuration', stripeConfiguration);

useEffect(() => {
(async () => {
const response = await getStripeConfiguration();
Expand All @@ -65,6 +67,7 @@ const Configuration = () => {
checkoutCancelUrl,
currency,
callbackUrl,
paymentMethods,
} = response.data.response;
setStripeConfiguration({
...stripeConfiguration,
Expand All @@ -77,6 +80,7 @@ const Configuration = () => {
checkoutCancelUrl,
currency,
callbackUrl,
paymentMethods,
});
}
})();
Expand Down Expand Up @@ -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>
&nbsp;or email at [email protected]
</Typography>
}
leftChildCol={2}
rightChildCol={10}
/>
</ContentLayout>
</Main>
);
Expand Down
Loading

0 comments on commit ce5b173

Please sign in to comment.