Add a QR code for PayPal subscriptions on Home

This commit is contained in:
2021-08-18 20:40:11 +00:00
parent 17da308f37
commit d7101195ca
5 changed files with 57 additions and 4 deletions
+29
View File
@@ -1,4 +1,6 @@
import React, { useState, useEffect, useReducer } from 'react';
import { useLocation } from 'react-router-dom';
import { Button, Container, Divider, Dropdown, Form, Grid, Header, Icon, Image, Input, Item, Menu, Message, Segment, Table } from 'semantic-ui-react';
export function PayPalPayNow(props) {
const { amount, custom, name } = props;
@@ -77,3 +79,30 @@ export function PayPalSubscribeDeal(props) {
</div>
);
}
export function Subscribe(props) {
const qs = useLocation().search;
const params = new URLSearchParams(qs);
const monthly_fees = params.get('monthly_fees') || false;
const id = params.get('id') || false;
return (
<Container>
<Header size='large'>Create a PayPal Subscription</Header>
<p>Use this page to set up a Protospace membership subscription.</p>
{monthly_fees && id ?
<PayPalSubscribeDeal
amount={monthly_fees}
name='Protospace Membership'
custom={JSON.stringify({ deal: 3, member: id })}
/>
:
<p>Error, invalid subscribe link.</p>
}
<p>Click "Checkout as Guest" if you don't have a PayPal account.</p>
</Container>
);
}