Skip to content

Commit

Permalink
aaa this is all completely wrong, jwt needs to be generated in api ro…
Browse files Browse the repository at this point in the history
…ute and signed with private key from oauth :|
  • Loading branch information
NicholasG04 committed Mar 17, 2022
1 parent 372b96c commit d2b9dd6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/components/UserPanel/GooglePayBtn.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import SaveToGooglePay from '@google-pay/save-button-react';

interface Props {
ticketJwt: string;
}

const GooglePayBtn = ({ ticketJwt }: Props) => {
const jwt = {
ticketHolderName: 'Nick',
ticketNumber: 'ticketIdHere',
id: 'prom.ticketIdHere',
classId: 'prom.classIdHere',
state: 'ACTIVE',
barcode: {
type: 'QR_CODE',
value: ticketJwt,
alternateText: 'Nick - ticketId',
},
} as const;
return (
<SaveToGooglePay jwt={jwt} />
);
};

export default GooglePayBtn;
2 changes: 2 additions & 0 deletions src/components/UserPanel/HasTicket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Flex, Heading } from '@chakra-ui/react';
import { useTicket } from 'util/ticketContext';
import MoreInfo from './MoreInfo';
import QR from './QR';
import GooglePayBtn from './GooglePayBtn';

const HasTicket: React.FC = () => {
const { ticket } = useTicket();
Expand All @@ -10,6 +11,7 @@ const HasTicket: React.FC = () => {
<Flex direction="column" align="center" justify="center" m={5}>
<Heading as="h2" my={3}>Your Ticket</Heading>
<QR jwt={ticket.jwt} />
<GooglePayBtn ticketJwt={ticket.jwt} />
</Flex>
<MoreInfo />
</>
Expand Down

0 comments on commit d2b9dd6

Please sign in to comment.