diff --git a/.prettierrc b/.prettierrc
index d9f988f..781e200 100644
--- a/.prettierrc
+++ b/.prettierrc
@@ -6,5 +6,6 @@
"semi": false,
"singleQuote": true,
"tabWidth": 2,
- "trailingComma": "all"
-}
+ "trailingComma": "all",
+ "useTabs": false
+}
\ No newline at end of file
diff --git a/components/AcceptPayments/index.tsx b/components/AcceptPayments/index.tsx
index 6362d78..2b11f53 100644
--- a/components/AcceptPayments/index.tsx
+++ b/components/AcceptPayments/index.tsx
@@ -1,24 +1,57 @@
-import classNames from "classnames";
-import CodeBlock from "components/CodeBlock";
-import LzButton from "components/UI/button";
-import Styles from './index.module.scss';
+import classNames from 'classnames'
+import CodeBlock from 'components/CodeBlock'
+import LzButton from 'components/UI/button'
+import LzLink from 'components/UI/link'
+import Styles from './index.module.scss'
+import { DataProp, ItemType, RequestData } from 'components/CodeBlock/types'
export default function AcceptPayments(): JSX.Element {
-
- return (
- Authenticate all Lazerpay API calls using your secret keys.
+ Authenticate all Lazerpay API calls using your secret keys.
+ To get started
- To get started
+
-
-
- {codeSnippet}
-
-
+ const codeBg = (): string => {
+ return type === 'response' ? 'response' : 'default'
+ }
+
+ const hasResponseData = () => {
+ if (!item) return false
+ const hasKey = 'responseData' in item
+ const hasName = Array.isArray((item as RequestData).responseData?.name)
+ return hasKey && hasName
+ }
+
+ useEffect(() => {
+ if (typeof window !== undefined) {
+ Prism.highlightAll()
+ }
+ }, [codeSnippet])
+
+ return (
+
+
+ {type === 'tab' && (
+ onCodeSwitch(i, item as ItemType)}
+ />
+ )}
+ {type === 'request' && (
+ setShowResponse(state)}
+ {...(item as RequestData)}
+ onChange={(i: number) =>
+ onCodeSwitch(i, (item as RequestData).requestData)
+ }
+ />
+ )}
+ {type === 'response' && (
+ onCodeSwitch(i, item as ItemType)}
+ />
+ )}
+
+
+
+
+
+
+ {codeSnippet}
+
- )
+
+ {type === 'request' && hasResponseData() && showResponse && (
+
+
+
+ )}
+
+ )
}
+
+export default CodeBlock
diff --git a/components/CodeBlock/types.d.ts b/components/CodeBlock/types.d.ts
new file mode 100644
index 0000000..ae7eb93
--- /dev/null
+++ b/components/CodeBlock/types.d.ts
@@ -0,0 +1,21 @@
+export type ItemType = {
+ name: string[];
+ snippet: string[];
+ lang: string[];
+}
+
+export type RequestType = ItemType;
+
+export type RequestData = {
+ method?: 'POST' | 'GET';
+ requestData: RequestType;
+ responseData?: ItemType;
+ showResponse?: boolean;
+ toggleResponse?: (boolean) => void;
+ onChange?: (i: number) => void;
+}
+
+export type DataProp = {
+ type: 'tab' | 'request' | 'response',
+ item: ItemType | RequestData
+}
\ No newline at end of file
diff --git a/components/Connect/data.tsx b/components/Connect/data.tsx
index 643c2b2..1a135c7 100644
--- a/components/Connect/data.tsx
+++ b/components/Connect/data.tsx
@@ -1,35 +1,44 @@
-import { CommunityIcon, NewsPaperIcon, SupportIcon } from "public/icons";
-import React from "react"
+import { CommunityIcon, NewsPaperIcon, SupportIcon } from 'public/icons'
+import React from 'react'
export interface IChannel {
- icon: React.ReactNode
- title: string
- options: { title: string; link: string }[]
+ icon: React.ReactNode
+ title: string
+ options: { title: string; link: string }[]
}
-export const channels:IChannel[] = [
- {
- icon: ,
- title: 'News',
- options: [
- {title: 'Developer Newsletter', link: ''},
- {title: 'Tech blog', link: ''},
- ]
- },
- {
- icon: ,
- title: 'Social',
- options: [
- {title: 'Slack', link: ''},
- {title: 'Developer Twitter', link: ''},
- ]
- },
- {
- icon: ,
- title: 'Help',
- options: [
- {title: 'Slack', link: ''},
- {title: 'FAQs', link: ''},
- ]
- }
-]
\ No newline at end of file
+export const channels: IChannel[] = [
+ {
+ icon: ,
+ title: 'News',
+ options: [
+ { title: 'Blog', link: 'https://lazerpay.finance/blog/' },
+ { title: 'Telegram channel', link: 'https://t.me/lazerpay' },
+ { title: 'Lazerpay Github', link: 'https://github.com/LazerPay-Finance' },
+ ],
+ },
+ {
+ icon: ,
+ title: 'Social',
+ options: [
+ { title: 'Twitter', link: 'https://twitter.com/lazerpay' },
+ {
+ title: 'Youtube',
+ link: 'https://www.youtube.com/channel/UC4vVYSFK--pbguoqsuuNowQ',
+ },
+ { title: 'Instagram', link: 'https://www.instagram.com/lazerpay/' },
+ {
+ title: 'Developer Slack',
+ link: 'https://join.slack.com/t/lazerpay/shared_invite/zt-1gw00chsy-ql5C2aQww6xidhAtpXZm9w',
+ },
+ ],
+ },
+ {
+ icon: ,
+ title: 'Help',
+ options: [
+ { title: 'Forums', link: 'https://forum.lazerpay.finance/' },
+ { title: 'Support email', link: 'mailto:support@lazerpay.finance' },
+ ],
+ },
+]
diff --git a/components/Connect/index.tsx b/components/Connect/index.tsx
index ff243af..21b6b18 100644
--- a/components/Connect/index.tsx
+++ b/components/Connect/index.tsx
@@ -1,24 +1,33 @@
-import LzLink from "components/UI/link";
-import { channels } from "./data";
+import LzLink from 'components/UI/link'
+import { channels } from './data'
export default function ConnectCommunity(): JSX.Element {
- return (
-
- {
- channels.map((c: any) => (
-
-
- {c.icon}
-
-
- {c.title}
-
- {c.options.map((o) => {o.title} )}
-
-
-
- ))
- }
+ return (
+
+ {channels.map((c: any) => (
+
+
+ {c.icon}
+
+
+ {c.title}
+
+ {c.options.map((o) => (
+
+ {o.title}
+
+ ))}
+
+
- )
-}
\ No newline at end of file
+ ))}
+
+ )
+}
diff --git a/components/Footer/data.ts b/components/Footer/data.ts
index 4f5001f..085995d 100644
--- a/components/Footer/data.ts
+++ b/components/Footer/data.ts
@@ -1,23 +1,23 @@
export const footerData = {
Lazerpay: [
- { title: 'About', route: 'about' },
+ { title: 'About', route: 'https://lazerpay.finance/about' },
{ title: 'Products', route: 'products' },
- { title: 'Pricing', route: 'pricing' },
- { title: 'Careers', route: 'careers' },
+ { title: 'Pricing', route: 'https://lazerpay.finance/pricing' },
+ { title: 'Careers', route: 'https://lazerpay.finance/careers' },
],
Resources: [
- { title: 'Docs', route: 'about' },
- { title: 'API Reference', route: 'products' },
- { title: 'API Explorer', route: 'pricing' },
- { title: 'SDK Reference', route: 'careers' },
- { title: 'Sample Apps', route: 'careers' },
+ { title: 'Docs', route: '/' },
+ { title: 'API Reference', route: 'https://documenter.getpostman.com/view/20216295/2s7ZE7L42K' },
+ // { title: 'API Explorer', route: 'pricing' },
+ { title: 'SDK Reference', route: 'libraries/libraries' },
+ // { title: 'Sample Apps', route: 'careers' },
],
Support: [
- { title: 'Developer Forum', route: 'about' },
- { title: 'Contact Support', route: 'products' },
- { title: 'Tech Blog', route: 'pricing' },
- { title: 'Slack Community', route: 'careers' },
- { title: 'Youtube', route: 'careers' },
- { title: 'Twitter', route: 'careers' },
+ { title: 'Developer Forum', route: 'https://forum.lazerpay.finance/' },
+ { title: 'Contact Support', route: 'mailto:support@lazerpay.finance' },
+ { title: 'Tech Blog', route: 'https://lazerpay.finance/blog/' },
+ { title: 'Slack Community', route: 'https://join.slack.com/t/lazerpay/shared_invite/zt-1gw00chsy-ql5C2aQww6xidhAtpXZm9w' },
+ { title: 'Youtube', route: 'https://www.youtube.com/channel/UC4vVYSFK--pbguoqsuuNowQ' },
+ { title: 'Twitter', route: 'https://twitter.com/lazerpay' },
]
};
\ No newline at end of file
diff --git a/components/GetstartedCard/data.ts b/components/GetstartedCard/data.ts
index 0b37f1b..d114c51 100644
--- a/components/GetstartedCard/data.ts
+++ b/components/GetstartedCard/data.ts
@@ -7,13 +7,13 @@ export interface CardWithImage {
export const startIntegratingData: CardWithImage[] = [
{
title: 'Accept Payments',
- desc: 'Let your customers pay using our support payment system',
- route: 'accept-payments',
+ desc: 'Let your customers pay using our payment system',
+ route: 'payments/accept-payments',
},
{
title: 'Verify payments',
- desc: 'Automatically verify trasactions after payments using lazerpay verify API ',
- route: 'verify-payments',
+ desc: 'Automatically verify trasactions after payments using Lazerpay verify API ',
+ route: 'payments/verify-payments',
},
]
@@ -21,7 +21,7 @@ export const completeYourIntegrationData: CardWithImage[] = [
{
title: 'Payments Link',
desc: 'With payments Link you can share your unique payments link to anyone in the world.',
- route: 'payments-link',
+ route: 'payments/payment-links',
},
{
title: 'Partial Payments',
@@ -30,33 +30,33 @@ export const completeYourIntegrationData: CardWithImage[] = [
},
{
title: 'Setup Webhooks',
- desc: 'Listen to webhook even whenever certain action occurs.',
- route: 'setup-webhooks',
+ desc: 'Listen to webhook events whenever certain action occurs.',
+ route: 'payments/webhooks',
},
]
export const testAndGoData: CardWithImage[] = [
{
title: 'Make Test Payments',
- desc: "We are goin to describe how you can go about testing Lazerpay's integration",
+ desc: "We are going to describe how you can go about testing Lazerpay's integration",
route: 'payments/make-test-payments',
},
- {
- title: 'Go Live',
- desc: 'Learnn about the steps required to make your integration live, and start receiving crypto payments in minutes.',
- route: 'go-live',
- },
+ // {
+ // title: 'Go Live',
+ // desc: 'Learnn about the steps required to make your integration live, and start receiving crypto payments in minutes.',
+ // route: 'go-live',
+ // },
]
export const startPaymentData: CardWithImage[] = [
{
title: 'Crypto Transfer',
desc: 'Withdraw and send crypto to an external wallet using our APIs.',
- route: 'crypto-transfers',
+ route: 'transfers/crypto-transfers',
},
{
title: 'Bank Transfers',
desc: 'Send stable coins directly from your wallet to your local bank account. ',
- route: 'bank-transfers',
+ route: 'transfers/bank-transfers',
},
]
diff --git a/components/Header/data.ts b/components/Header/data.ts
index f129727..7b11ea0 100644
--- a/components/Header/data.ts
+++ b/components/Header/data.ts
@@ -1,5 +1,5 @@
export const headerLinks = [
- { title: 'Quick Start', route: '/quick-start' },
- { title: 'APIs', route: '/quick-start' },
- { title: 'Support', route: '/quick-start' },
+ { title: 'Quick Start', route: '/docs/quick-start' },
+ { title: 'APIs', route: 'https://documenter.getpostman.com/view/20216295/2s7ZE7L42K' },
+ { title: 'Support', route: 'https://forum.lazerpay.finance/' },
]
diff --git a/components/Header/index.tsx b/components/Header/index.tsx
index c03f4e7..39a2de8 100644
--- a/components/Header/index.tsx
+++ b/components/Header/index.tsx
@@ -10,17 +10,22 @@ interface IProps {
}
const Header = ({ toggleSidebar }: IProps) => {
-
const headerStyles =
'pb-3 md:py-3 flex items-top lg:items-center justify-between xl:pr-4 sticky top-0 z-10 '
return (
-
+
toggleSidebar((prev: boolean) => !prev)}
className='text-lg'
- tabIndex={0}>
+ tabIndex={0}
+ >
@@ -30,7 +35,7 @@ const Header = ({ toggleSidebar }: IProps) => {
Docs
-
+
@@ -42,7 +47,11 @@ const Header = ({ toggleSidebar }: IProps) => {
{/* TODO - create a standalone component search bar */}
-
+
+ {/* */}
@@ -52,7 +61,9 @@ const Header = ({ toggleSidebar }: IProps) => {
))}
- Dashboard
+
+ Dashboard
+
diff --git a/components/LibraryItem/index.tsx b/components/LibraryItem/index.tsx
new file mode 100644
index 0000000..274c188
--- /dev/null
+++ b/components/LibraryItem/index.tsx
@@ -0,0 +1,54 @@
+import Divider from 'components/Divider'
+import LzLink from 'components/UI/link'
+import ArrowRightIcon from 'public/icons/arrow-right-icon'
+
+export interface ItemProp {
+ type: string
+ title: string
+ desc: string
+ link: string
+ linkText?: string
+}
+
+export interface LibraryItemProps {
+ items: ItemProp[]
+}
+
+const Item = (props: ItemProp) => {
+ const { type, title, desc, link, linkText } = props
+
+ return (
+
+ {type}
+ {title}
+ {desc}
+
+
+
+ {linkText || 'View library'}
+
+
+
+
+ )
+}
+
+const LibraryItem = (props: LibraryItemProps) => {
+ const { items } = props
+ return (
+
+ {items.map((item) => (
+
+ ))}
+
+ )
+}
+
+export default LibraryItem
diff --git a/components/LinkCard/index.tsx b/components/LinkCard/index.tsx
new file mode 100644
index 0000000..caed825
--- /dev/null
+++ b/components/LinkCard/index.tsx
@@ -0,0 +1,38 @@
+import LzLink from 'components/UI/link'
+import LinkIcon from 'public/icons/link-icon'
+import ArrowRightIcon from 'public/icons/arrow-right-icon'
+import cn from 'classnames'
+
+interface MyProps {
+ desc: string
+ title: string
+ route: string
+ icon?: boolean
+}
+
+const LinkCard = (props: MyProps) => {
+ const { desc, title, route, icon } = props
+ return (
+
+
+
+ {icon && }
+
+ {title}
+
+ {desc}
+
+
+
+
+
+
+ )
+}
+
+export default LinkCard
diff --git a/components/Loader/Loader.module.scss b/components/Loader/Loader.module.scss
new file mode 100644
index 0000000..3097626
--- /dev/null
+++ b/components/Loader/Loader.module.scss
@@ -0,0 +1,26 @@
+.loader {
+ width: 12px;
+ height: 12px;
+ border-radius: 50%;
+ background-color: #125bc9;
+ box-shadow: 32px 0 #125bc9, -32px 0 #125bc9;
+ position: relative;
+ animation: flash 0.5s ease-out infinite alternate;
+}
+
+@keyframes flash {
+ 0% {
+ background-color: #FFF2;
+ box-shadow: 32px 0 #FFF2, -32px 0 #125bc9;
+ }
+
+ 50% {
+ background-color: #125bc9;
+ box-shadow: 32px 0 #FFF2, -32px 0 #FFF2;
+ }
+
+ 100% {
+ background-color: #FFF2;
+ box-shadow: 32px 0 #125bc9, -32px 0 #FFF2;
+ }
+}
\ No newline at end of file
diff --git a/components/Loader/index.tsx b/components/Loader/index.tsx
new file mode 100644
index 0000000..e031ad8
--- /dev/null
+++ b/components/Loader/index.tsx
@@ -0,0 +1,4 @@
+import Styles from './Loader.module.scss'
+const Loader = () =>
+
+export default Loader
diff --git a/components/NotFound/index.tsx b/components/NotFound/index.tsx
new file mode 100644
index 0000000..d2059b8
--- /dev/null
+++ b/components/NotFound/index.tsx
@@ -0,0 +1,12 @@
+const NotFound = () => {
+ return (
+
+ Page Not Found
+
+ The page you are looking for does not exist.
+
+
+ )
+}
+
+export default NotFound
diff --git a/components/QuickLinks/data.ts b/components/QuickLinks/data.ts
index 22a4095..f0406e4 100644
--- a/components/QuickLinks/data.ts
+++ b/components/QuickLinks/data.ts
@@ -9,14 +9,14 @@ export interface TabsItem {
export const tabsData: TabsItem[] = [
{
title: "Accept Payments",
- route: "quick-start/payments",
+ route: "payments/accept-payments",
desc: `Accepting payments on Lazerpay is as seamless as it gets. Simply integrate a payment link or button.`,
image: '/images/payments.svg',
label: 'Go to payments'
},
{
title: "Transfers",
- route: "quick-start/transfers",
+ route: "transfers/get-started",
desc: `Get almost instant payouts to your local bank account, or crypto wallet`,
image: '/images/transfers.svg',
label: 'Go to transfers'
@@ -30,23 +30,23 @@ export const tabsData: TabsItem[] = [
},
{
title: "Libraries",
- route: "quick-start/libraries",
- desc: `These are othe official and community Lazerpay Libraries, APIs and Plugins.`,
+ route: "libraries/get-started",
+ desc: `Find the official and community Lazerpay Libraries, APIs and Plugins here.`,
image: '/images/libraries.svg',
label: 'Go to libraries'
},
- {
- title: "Use Cases",
- route: "use-cases/get-started",
- desc: `Learn how we’re powering crypto payments for creators, software providers, stores and startups.`,
- image: '/images/use-cases.svg',
- label: 'Go to Use Cases'
- },
- {
- title: "Guides and Tutorials",
- route: "quick-start/guides",
- desc: `Step-by-step guide on how to get the best out of your Lazerpay integration and features.`,
- image: '/images/guides.svg',
- label: 'Go to guides'
- },
+ // {
+ // title: "Use Cases",
+ // route: "use-cases/get-started",
+ // desc: `Learn how we’re powering crypto payments for creators, software providers, stores and startups.`,
+ // image: '/images/use-cases.svg',
+ // label: 'Go to Use Cases'
+ // },
+ // {
+ // title: "Guides and Tutorials",
+ // route: "quick-start/guides",
+ // desc: `Step-by-step guide on how to get the best out of your Lazerpay integration and features.`,
+ // image: '/images/guides.svg',
+ // label: 'Go to guides'
+ // },
]
\ No newline at end of file
diff --git a/components/Reaction/index.tsx b/components/Reaction/index.tsx
index 1cc9d38..08cc1ae 100644
--- a/components/Reaction/index.tsx
+++ b/components/Reaction/index.tsx
@@ -1,18 +1,43 @@
-import { LzButton } from 'components';
-import { ThumbsDownIcon, ThumbsUpIcon } from 'public/icons';
+import { LzButton } from 'components'
+import { ThumbsDownIcon, ThumbsUpIcon } from 'public/icons'
+import useSetReaction from 'lib/use-set-reaction'
+import { LzLoader } from 'components'
+const Reaction = (): JSX.Element => {
+ const { showReaction, saveReaction, loading } = useSetReaction()
-const Reaction = ():JSX.Element => {
+ if (!showReaction) return null
return (
-
- Did you find this page useful?
+
+ {loading && (
+
+
+
+ )}
+
+ Did you find this page useful?
+
- }>Yes
- }>No
+ }
+ onClick={() => saveReaction(true)}
+ >
+ Yes
+
+ }
+ onClick={() => saveReaction(false)}
+ >
+ No
+
- );
-};
+ )
+}
-export default Reaction;
\ No newline at end of file
+export default Reaction
diff --git a/components/TOC/index.tsx b/components/TOC/index.tsx
index 51cd218..9ea8fa4 100644
--- a/components/TOC/index.tsx
+++ b/components/TOC/index.tsx
@@ -1,5 +1,5 @@
-import classNames from "classnames"
-import { useScrollSpy } from "../../lib/use-scrollspy"
+import classNames from 'classnames'
+import { useScrollSpy } from '../../lib/use-scrollspy'
import Styles from './index.module.scss'
type TOC = Array<{
@@ -13,21 +13,25 @@ export function TableOfContents({ data = [] }: { data: TOC }) {
return (
- On this page
-
+ On this page
+
{data.map((item) => {
- const content = item.content.length > 20 ? `${item.content.slice(0, 20)}...` : item.content;
+ const content =
+ item.content.length > 20
+ ? `${item.content.slice(0, 20)}...`
+ : item.content
return (
-
+ key={item.slug}
+ >
- {item.lvl > 2 ? "—" : null}{" "}
- {content}
+ {item.lvl > 2 ? '—' : null} {content}
- )})}
+ )
+ })}
)
diff --git a/components/TextBlock/index.module.scss b/components/TextBlock/index.module.scss
new file mode 100644
index 0000000..e69de29
diff --git a/components/TextBlock/index.tsx b/components/TextBlock/index.tsx
new file mode 100644
index 0000000..3fbebcd
--- /dev/null
+++ b/components/TextBlock/index.tsx
@@ -0,0 +1,15 @@
+import React, { FC, PropsWithChildren } from "react";
+
+export type TextBlockProps = {
+ children?: React.ReactNode;
+}
+
+const urlRegex = /[(http(s)?):\/\/(www\.)?a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/ig
+
+const TextBlock: FC> = (props) => {
+ const { children } = props;
+
+ return ({children})
+}
+
+export default TextBlock;
\ No newline at end of file
diff --git a/components/UI/alert.tsx b/components/UI/alert.tsx
index a7ca04a..41a4695 100644
--- a/components/UI/alert.tsx
+++ b/components/UI/alert.tsx
@@ -1,46 +1,55 @@
-import classNames from "classnames";
-import { AlertIcon, ErrorIcon, InfoIcon, SuccessIcon } from "public/icons";
+import classNames from 'classnames'
+import { AlertIcon, ErrorIcon, InfoIcon, SuccessIcon } from 'public/icons'
interface IProps {
- content?: string | React.ReactNode,
- status?: 'warning' | 'error' | 'success' | 'info',
- children?: any,
- title?: string,
- className?: string
+ content?: string | React.ReactNode
+ status?: 'warning' | 'error' | 'success' | 'info'
+ children?: any
+ title?: string
+ className?: string
}
-const LzAlert = ({ content, children, status = "info", title, className }: IProps) => {
- const variants = {
- 'warning': {
- classNames: 'border-war-800 bg-war-50',
- icon:
- },
- 'error': {
- classNames: 'border-err-800 bg-err-50',
- icon:
- },
- 'success': {
- classNames: 'border-suc-800 bg-suc-50',
- icon:
- },
- 'info': {
- classNames: 'border-neu-800 bg-neu-50',
- icon:
- }
- };
+const LzAlert = ({
+ content,
+ children,
+ status = 'info',
+ title,
+ className,
+}: IProps) => {
+ const variants = {
+ warning: {
+ classNames: 'border-war-800 bg-war-50',
+ icon: ,
+ },
+ error: {
+ classNames: 'border-err-800 bg-err-50',
+ icon: ,
+ },
+ success: {
+ classNames: 'border-suc-800 bg-suc-50',
+ icon: ,
+ },
+ info: {
+ classNames: 'border-neu-800 bg-neu-50',
+ icon: ,
+ },
+ }
- return (
-
-
- {variants[status]['icon']}
-
- {title}
-
-
- )
+ return (
+
+
+ {variants[status]['icon']}
+
+ {title}
+ {children || content}
+
+ )
}
-export default LzAlert;
\ No newline at end of file
+export default LzAlert
diff --git a/components/UI/codeSelect/codeselect.module.scss b/components/UI/codeSelect/codeselect.module.scss
new file mode 100644
index 0000000..b7c4f7e
--- /dev/null
+++ b/components/UI/codeSelect/codeselect.module.scss
@@ -0,0 +1,17 @@
+.select {
+ box-shadow: 0px 0px 1px rgba(12, 26, 75, 0.24), 0px 3px 8px -1px rgba(50, 50, 71, 0.05);
+ visibility: hidden;
+ top: 1.9rem;
+ opacity: 0;
+ transition: all .1s ease-out;
+}
+
+.selectActive {
+ visibility: visible;
+ top: 1.3rem;
+ opacity: 1;
+}
+
+.left {
+ right: 0
+}
\ No newline at end of file
diff --git a/components/UI/codeSelect/index.tsx b/components/UI/codeSelect/index.tsx
new file mode 100644
index 0000000..282b01d
--- /dev/null
+++ b/components/UI/codeSelect/index.tsx
@@ -0,0 +1,65 @@
+import { useState, MouseEvent } from 'react'
+import cn from 'classnames'
+
+import { useCloseContext } from 'lib/use-close-context'
+import ArrowDown from 'public/icons/arrow-down'
+import Styles from './codeselect.module.scss'
+
+export type SelectProps = {
+ items: string[]
+ onChange: (i: number) => void
+ position?: 'left' | 'right'
+}
+
+const CodeSelect = (props: SelectProps) => {
+ const { items, onChange, position } = props
+ const [selected, setSelected] = useState(0)
+ const { ref, setVisible, visible } = useCloseContext()
+
+ const onSelected = (e: MouseEvent): void => {
+ e.preventDefault()
+ const { dataset } = e.target as HTMLButtonElement
+ setSelected(Number(dataset.value))
+ onChange(Number(dataset.value))
+ setVisible((prev) => !prev)
+ }
+ return (
+
+
+
+ {items.map((item, i) => (
+ -
+
+
+ ))}
+
+
+ )
+}
+
+export default CodeSelect
diff --git a/components/UI/link.tsx b/components/UI/link.tsx
index 361cf63..4262c91 100644
--- a/components/UI/link.tsx
+++ b/components/UI/link.tsx
@@ -1,42 +1,58 @@
-import classNames from 'classnames';
-import Link from 'next/link';
-import { useRouter } from 'next/router';
-import React, { ReactEventHandler } from 'react';
+import classNames from 'classnames'
+import Link from 'next/link'
+import { useRouter } from 'next/router'
+import React, { ReactEventHandler } from 'react'
interface IProps {
- onClick?: ReactEventHandler
- to?: string;
- passHref?: boolean;
- anchor?: boolean;
- children?: React.ReactNode;
- className?: string
-};
+ onClick?: ReactEventHandler
+ to?: string
+ passHref?: boolean
+ anchor?: boolean
+ children?: React.ReactNode
+ className?: string
+}
-const LzLink = React.forwardRef(({ to = "#", passHref = false, anchor, children, className, ...rest }: IProps, ref: any) => {
- const { pathname } = useRouter();
- const isActive = to.includes(pathname);
- const isExternalLink = to.includes('http') ? { target: '_blank' } : {};
+const LzLink = React.forwardRef(
+ (
+ {
+ to = '#',
+ passHref = false,
+ anchor,
+ children,
+ className,
+ ...rest
+ }: IProps,
+ ref: any,
+ ) => {
+ const { pathname } = useRouter()
+ const isActive = to.includes(pathname)
+ const isExternalLink = to.includes('http') ? { target: '_blank' } : {}
return (
-
-
- {children}
- {anchor && (
-
- #
-
- )}
-
-
+
+
+ {children}
+ {anchor && (
+
+ #
+
+ )}
+
+
)
-})
+ },
+)
LzLink.displayName = 'LzLink'
-export default LzLink;
\ No newline at end of file
+export default LzLink
diff --git a/components/UI/table.tsx b/components/UI/table.tsx
index 8e023ae..ec293f0 100644
--- a/components/UI/table.tsx
+++ b/components/UI/table.tsx
@@ -1,9 +1,10 @@
export interface ITable {
- body: string[]
- head: string[]
+ body: string[];
+ head: string[];
+ reverse?: boolean;
}
-const LzTable = ({ head, body }) => {
+const LzTable = ({ head, body, reverse }) => {
if (!head || !body) return null;
return (
@@ -25,7 +26,7 @@ const LzTable = ({ head, body }) => {
{
body.map((row: string[], i: number) => (
-
+
{row.map((c: string) => (
void;
+}
+
+const Toggle = (props: ToggleProps) => {
+ const { state, onChange } = props;
+ const [checked, setChecked] = useState(state || false);
+ const onToggle = (e: ChangeEvent) => {
+ const { checked: inputChecked } = e.target as HTMLInputElement;
+ setChecked(!inputChecked);
+ onChange(!inputChecked);
+ }
+
+ return (
+
+ )
+}
+
+export default Toggle;
\ No newline at end of file
diff --git a/components/YoutubePlayer/index.tsx b/components/YoutubePlayer/index.tsx
new file mode 100644
index 0000000..9512f73
--- /dev/null
+++ b/components/YoutubePlayer/index.tsx
@@ -0,0 +1,20 @@
+import Style from './youtube.module.scss'
+
+const YoutubePlayer = (props) => {
+ const { src, title } = props
+ return (
+
+
+
+ )
+}
+
+export default YoutubePlayer
diff --git a/components/YoutubePlayer/youtube.module.scss b/components/YoutubePlayer/youtube.module.scss
new file mode 100644
index 0000000..089b1c2
--- /dev/null
+++ b/components/YoutubePlayer/youtube.module.scss
@@ -0,0 +1,14 @@
+.iframeContainer {
+ position: relative;
+ width: 100%;
+ padding-bottom: 52.65%;
+ height: 0;
+
+ iframe {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ }
+}
\ No newline at end of file
diff --git a/components/index.ts b/components/index.ts
index 4b3a461..9d47616 100644
--- a/components/index.ts
+++ b/components/index.ts
@@ -6,9 +6,9 @@ import LzLink from './UI/link'
import LzAlert from './UI/alert'
import LinkedCard from './GetstartedCard/Cards'
import { PlainCard } from './GetstartedCard/Cards';
-import { ShopifyIcon } from './../public/icons/shopify-icon';
-import { WordPressIcon } from './../public/icons/wordPress-Icon';
-import { WooCommerceIcon } from './../public/icons/wooCommerce-icon';
+import LzToggle from './UI/toggle';
+import LzCodeSelect from './UI/codeSelect';
+import LzLoader from './Loader';
// Page Components
import FooterWrapper from './Footer'
@@ -18,6 +18,7 @@ import Reaction from './Reaction'
import { TableOfContents } from './TOC'
import QuickLinks from './QuickLinks'
import CodeBlock from './CodeBlock'
+import TextBlock from './TextBlock'
import AcceptPayments from './AcceptPayments'
import ExploreDemo from './ExploreDemo'
import WhatsNew from './WhatsNew'
@@ -29,16 +30,23 @@ import Ecommerce from './UseCases'
import TransferWebHook from './TransWebhook'
import TestPayments from './TestPayments'
import LzTable from './UI/table'
-import Webhooks from './Webhooks'
+import LinkCard from './LinkCard'
+import CardList, { LibraryGetStarted } from './CardList';
+import LibraryItem from './LibraryItem'
+import NotFound from './NotFound'
+import YoutubePlayer from './YoutubePlayer'
export {
LzTable,
LzInput,
LzAlert,
+ LzToggle,
+ LzCodeSelect,
WhatsNew,
ExploreDemo,
AcceptPayments,
CodeBlock,
+ TextBlock,
QuickLinks,
TableOfContents,
Sidebar,
@@ -57,5 +65,11 @@ export {
TransferWebHook,
PlainCard,
Ecommerce,
- Webhooks
+ LinkCard,
+ LibraryGetStarted,
+ LibraryItem,
+ LzLoader,
+ CardList,
+ NotFound,
+ YoutubePlayer
}
diff --git a/components/mdx-components.tsx b/components/mdx-components.tsx
index eeb2454..eceb1d9 100644
--- a/components/mdx-components.tsx
+++ b/components/mdx-components.tsx
@@ -4,6 +4,7 @@ import LzLink from './UI/link'
import QuickLinks from './QuickLinks'
import Divider from './Divider'
import CodeBlock from './CodeBlock'
+import TextBlock from './TextBlock'
import GetstartedCard, {
CompleteIntegration,
TestAndGoLive,
@@ -21,7 +22,12 @@ import TransferWebHook from './TransWebhook'
import TestPayments from './TestPayments'
import Ecommerce from './UseCases'
import LzTable from './UI/table'
+import LinkCard from './LinkCard'
+import CardList, { LibraryGetStarted } from './CardList'
+import LibraryItem from './LibraryItem'
import Webhooks from './Webhooks'
+import Reaction from './Reaction'
+import YoutubePlayer from './YoutubePlayer'
/** Create a map of the HTML elements */
export const components: Record>> = {
@@ -43,8 +49,11 @@ export const components: Record>> = {
Divider({ children, ...props }) {
return
},
- CodeBlock(props) {
- return
+ CodeBlock({ data, ...props }) {
+ return
+ },
+ TextBlock(props) {
+ return
},
Admonition(props) {
return
@@ -55,6 +64,15 @@ export const components: Record>> = {
GetstartedCard() {
return
},
+ LibraryGetStarted() {
+ return
+ },
+ CardList({ items, icon, ...props }) {
+ return
+ },
+ LibraryItem({ items, ...props }) {
+ return
+ },
TransferCard() {
return
},
@@ -64,8 +82,8 @@ export const components: Record>> = {
TestAndGoLive() {
return
},
- Pagination(IProps) {
- return
+ Pagination({ children, props }) {
+ return
},
BankPayouts() {
return
@@ -77,6 +95,9 @@ export const components: Record>> = {
LinkedCard(MyProps) {
return
},
+ LinkCard({ children, prop }) {
+ return
+ },
PlainCard(MyProps) {
return
},
@@ -87,10 +108,15 @@ export const components: Record>> = {
Webhooks() {
return
},
-
+ Reaction() {
+ return
+ },
+ YoutubePlayer(props) {
+ return
+ },
/** Below this line contains all reusable UI components */
- LzTable({ head, body }) {
- return
+ LzTable({ head, body, reverse }) {
+ return
},
TransferWebHook() {
return
@@ -112,7 +138,7 @@ export const components: Record>> = {
return
},
h3(props) {
- return
+ return
},
h4(props) {
return
@@ -120,8 +146,25 @@ export const components: Record>> = {
pre(props) {
return
},
+ ol(props) {
+ return (
+
+ )
+ },
+ ul(props) {
+ return (
+
+ )
+ },
li(props) {
- return
+ // TODO: FIX
+ return
},
inlineCode(props) {
return
diff --git a/components/pagination.tsx b/components/pagination.tsx
index ef06db9..5bfb49d 100644
--- a/components/pagination.tsx
+++ b/components/pagination.tsx
@@ -1,42 +1,46 @@
+import LzLink from './UI/link'
import { paginate } from 'lib/pagination-utils'
import { useRouter } from 'next/router'
import PaginateLeftIcon from 'public/icons/paginate-left-icon'
import PaginateRightIcon from 'public/icons/paginate-right-icon'
-
-interface IProps {
- nextName?: string
- prevName?: string
- children?: React.ReactNode,
-}
-
export function usePagination() {
- const { asPath } = useRouter()
+ const { asPath } = useRouter();
const { prev, next } = paginate({ framework: 'react', current: asPath })
return { prev, next, hasPrev: !!prev, hasNext: !!next }
}
-export function Pagination({ nextName, prevName}: IProps) {
- const { prev, next } = usePagination()
+export function Pagination() {
+ const { prev, next } = usePagination();
+ const prevPath = prev?.path ? `/docs/${prev.path}` : "#";
+ const nextPath = next?.path ? `/docs/${next.path}` : "#";
return (
-
-
- PREVIOUS
- {prevName ? prevName : "Quick start" }
-
+ {prev && (
+ <>
+
+
+
+
+ PREVIOUS
+ {prev?.label ? prev.label : "Quick start"}
+
+ >
+ )}
-
- NEXT
- {nextName ? nextName : "Accept payments" }
-
-
+ {next && (
+ <>
+
+ NEXT
+ {next?.label ? next.label : "Accept payments"}
+
+
+
+
+ >
+ )}
)
diff --git a/content/docs/customers/index.mdx b/content/docs/customers/index.mdx
new file mode 100644
index 0000000..ec9dbce
--- /dev/null
+++ b/content/docs/customers/index.mdx
@@ -0,0 +1,62 @@
+---
+title: Transactions
+description: Transactions page
+---
+
+# Customers
+
+Keep track of all your customers with this API endpoint. You can use it to programmatically fetch and list all the customers linked to your Lazerpay account.
+
+## All Customers
+
+List all the transactions associated with your Lazerpay account.
+
+
+
+
+
+
+
+## Get transaction by transaction ID
+
+Fetch a specific transaction using its transaction ID.
+
+Path', '', ''],
+ [':transaction_id*', 'String
', 'Supply a transaction ID'],
+]} />
+
+
+
\ No newline at end of file
diff --git a/content/docs/libraries/get-started.mdx b/content/docs/libraries/get-started.mdx
new file mode 100644
index 0000000..141faa5
--- /dev/null
+++ b/content/docs/libraries/get-started.mdx
@@ -0,0 +1,16 @@
+---
+title: Libraries - Getting Started
+description: Getting Started Libraries page
+---
+
+# Libraries
+
+This is the page for the official and community Lazerpay mobile libraries, APIs and Plugins.
+
+
+
+## Get started
+
+Tools for accepting crypto payment on your app
+
+
\ No newline at end of file
diff --git a/content/docs/libraries/libraries.mdx b/content/docs/libraries/libraries.mdx
new file mode 100644
index 0000000..afe5d43
--- /dev/null
+++ b/content/docs/libraries/libraries.mdx
@@ -0,0 +1,30 @@
+---
+title: Libraries - Libraries
+description: Libraries Libraries page
+---
+
+# Libraries
+Find documentation libraries for all Lazerpay products.
+
+
+## Official libraries
+
+
+
+## Community libraries
+
+
diff --git a/content/docs/libraries/plugins.mdx b/content/docs/libraries/plugins.mdx
new file mode 100644
index 0000000..b06034e
--- /dev/null
+++ b/content/docs/libraries/plugins.mdx
@@ -0,0 +1,21 @@
+---
+title: Plugins - Libraries
+description: Plugins Libraries page
+---
+
+# Plugins
+Official platform softwares for accepting crypto payments.
+
+
+## Shopify
+
+
+
+## Wordpress
+
+
diff --git a/content/docs/payments/accept-payments.mdx b/content/docs/payments/accept-payments.mdx
index a34e60d..e374f7b 100644
--- a/content/docs/payments/accept-payments.mdx
+++ b/content/docs/payments/accept-payments.mdx
@@ -3,17 +3,129 @@ title: Accept Payments
description: payment introduction page
---
-# Payments: Demo table component
+# Accept Payments
-This is to show the table component Demo
-
-
+ {''}
+
+
+## 2. Collect user Details
+To receive payments you will need to pass some parameters which include some functions and optional customer information. They include:
+
+Cardinal Commerce", "We handle 3DS with no extra cost"],
- ["Payment", "Completed on your checkout page", "Completed on a dashboard.lazerpay.finance redirect page"],
- ["Local Payment", "Not supported", "Partially supported"],
- ]}
-/>
\ No newline at end of file
+ ["name", "Customers Name", "Optional", "String
"],
+ ["email", "Customer email", "Optional", "String
"],
+ ["amount", "Customers amount to pay (in USD, AED, GBP, EUR, NGN)", "Required", "String | Number
"],
+ ["reference", "Unique case sensitive transaction reference. If you do not pass this parameter, Lazerpay will generate a unique reference for you", "Optional", "String | Number
"],
+ ["acceptPartialPayment", "If you want accept partial payment from customers, By default it's false", "Optional", "Boolean
"],
+ ["key", 'Lazerpay key. Get you public key from your Lazerpay dashboard. Testnet public keys begin with "pk_test_" and mainnet keys begin with "pk_live_".', "Required", "String
"],
+ ["currency", "The currency mount
is denominated in. Can be USD, GBP, EUR, AED or NGN", "Required", "String
"],
+ ["onClose", "The function called when the payment modal closes", "Optional", "Function
"],
+ ["onSuccess", "The function called after the payment is confirmed", "Optional", "Function
"],
+ ["onError", "The function that is called if an error occurs during payment confirmation", "Optional", "Function
"],
+ ]}
+/>
+
+When you add the inline checkout script, you immediately have access to the LazerCheckout
function. Pass the information you get in step 2 to the function in an object inside the payWithLazerpay
function
+
+
+The customer information can be retrieved from your database if you already have it stored, or from a form like in the example below:
+
+
+In this sample, notice how:
+
+1. The Lazerpay inline javascript is included using a script
tag. This is how you import Lazerpay into your code.
+2. The script
and email
here can be optional. The PopUp will provide those fields to the customers.
+3. The Pay With Lazerpay
button has been tied to an onClick
function called Pay With Lazerpay
. This is the action that causes the Lazerpay popup to load.
+
+
+
+## Initialize Payment API
+
+The initialize payment endpoint allows you to initiate payment directly to Lazerpay by passing in the payment details:
+
+Header', '', ''],
+ ['x-api-key*', 'String
', 'YOUR_PUBLIC_KEY'],
+ ['Body', '', ''],
+ ['reference', 'String
', 'YOUR_REFERENCE'],
+ ['customer_name*', 'String
', "Your Customer's name"],
+ ['customer_email*', 'String
', "Your Customer's email"],
+ ['coin*', 'String
', 'Stablecoins you want your customers to pay you in'],
+ ['currency*', 'String
', 'Currency should be in the currency you accept on your store, or application'],
+ ['amount*', 'String | Number
', 'The amoumt you want to charge the customer in the currency specified above'],
+ ['accept_partial_payment', 'Boolean
', 'This parameter is set to "false" by default. When you want to accept partial payments and ensure customers complete the required amount they are supposed to pay, it should be set to true'],
+]} />
+
+
+
+
+
+## Important Note
+1. The coin
field must either be “BUSD”, “DAI”, “USDT”, or “USDC”.
+2. It's ideal to generate a unique reference
from your system for every transaction to avoid duplicate attempts.
+3. The accept_partial_payment
field is used to enforce payment completion by your customers. A scenario is when a customer is trying to pay for a service worth a fixed amount
of $100 USD. When accept_partial_payment
is set to true, the customer must pay the exact amount before the funds will be sent to you. Read more about Partial Payments here.
+4. The amount
field should be in your fiat currency. The currencies we support are USD, AED, GBP, EUR and NGN. Please reach out to support@lazerpay.finance if you would want us to support a currency.
+5. The amount
during initialization is converted to the coin
equivalent of the currency specified.
+
+Never call the Lazerpay API directly from your frontend to avoid exposing your secret key on the frontend. All requests to the Lazerpay API should be initiated from your server, and your frontend gets the response from your server.
+
+## Lazerpay’s Node JS SDK
+The SDK allows you to initialise a payment transaction and to confirm payment. It's an NPM package so you can use it in a node environment.
+Here's a sample code on how to use the NodeJS SDK:
+
+
+
+When a payment is successful, Lazerpay sends a DEPOSIT_TRANSACTION
webhook event to webhook URL that you provide. It is highly recommended that you use webhooks to confirm the payment status before delivering value to your customers.
diff --git a/content/docs/payments/get-started.mdx b/content/docs/payments/get-started.mdx
index bbb91fd..020e54e 100644
--- a/content/docs/payments/get-started.mdx
+++ b/content/docs/payments/get-started.mdx
@@ -6,10 +6,9 @@ description: payment introduction page
# Payments: Get started
-Lazerpay payments can be processed accross multiple channels, including online,
-in app. The lazerpay platform include server side API.
+Lazerpay can process payments accross multiple channels with several mobile libraries and API.
-
+
## Start integrating
@@ -17,7 +16,7 @@ Build your integration and recieve cryto payments
-
+
## Complete your integration
@@ -25,15 +24,10 @@ Build your integration and recieve cryto payments
-
+
## Test and go live
Test your integration and get ready to accept boardless cryto payments
-
-
-
-
-
diff --git a/content/docs/payments/make-test-payments.mdx b/content/docs/payments/make-test-payments.mdx
index 2b51889..c330d1b 100644
--- a/content/docs/payments/make-test-payments.mdx
+++ b/content/docs/payments/make-test-payments.mdx
@@ -8,10 +8,21 @@ description: Test Payments page
We are going to describe how you can go about testing Lazerpay integration.
+
-
+## How to get Test Stable-coins
-
+- Go to the Binance testnet faucet.
+- Navigate to the API Keys and Webhooks tab.
+- Specify your webhook url and click on Update.
+
+
+
+
+
+## Check the video below for detailed step-by-step instructions:
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/content/docs/payments/partial-payments.mdx b/content/docs/payments/partial-payments.mdx
index 4495e41..0d3db3b 100644
--- a/content/docs/payments/partial-payments.mdx
+++ b/content/docs/payments/partial-payments.mdx
@@ -13,13 +13,9 @@ Accept partial payments on your platform.
## Introduction
-With this feature, if you attempt to charge someone USD 100 but they only pay USD 90, the
-transaction will be put on hold and tagged incomplete
. until the person completes the
-payment. With partial debits, we will not hold the amount_paid
instead we will forward it to you
-(the business) and send you a webhook for the transaction althought it’ll still have a status of
- incomplete
+With this feature, if you attempt to charge someone USD 100 but they only pay USD 90, the transaction will be put on hold and tagged incomplete
. until the person completes the payment. With partial debits, we will not hold the amount_paid
instead we will forward it to you (the business) and send you a webhook for the transaction althought it’ll still have a status of incomplete
-
+
## How Does it Work?
@@ -31,7 +27,7 @@ You can use the partial payment feature through our accept payment api or throug
content=' When using the partial payment feature, you need to pass the parameter "accept_partial_payment" :
true'/>
-
+
## Verifying Transactions
When verifying transactions (or implementing webhooks) that involve Partial Payments, there are
@@ -43,7 +39,3 @@ intend to charge.
status="info"
className="mt-8 mb-8 "
content='The fiat equivalent for the types of amounts are called fiatAmount and amountPaidFiat'/>
-
-
-
-
\ No newline at end of file
diff --git a/content/docs/payments/payment-links.mdx b/content/docs/payments/payment-links.mdx
new file mode 100644
index 0000000..198882d
--- /dev/null
+++ b/content/docs/payments/payment-links.mdx
@@ -0,0 +1,243 @@
+---
+title: Payments Link
+description: Payment Link page
+---
+
+# Payments Link
+
+With payment links, you can share your unique payment link to anyone in the world.
+
+
+## How do Payment Links Work?
+
+With Payment Links, you can create a payment page and share a link to it with your customers. Creating Payment links from the dashboard requires no coding and you can share the link as many times as you want on social media, in emails, or any other channel.
+
+You can also create payment links using our APIs or our Libraries.
+
+We have two types of payment link creation
+- Standard payment link
+- Donation payment link
+
+
+## Standard Payment link
+
+Standard payment links are shareable links which you can use to receive digital payments from your customers worldwide
+
+
+
+
+
+### Create Standard payment link
+Create a new standard payment link with the following endpoint
+
+Body', '', ''],
+ ['title*', 'String
', 'ex: "Payment for Merchandise With Cash"'],
+ ['description*', 'String
', 'ex: "Pay for some nice guccie bags"'],
+ ['options*', 'Object
', 'ex: "options": { "collect_phone": true, "allow_promo": true, "collect_address": true },'],
+ ['action*', 'Object
', 'ex: "action": { "redirect": true, "redirect_url": "https://local.me", "show_confirmation_page": false, "success_message": "thank you budd!" },'],
+ ['cart*', 'Array
', 'ex: "cart": []'],
+ ['charge*', 'Array
', 'ex: "charge": { "amount": 84000, "currency": "NGN" }'],
+ ]}
+/>
+
+
+
+The array of price ids in the payload are gotten from existing products.
+
+
+
+### Update an existing standard payment link
+Update an existing standard payment link with the following endpoint
+
+Body', '', ''],
+ ['title*', 'String
', 'ex: "Payment for Merchandise With Cash"'],
+ ['description*', 'String
', 'ex: "Pay for some nice guccie bags"'],
+ ['options*', 'Object
', 'ex: "options": { "collect_phone": true, "allow_promo": true, "collect_address": true },'],
+ ['action*', 'Object
', 'ex: "action": { "redirect": true, "redirect_url": "https://local.me", "show_confirmation_page": false, "success_message": "thank you budd!" },'],
+ ['cart*', 'Array
', 'ex: "cart": []'],
+ ['charge*', 'Array
', 'ex: "charge": { "amount": 84000, "currency": "NGN" }'],
+ ]}
+/>
+
+
+
+
+
+## Donation Payment link
+
+Donation payment links can be created for people to support a cause that they care about
+
+
+
+
+
+### Create Donation payment link
+Create a new donation payment link with the following endpoint
+
+Body', '', ''],
+ ['title*', 'String
', 'ex: "Payment for Merchandise With Cash"'],
+ ['is_active*', 'boolean
', 'true or false'],
+ ['description*', 'String
', 'ex : "Donate here"'],
+ ['options*', 'Object
', 'ex: "options": { "collect_phone": true, "allow_promo": true, "collect_address": true },'],
+ ['action*', 'Object
', 'ex: "action": { "redirect": false, "redirect_url": "https://local.com/confirm", "show_confirmation_page": false, "success_message": "thank you budd!" },'],
+ ['social_links', 'Object
', '"social_links": { "facebook":"fb.me/uche", "instagram": "noelukwa", "twitter" :"noelukwa" },'],
+ ['website_link', 'String
', 'ex: https://uche.com'],
+ ['cover_photo', 'String | URL
', 'ex: https://random-cover-photo.jpeg'],
+ ]}
+/>
+
+
+
+
+
+### Update Donation payment link
+Update an existing donation payment link with the following endpoint
+
+Body', '', ''],
+ ['title*', 'String
', 'ex: "Payment for Merchandise With Cash"'],
+ ['is_active*', 'boolean
', 'true or false'],
+ ['description*', 'String
', 'ex : "Donate here"'],
+ ['options*', 'Object
', 'ex: "options": { "collect_phone": true, "allow_promo": true, "collect_address": true },'],
+ ['action*', 'Object
', 'ex: "action": { "redirect": false, "redirect_url": "https://local.com/confirm", "show_confirmation_page": false, "success_message": "thank you budd!" },'],
+ ['social_links', 'Object
', '"social_links": { "facebook":"fb.me/uche", "instagram": "noelukwa", "twitter" :"noelukwa" },'],
+ ['website_link', 'String
', 'ex: https://uche.com'],
+ ['cover_photo', 'String | URL
', 'ex: https://random-cover-photo.jpeg'],
+ ['id*', 'String
', 'ex: 362e16ce-226b-4e58-92f9-XXXX'],
+ ]}
+/>
+
+
+
+
+
+## Fetch All Payment Links API
+Get all the payment links using the API.
+
+Header', '', ''],
+ ['Authorization*', 'String
', 'Bearer YOUR_SECRET_KEY'],
+ ]}
+/>
+
+
+
+
+
+## Fetch Payment Link API
+Using this endpoint, one can fetch the details of a particular payment link.
+
+Path', '', ''],
+ ['id_or_reference*', 'String
', 'Bearer id_or_reference'],
+ ['Header', '', ''],
+ ['Authorization*', 'String
', 'Bearer YOUR_SECRET_KEY'],
+ ]}
+/>
+
+
+
+
+
+## Official JS SDK
+With the SDK, You can programmatically create payment links and access all the payment link methods available in the API. Find the guide here.
+
diff --git a/content/docs/payments/verify-payments.mdx b/content/docs/payments/verify-payments.mdx
new file mode 100644
index 0000000..9e5b6b7
--- /dev/null
+++ b/content/docs/payments/verify-payments.mdx
@@ -0,0 +1,71 @@
+---
+title: Verify Payments
+description: Verify Payments page
+---
+
+# Verify Payments
+
+Transactions are being verified using the Verify Payments endpoint from your server using your transaction reference or with the address property whose value is the payment address returned from the initialise payment function.
+
+## Verify Payment API
+
+To verify transactions using the Lazerpay endpoint, you will make a get
request to verify transaction endpoint from your server using your transaction reference or with the address property.
+
+Here’s a code sample for verifying transactions.
+
+Path', '', ''],
+ ['address_or_reference', 'String
', 'The transaction Address
or reference
you want to fetch'],
+ ['Header', '', ''],
+ ['*', 'String
', 'YOUR_PUBLIC_KEY'],
+ ]}
+ />
+
+
+
+#### Important Note from the verification response
+1. The actualAmount
key is the amount that you intended to charge the customer in crypto.
+2. The amountPaid
key is the crypto amount that is being paid to the merchant. It is usually in the coins that we support..
+3. The amountPaidFirst
is the fiat value of the crypto amount beinf paid to the merchant.
+4. The fiatAmount
is the fiat value of the amount that you intended to charge the customer. This is usually in the merchant’s local currency.
+
+The amountReceivedFiat
and amountReceived
values is the amountPaidFiat plus Lazerpay fees and the AmountPaid plus Lazerpay fees respectively
+
+
+
+## From Official JS SDK
+With the JS SDK, you have access to the confirmPayment object which is used to verify any payment in the Lazerpay platform.
+
+
+
+
+If you offer digital value like airtime, wallet top-up, digital credit, etc, always confirm that you have not already processed the value for that transaction to avoid double fulfillments, especially, if you also use webhooks.
diff --git a/content/docs/payments/webhooks.mdx b/content/docs/payments/webhooks.mdx
index 74c5ee7..5c03b66 100644
--- a/content/docs/payments/webhooks.mdx
+++ b/content/docs/payments/webhooks.mdx
@@ -1,13 +1,13 @@
---
title: Webhooks
-description:
+description: Webhooks page
---
# Webhooks
Listen to webhook events whenever certain actions occurs.
-
+
## What are Webhooks?
@@ -15,79 +15,58 @@ Webhooks are a way for you to subscribe to events that occur when an event invol
A webhook URL is an endpoint on your server where you can receive notifications about such events. When an event occurs, we'll make a POST request to that endpoint, with a JSON body containing the details about the event, including the type of event and the data associated with it.
-
+Rather than continuously polling the server to check if the state has changed, webhooks provide information to you as it becomes available, which is a lot more efficient and beneficial for developers.
- Here are some sample webhook paylods for deposit transactions.
+Here are some sample webhook paylods for deposit transactions.
-
-
-
+
+
## Enabling Webhooks
-
-You can specify your webhook URL on your dashboard where we would send POST
requests
-whenever an event occurs.
+You can specify your webhook URL on your dashboard where we would send POST
requests whenever an event occurs.
Here’s how to set up a webhook on your Lazerpay account:
+1. Login to your dashboard and click on Settings.
+2. Navigate to the API Keys and Webhooks tab.
+3. Specify your webhook url and click on Update.
-
-
-
-
-
-
-
-
- ## Validating Webhook Signature
+
- Every webhook event payload will contain a hashed authentication signature in the header which is computed by generating a hash from concatenating your API key and request body, using the HMAC SHA256 hash algorithm.
+When testing, you can get an instant webhook URL by visiting webhook.site. This will allow you to inspect the received payload without having to write any code or set up a server.
+
-In order to verify this signature came from Lazerpay, you simply have to generate the HMAC SHA256 hash and compare it with the signature received.
+## Validating Webhook Signature
-
+Every webhook event payload will contain a hashed authentication signature in the header which is computed by generating a hash from concatenating your API key and request body, using the HMAC SHA256 hash algorithm.
-
+In order to verify this signature came from Lazerpay, you simply have to generate the HMAC SHA256 hash and compare it with the signature received.
- ## Responding to Wehbooks Request
-
- You must respond with a 200 ok
status code. Any other response code outside of the 2xx
- range, we will consider it will considered as a failure, including 3xx
codes. We don’t
- care about the response body or headers
-
-
-
-
-
-
- ## Supported Wehbooks Types
-
- Here are the webhook type request we support. Well add more to this list as we keep adding
- webhook supports for different API operations in the future
-
- incomplete or complete
`,
-],
-]}
+
+
-
-
-
+## Responding to Webhooks Request
+You must respond with a 200 OK
status code. Any other response code outside of the 2xx
range, we will consider it will be considered as a failure, including 3xx
codes. We don’t care about the response body or headers.
+
+If we don't get a 200 OK status code, we'll retry the webhook every one minute for the next 24 hours.
+
+## Supported Webhooks Types
+Here are the webhooks request types we support. We'll add more to this list as we keep adding webhook supports for different API operations in the future.
+template or complete
']
+]}/>
diff --git a/content/docs/products/index.mdx b/content/docs/products/index.mdx
new file mode 100644
index 0000000..c9c2c2b
--- /dev/null
+++ b/content/docs/products/index.mdx
@@ -0,0 +1,273 @@
+---
+title: Products
+description: Products page
+---
+
+# Products
+
+To make the payment link creation process more robust, merchants can now display their goods or services as Products without having a website.
+
+Products can be created and seen on the dashboard more like a store inventory. They can be hidden when no longer available or for sale. There are no limitations as to the number of products you add on the products page as the pagination feature would help product data spread across different pages automatically.
+
+## Create Product
+
+Body', '', ''],
+ ['name*', 'String
', 'ex : "book"'],
+ ['description*', 'String
', 'ex: Atomic Habits'],
+ ['cover_photo', 'String | URL
', 'ex: "https://my-fake-cover-image.jpeg"'],
+ ['prices*', 'dict
', '"prices": [ { "currency": "USD", "amount": 80000 } ]']
+]} />
+
+
+
+
+
+
+
+You can add a Payment link and associate it with your Product using the Payments Link API and passing an array of product price ids as payload
+
+
+
+Once Payment link is associated with the Product you can use the link or QR code to collect payments along with other information such as shipping address and redirect users to your website after a successful payment
+
+
+
+
+
+## Find Products
+
+Path', '', ''],
+ ['network*', 'String
', '']
+]} />
+
+
+
+
+
+## Get Product
+
+Path', '', ''],
+ ['id*', 'String
', 'Product ID']
+]} />
+
+
+
+
+
+## Update Product
+
+Body', '', ''],
+ ['name', 'String
', ''],
+ ['description', 'String
', ''],
+ ['cover_photo', 'String
', ''],
+ ['active', 'String
', '']
+]} />
+
+
+
+
+
+## Get Prices
+
+Path', '', ''],
+ ['take*', 'String | Number
', '3'],
+ ['page*', 'String | Number
', '1'],
+]} />
+
+
+
+
+
+## Get links by price
+
+Path', '', ''],
+ ['price_id*', 'String | Number
', ''],
+]} />
+
+
+
+
+
+## Add Price
+
+Body', '', ''],
+ ['amount*', 'Float
', 'ex : { "amount" : 500000, "currency": "ngn" }'],
+ ['currency*', 'Float
', 'ex : { "amount" : 500000, "currency": "ngn" }'],
+]} />
+
+
+
+
+
+## Delete Price
+
+Path', '', ''],
+ ['price_id*', 'String
', 'price id of the product'],
+]} />
+
+
+
+
+
+## Delete Product
+
+Path', '', ''],
+ ['id*', 'String
', 'id of the product'],
+]} />
+
+
+
+
\ No newline at end of file
diff --git a/content/docs/quick-start/authentication.mdx b/content/docs/quick-start/authentication.mdx
index 6236744..7838b81 100644
--- a/content/docs/quick-start/authentication.mdx
+++ b/content/docs/quick-start/authentication.mdx
@@ -37,12 +37,3 @@ Authorization headers should be in the following format:
content=' Do not set VERIFY_PEER
to FALSE
. Ensure your server verifies the SSL connection to Lazerpay...'/>
-
-
-
-
-
-
-
-
-
diff --git a/content/docs/quick-start/index.mdx b/content/docs/quick-start/index.mdx
index a65b93f..c46ebdb 100644
--- a/content/docs/quick-start/index.mdx
+++ b/content/docs/quick-start/index.mdx
@@ -7,34 +7,26 @@ description: Quick start page
Welcome to the Lazerpay Developer Documentation where you’ll learn to build delightful payment experiences. Integrate Lazerpay into your products and start collecting crypto payments in 5 minutes.
-
+
## Build your payments integration
-
+
## Accept payments
Accepting payments on Lazerpay is as seamless as it gets. Here’s how:
-
+
## Explore demos
-Consectetur adipiscing elit. Non nam nulla tellus est vivamus aliquam risus. Ante facilisis risus semper faucibus. Non nam nulla tellus est vivamus aliquam risus.
-
+To get started use our official SDKs available on our github and look out on our blog and Youtube for interactive demos
+
-
-
-## What's new
-Consectetur adipiscing elit. Non nam nulla tellus est vivamus aliquam risus. Ante facilisis risus semper faucibus.
-Consectetur adipiscing elit. Non nam nulla tellus est.
-
-
-
+
## Connect with the community
-Consectetur adipiscing elit. Non nam nulla tellus est vivamus aliquam risus. Ante facilisis risus semper faucibus. Aliquam risus. Ante facilisis risus semper faucibus
+Connect with the Lazerpay community members on following channels :
-
diff --git a/content/docs/swap/get-started.mdx b/content/docs/swap/get-started.mdx
new file mode 100644
index 0000000..7ab07c6
--- /dev/null
+++ b/content/docs/swap/get-started.mdx
@@ -0,0 +1,41 @@
+---
+title: Get Started
+description: Swap introduction page
+---
+
+# Swaps
+
+The Swaps API allows you to programmatically swaps funds in your wallet between different coins.
+
+### Supported Cryptocurrencies
+
+- USDT
+- USDC
+- BUSD
+- DAI
+
+
+To send money on Lazerpay, you need API keys to authenticate your transfers. You can find your keys on the Lazerpay Dashboard under Settings → API Keys & Webhooks
+
+
+## Get started
+
+Swap Stablecoins in your lazerpay account using our APIs
+
+
diff --git a/content/docs/swap/stablecoin-swap.mdx b/content/docs/swap/stablecoin-swap.mdx
new file mode 100644
index 0000000..0c60484
--- /dev/null
+++ b/content/docs/swap/stablecoin-swap.mdx
@@ -0,0 +1,61 @@
+---
+title: Stablecoin Swap
+description: Stablecoin Swap page
+---
+
+# Stablecoin Swap
+
+Swap Stablecoins in your lazerpay account using our APIs
+
+### Introduction
+
+You can make Stablecoins swaps from one coin to another directly from the Lazerpay dashboard or using our Swaps API endpoint.
+
+
+
+
+
+
+
+## Crypto Swap API
+
+Header', '', ''],
+ ['Authorization*', 'String
', 'Bearer YOUR_SECRET_KEY'],
+ ['Body', '', ''],
+ ['reference', 'String | Number
', 'Unique case sensitive transaction reference. If you do not pass this parameter, Lazerpay will generate a unique reference for you.'],
+ ['amount*', 'String | Number
', 'The amount you want to send out '],
+ ['from_coin*', 'String
', 'Crypto you want to swap from'],
+ ['to_coin*', 'String
', 'Crypto you want to swap to'],
+ ['metadata', 'Object
', 'Stringified JSON object of custom data. eg {type: "Crypto swap"}'],
+ ['blockchain*', 'String
', "The blockchain network you are sending to"]
+]} />
+
+
+
+
+### Important Note
+
+1. The blockchain field must be "Binance Smart Chain".
+2. The from_coin
field must either be "BUSD", "DAI", "USDT", or "USDC".
+3. The to_coin
field must either be "BUSD", "DAI", "USDT", or "USDC".
+4. The amount
field should be in your fiat currency. The currencies we support are USD, AED, GBP, EUR and NGN. Please reach out to support@lazerpay.finance if you would want us to support a currency.
+5. Also to_coin
and from_coin
cannot be the same.
+
+we only support the Binance smart chain for swaps. we will add more networks in the future.
diff --git a/content/docs/swap/swap-amount.mdx b/content/docs/swap/swap-amount.mdx
new file mode 100644
index 0000000..cb7e320
--- /dev/null
+++ b/content/docs/swap/swap-amount.mdx
@@ -0,0 +1,53 @@
+---
+title: Swap Amount
+description: Swap amount page
+---
+
+# Swap Crypto
+
+Get the amount you will receive on swap even before initiating the swap
+
+
+## Crypto Swap API
+
+Header', '', ''],
+ ['Authorization*', 'String
', 'Bearer YOUR_SECRET_KEY'],
+ ['Body', '', ''],
+ ['amount*', 'String | Number
', 'The amount you want to send out '],
+ ['from_coin*', 'String
', 'Crypto you want to swap from'],
+ ['to_coin*', 'String
', 'Crypto you want to swap to'],
+ ['blockchain*', 'String
', "The blockchain network you are sending to"]
+]} />
+
+
+
+
+
+
+
+### Important Note
+
+1. The blockchain field must be "Binance Smart Chain".
+2. The from_coin
field must either be "BUSD", "DAI", "USDT", or "USDC".
+3. The to_coin
field must either be "BUSD", "DAI", "USDT", or "USDC".
+4. The amount
field should be in your fiat currency. The currencies we support are USD, AED, GBP, EUR and NGN. Please reach out to support@lazerpay.finance if you would want us to support a currency.
+5. Also to_coin
and from_coin
cannot be the same.
+
+we only support the Binance smart chain for swaps. we will add more networks in the future.
diff --git a/content/docs/swap/webhooks.mdx b/content/docs/swap/webhooks.mdx
new file mode 100644
index 0000000..bea5ad7
--- /dev/null
+++ b/content/docs/swap/webhooks.mdx
@@ -0,0 +1,70 @@
+---
+title: Swap Webhooks
+description: Swap webhooks page
+---
+
+# Webhooks
+
+Listen to webhook events whenever certain actions occurs
+
+
+## What are webhooks?
+
+Webhooks are a way for you to subscribe to events that occur when an event involving your business occurs. This guide will walk through what webhooks are and how you can use them in order to get started with integrating them into your application.
+
+A webhook URL is an endpoint on your server where you can receive notifications about such events. When an event occurs, we'll make a POST request to that endpoint, with a JSON body containing the details about the event, including the type of event and the data associated with it.
+
+Rather than continuously polling the server to check if the state has changed, webhooks provide information to you as it becomes available, which is a lot more efficient and beneficial for developers.
+
+Here are some sample webhook payloads for deposit transactions:
+
+
+
+## Enabling webhooks
+
+You can specify your webhook URL on your dashboard where we would send POST requests to whenever an event occurs.
+
+Here's how to set up a webhook on your Lazerpay account:
+
+- Login to your dashboard and click on the Settings
+- Navigate to the API Keys and Webhooks tab
+- specify your webhook url and click on Update
+
+
+
+
+When testing, you can get an instant webhook URL by visiting webhook.site. This will allow you to inspect the received payload without having to write any code or set up a server.
+
+## Validating webhooks
+
+Every webhook event payload will contain a hashed authentication signature in the header which is computed by generating a hash from concatenating your API key and request body, using the HMAC SHA256 hash algorithm.
+
+In order to verify this signature came from Lazerpay, you simply have to generate the HMAC SHA256 hash and compare it with the signature received.
+
+
+
+## Responding to webhook request
+
+You must respond with a 200 OK status code. Any other response codes outside of the 2xx range, we will consider it will be considered as a failure, including 3xx codes. We don't care about the response body or headers.
+
+If we don't get a 200 OK status code, we'll retry the webhook every one minute for the next 24 hours.
+
+## Supporting Webhook Types
+
+Here are the webhooks request types we support. We'll add more to this list as we keep adding webhook supports for different API operations in the future.
+
+confirmed or failed
'],
+]} />
\ No newline at end of file
diff --git a/content/docs/transactions/index.mdx b/content/docs/transactions/index.mdx
new file mode 100644
index 0000000..c270a82
--- /dev/null
+++ b/content/docs/transactions/index.mdx
@@ -0,0 +1,62 @@
+---
+title: Transactions
+description: Transactions page
+---
+
+# Transactions
+
+Transactions are vital for businesses. Hence we provided this API endpoint which you can use to programmatically fetch and list all the transactions associated with your Lazerpay account.
+
+## All Transactions
+
+List all the transactions associated with your Lazerpay account.
+
+
+
+
+
+
+
+## Get transaction by transaction ID
+
+Fetch a specific transaction using its transaction ID.
+
+Path', '', ''],
+ [':transaction_id*', 'String
', 'Supply a transaction ID'],
+]} />
+
+
+
\ No newline at end of file
diff --git a/content/docs/transfers/bank-transfers.mdx b/content/docs/transfers/bank-transfers.mdx
index bb60d0a..04e44e8 100644
--- a/content/docs/transfers/bank-transfers.mdx
+++ b/content/docs/transfers/bank-transfers.mdx
@@ -1,6 +1,124 @@
---
-title: Bank Payouts
-description: Bank Payouts page
+title: Bank Transfers
+description: Bank transfers introduction page
---
-
\ No newline at end of file
+# Bank transfers
+
+Transfer directly to bank account using our payouts APIs
+
+
+
+In other to make bank transfers, you can use our transfers API endpoint or our Node JS SDK.
+
+## Create Bank Payout
+
+Add a new bank account to recieve payouts
+
+Header", "", "" ],
+ ["Autorization*", "String
", "Bearer YOUR_SECRET_KEY" ],
+ ["Body", "", "" ],
+ ["bank_name*", "String
", "Name of the bank, you can use Get Banks API to list all the supported banks" ],
+ ["bank_code*", "String
", "Bank code" ],
+ ["account_name*", "String
", "Account holder name of the account where you want payout" ],
+ ["account_number*", "String | Number
", "Account holder number of the account where you want payout" ],
+ ["currency*", "String
", "Currency of Payout, use get supported currencies API to list supported currency" ],
+ ["country*", "String
", "Country where bank is located, use Get Supported Countries API to list all the supported nations" ],
+ ["default", "Boolean
", "boolean" ],
+ ]}
+ />
+
+
+
+## Get all Bank Payouts
+
+Retrieve all the bank payouts associated with your account as Payout IDs
+
+
+
+## Delete Bank Payout
+
+Delete one or multiple Bank Payouts by passing Payout Ids as string array to payout end-point
+
+Header", "", "" ],
+ ["ids*", "String | Array
", 'example : { "ids": ["b406677c-c028-475f-b029-0df0d39c9321"] }' ],
+ ]}
+ />
+
+
+
+## Update Bank Payout
+
+Update an existing bank payout associated with your account
+
+
+
+## Get Supported Payout Countries
+
+Get list of already supported countries that supports bank payouts and respective currencies
+
+
+
+## Get Supported Payout Currencies
+
+Get a list of all the supported currencies for bank payouts
+
+
+
+## Get Banks
+
+Get a list of supported banks in a country
+
+Path", "", "" ],
+ ["ids*", "String
", 'Supported Countries: nigeria, ghana, kenya' ],
+ ]}
+ />
+
+
+
+## Get Payout Exchange Rate
+
+Get current Exchange rates
+
+Path", "", "" ],
+ ["coins*", "String
", 'supported coin = USDT, DAI, USDC, BUSD' ],
+ ["currency*", "String
", 'a supported currency, ex : NGN' ],
+ ]}
+ />
+
+
+
+
+## Initiate Bank Payout
+
+Initiate a bank payout
+
+Body", "", "" ],
+ ["bank_payout_id*", "String
", "bank payout id" ],
+ ["coin*", "String
", "ex: USDT" ],
+ ["amount*", "float
", "ex: 0.1" ],
+ ["metadata", "String
", "string" ]
+ ]}
+ />
+
+
\ No newline at end of file
diff --git a/content/docs/transfers/crypto-transfers.mdx b/content/docs/transfers/crypto-transfers.mdx
new file mode 100644
index 0000000..a0ab86a
--- /dev/null
+++ b/content/docs/transfers/crypto-transfers.mdx
@@ -0,0 +1,45 @@
+---
+title: Crypto Transfers
+description: Crypto transfers introduction page
+---
+
+# Crypto transfers
+
+Send crypto to an external wallet using our APIs
+
+
+
+In other to make crypto transfers, you can use our transfers API endpoint or our Node JS SDK.
+
+## Crypto Transfer API
+
+Header", "", "" ],
+ ["Autorization*", "String
", "Bearer YOUR_SECRET_KEY" ],
+ ["Body", "", "" ],
+ ["amount*", "String | Number
", "The amount you want to send out" ],
+ ["recipient*", "String
", "Wallet address of the recipient" ],
+ ["coin*", "String
", "Crypto you want to transfer" ],
+ ["blockchain*", "String
", "The blockchain network you are sending to" ],
+ ]}
+ />
+
+
+
+## Important things to Note
+1. The blockchain
field must be "Binance Smart Chain"
.
+2. The coin
field must either be "BUSD", "DAI", "USDT", or "USDC".
+
+We only support the Binance smart chain for withdrawals. We will add more networks in the future.
+
+
+
+## From Official JS SDK
+
+With the JS SDK, you can transfer the crypto in your Lazerpay balance to an external address.
+See sample code below:
+
+
diff --git a/content/docs/transfers/get-started.mdx b/content/docs/transfers/get-started.mdx
index 3273040..8f7d9dd 100644
--- a/content/docs/transfers/get-started.mdx
+++ b/content/docs/transfers/get-started.mdx
@@ -6,11 +6,9 @@ description: transfers introduction page
# Transfers
-The transfers API allows you to programmatically make fast, global payouts to your
-customers, vendors, and suppliers using traditional methods like bank wires, or make
-native crypto transfers
+The transfers API allows you to programmatically make fast, global payouts to your customers, vendors, and suppliers using traditional methods like bank wires, or make native crypto transfers
-
+
## Get started
@@ -18,5 +16,4 @@ Easily send money out of your account
-
diff --git a/content/docs/transfers/transfers-webhooks.mdx b/content/docs/transfers/transfers-webhooks.mdx
new file mode 100644
index 0000000..14cb650
--- /dev/null
+++ b/content/docs/transfers/transfers-webhooks.mdx
@@ -0,0 +1,69 @@
+---
+title: Webhooks
+description: payment introduction page
+---
+
+# Webhooks
+
+Listen to webhook events whenever certain actions occurs.
+
+
+
+## What are Webhooks?
+
+Webhooks are a way for you to subscribe to events that occur when an event involving your business occurs. This guide will walk through what webhooks are and how you can use them in order to get started with integrating them into your application.
+
+A webhook URL is an endpoint on your server where you can receive notifications about such events. When an event occurs, we'll make a POST request to that endpoint, with a JSON body containing the details about the event, including the type of event and the data associated with it.
+
+Rather than continuously polling the server to check if the state has changed, webhooks provide information to you as it becomes available, which is a lot more efficient and beneficial for developers.
+
+Here are some sample webhook paylods for deposit transactions.
+
+
+
+
+
+
+## Enabling Webhooks
+
+You can specify your webhook URL on your dashboard
where we would send POST
requests whenever an event occurs.
+
+Here’s how to set up a webhook on your Lazerpay account:
+
+1. Login to your dashboard
and click on Settings.
+2. Navigate to the API Keys and Webhooks tab.
+3. Specify your webhook url and click on Update.
+
+When testing, you can get an instant webhook URL by visiting webhook.site. This will allow you to inspect the received payload without having to write any code or set up a server.
+
+
+
+## Validating Webhook Signature
+
+Every webhook event payload will contain a hashed authentication signature in the header which is computed by generating a hash from concatenating your API key and request body, using the HMAC SHA256 hash algorithm.
+
+In order to verify this signature came from Lazerpay, you simply have to generate the HMAC SHA256 hash and compare it with the signature received.
+
+
+
+
+
+## Responding to webhooks request
+
+You must respond with a 200 OK
status code. Any other response code outside of the 2xx
range, we will consider it will be considered as a failure, including 3xx
codes. We don't care about the response body or headers.
+
+If we don't get a 200 OK status code, we'll retry the webhook every one minute for the next 24 hours.
+
+
+
+
+## Supported Webhooks Types
+
+Here are the webhooks request types we support. We'll add more to this list as we keep adding webhook supports for different API operations in the future.
+
+pending or confirmed
"],
+ ]}
+/>
\ No newline at end of file
diff --git a/content/docs/transfers/webhooks.mdx b/content/docs/transfers/webhooks.mdx
deleted file mode 100644
index 19491f4..0000000
--- a/content/docs/transfers/webhooks.mdx
+++ /dev/null
@@ -1,88 +0,0 @@
----
-title: Partial Payments
-description: partail payments page
----
-
-
-# Webhooks
-
-Listen to webhook event whenever certain action occurs.
-
-
-
-## What are Webhooks?
-
-Webhooks are a way for you to subscribe to events that occur when an event involving your
-business occurs. This guide will walk through what webhooks are and how you can use them in
- order to get started with integrating them into your application.
-
-A webhook URL is an endpoint on your server where you can receive notifications about such
- events. When an event occurs, we'll make a POST request to that endpoint, with a JSON body
- containing the details about the event, including the type of event and the data associated with it.
-
-
-
-
-
-Here are some sample webhook paylods for deposit transactions
-
-
-
-
-
-## Enabling WebHooks
-
-
-
-
-## Validating WebHook Signature
-
-Every webhook event payload will contain a hashed authentication signature in the header which
-is computed by generating a hash from concatenating your API key and request body,
-using the HMAC SHA256 hash algorithm.
-
-In order to verify this signature came from Lazerpay, you simply have to generate the HMAC
-SHA256 hash and compare it with the signature received.
-
-
-
-
-
-## Responding to WebHooks Request
-
-You must respond with a 200 ok
status code. Any other response code outside of the 2xx
-range, will be considered as a failure, including 3xx
codes. We don't
-care about the response body or header
-
-
-
-
-
-
-## Supported Webhook Types
-Here are the webhook request type that we support. We will add more as we keep adding
-webhook support for differnt API operations in the future.
-
-pending or confirmed
`
-],
-]}
-/>
-
-
-
-
-
-
diff --git a/content/docs/use-cases/ecommerce.mdx b/content/docs/use-cases/ecommerce.mdx
index 02a667b..2e4c56b 100644
--- a/content/docs/use-cases/ecommerce.mdx
+++ b/content/docs/use-cases/ecommerce.mdx
@@ -15,8 +15,4 @@ Sed magna nulla pellentesque semper enim.
-
-
-
-
-
+
\ No newline at end of file
diff --git a/content/docs/use-cases/get-started.mdx b/content/docs/use-cases/get-started.mdx
index 5ffcec4..808edff 100644
--- a/content/docs/use-cases/get-started.mdx
+++ b/content/docs/use-cases/get-started.mdx
@@ -116,5 +116,3 @@ route={"#"} />
-
-
\ No newline at end of file
diff --git a/data/snippets.ts b/data/snippets.ts
index 195f7a4..4f1830f 100644
--- a/data/snippets.ts
+++ b/data/snippets.ts
@@ -1,121 +1,2299 @@
export const snippets = {
- api: `export default function App({ Component, pageProps }) {
- return (
- <>
-
-
- >
- )
- }`,
- webHookPayload: `{
- "id": "183f0a97-9de8-4cdc-b130-e8dd5f06caf4",
- "reference": "3H1WTK8k8PC78p6TWEbKptT",
- "senderAddress": "0x8aFDD7Ee323E98adcB59445AE49118673950Ff19",
- "recipientAddress": "0x0B4d358D349809037003F96A3593ff9015E89efA",
- "actualAmount": 100,
- "amountPaid": 100,
- "amountReceived": 100,
- "coin": "USDT",
- "hash": "0xa3ef6266d29c096eb824112fcb32a90d42276bb1c94f88790f3d47a80992a9d8,
- "blockNumber": 19767423,
- "type": "withdrawal",
- "status": "confirmed",
- "network": "mainnet",
- "blockchain": "Binance Smart Chain",
- "status": "confirmed",
- "network": "mainnet",
- "blockchain": "Binance Smart Chain",
- "metadata": {} ,
- "createdAt": "2022-05-30T20:22:54.674Z",
- "updatedAt": "2022-05-30T20:22:54.674Z",
- "feeInCrypto": 0,
- "webhookType": "CRYPTO_TRANSFER"
-}`,
- webHookPayload2: `var crypto = require('crypto');
+ api:
+ `export default function App({ Component, pageProps }) {
+ return (
+ <>
+
+
+ >
+ )
+ }`,
+ customerInfoHTML:
+ ``,
+ customerInfoJS:
+ `
+`,
+ customerInfoPostCURL:
+ ` curl --location --request POST 'https://api.lazerpay.engineering/api/v1/transaction/initialize' \
+
+ --header 'x-api-key: YOUR_PUBLIC_KEY' \
+
+ --data-raw '{
+ "customer_name": "Abdulfatai Suleiman",
+ "customer_email": "static@gmail.com",
+ "currency": "USD",
+ "coin": "USDT",
+ "amount": "10",
+ accept_partial_payment:"true"
+ }’`,
+ customerInfoPostJs:
+ `const options = {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'x-api-key': YOUR_PUBLIC_KEY
+ },
+ body: JSON.stringify({
+ "customer_name": "Abdulfatai Suleiman",
+ "customer_email": "static@gmail.com",
+ "currency": "USD",
+ "coin": "USDT",
+ "amount": "10",
+ accept_partial_payment:"true"
+ })
+}
+fetch('https://api.lazerpay.engineering/api/v1/transaction/initialize', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ customerInfoReq201:
+ `{
+ "message": "Transaction initialized successfully",
+ "status": "success",
+ "data": {
+ "reference": "wfqweweqrtwerwrtwer45354545",
+ "businessName": "Lazerpay Finance",
+ "businessEmail": "abdulfataisuleiman67@gmail.com",
+ "businessLogo": "https://res.cloudinary.com/lazer/image/upload/v1637512933/logo-default_ufyz0x.svg",
+ "customerName": "Abdulfatai Suleiman",
+ "customerEmail": "staticdev20046@gmail.com",
+ "address": "0xcA20e971400F81F97fEc5416A963e8FA7F81aaE3",
+ "coin": "BUSD",
+ "cryptoAmount": 50.5,
+ "currency": "USD",
+ "fiatAmount": 50,
+ "feeInCrypto": 0.5,
+ "network": "testnet",
+ "acceptPartialPayment": true
+ }
+ "statusCode": 201
+}`,
+ customerInfoReq401:
+ `{
+ "message": "Transaction failed",
+ "status": "failed",
+ "statusCode": 401
+}`,
+ nodeSDKSample:
+ `const LazerPay = require('lazerpay-node-sdk');
+const lazerpay = new LazerPay(LAZER_PUBLIC_KEY, LAZER_SECRET_KEY);
+
+const payment_tx = async () => {
+ try {
+ const transaction_payload = {
+ reference: 'W6b8hV55l0435t3545435', // Replace with a reference you generated
+ customer_name: 'iamnotstatic.eth',
+ customer_email: 'abdulfataisuleiman67@gmail.com',
+ coin: 'USDC',
+ currency: 'USD',
+ fiatAmount: '100',
+ acceptPartialPayment: true // By default it's false
+ };
+ const response = await lazerpay.Payment.initializePayment(transaction_payload);
+ console.log(response);
+ } catch (error) {
+ console.log(error);
+ }
+}`,
+ nodeSDKSampleResponse:
+ `{
+ "reference": "wfqweweqrtwerwrtwer45354545",
+ "businessName": "Lazerpay Finance",
+ "businessEmail": "abdulfataisuleiman67@gmail.com",
+ "businessLogo": "https://res.cloudinary.com/lazer/image/upload/v1637512933/logo-default_ufyz0x.svg",
+ "customerName": "Abdulfatai Suleiman",
+ "customerEmail": "staticdev20046@gmail.com",
+ "address": "0xcA20e971400F81F97fEc5416A963e8FA7F81aaE3",
+ "coin": "BUSD",
+ "cryptoAmount": 50.5,
+ "currency": "USD",
+ "fiatAmount": 50,
+ "feeInCrypto": 0.5,
+ "fiatRate": 0.9988,
+ "cryptoRate": 1.001,
+ "network": "testnet",
+ "acceptPartialPayment": true
+}`,
+ verifyPaymentGetCURL:
+ `curl --location --request GET 'https://api.lazerpay.engineering/api/v1/transaction/verify/:address_or_reference' \
+
+--header 'x-api-key: YOUR_PUBLIC_KEY' \
+`,
+ verifyPaymentGetJs:
+ `const options = {
+ method: 'GET',
+ headers: {
+ 'x-api-key': YOUR_PUBLIC_KEY
+ },
+}
+fetch('https://api.lazerpay.engineering/api/v1/transaction/verify/:address_or_reference', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ verifyPaymentGetResponse200:
+ `{
+ "status": "success",
+ "statusCode": 200,
+ "message": "Verification successful",
+ "data": {
+ "id": "92924b81-11fd-418f-bc4f-3ddab7e79e6b",
+ "reference": "nGfVSuX3IK",
+ "senderAddress": "0x451dEFC27B45808078e875556AF06bCFdC697BA4",
+ "recipientAddress": "0xCfe4e688c47Af0689224da9B9bAB51B4dA38D11c",
+ "actualAmount": 0.51,
+ "amountPaid": 0.51,
+ "amountPaidFiat": 299.7984,
+ "fiatAmount": 300,
+ "amountReceived": 0.52,
+ "amountReceivedFiat": 305.6768,
+ "coin": "BUSD",
+ "currency": "NGN",
+ "hash": "0xc80d9fa8ba4b13c685ad12ffdeb2a6f803f7c3832f51cc0376e5ff9a74c6fd93",
+ "blockNumber": 16684797,
+ "type": "received",
+ "acceptPartialPayment": true,
+ "status": "confirmed",
+ "network": "mainnet",
+ "blockchain": "Binance Smart Chain",
+ "customer": {
+ "id": "1c4d885e-4058-45f0-8d74-ff79fe439e75",
+ "customerName": "Abdulfatai Suleiman",
+ "customerEmail": "abdulfataisuleiman67@gmail.com",
+ "customerPhone": null
+ }
+ "paymentLink": {},
+ "paymentButton": {},
+ "feeInCrypto": 0.01
+}`,
+ verifyPaymentGetResponse404:
+ `{
+ "message": "Transaction not found",
+ "status": "error"
+ "statusCode": 404,
+}`,
+ verifyPaymentNodeSDK:
+ `const LazerPay = require('lazerpay-node-sdk');
+const lazerpay = new LazerPay(LAZER_PUBLIC_KEY, LAZER_SECRET_KEY);
+const confirm_tx = async () => {
+ const confirm_tx = async () => {
+ try {
+ const payload = {
+ identifier: 'address generated or the reference generated by you from initializing payment',
+ };
+ const response = await lazerpay.Payment.confirmPayment(payload);
+ console.log(response);
+ } catch (error) {
+ console.log(error);
+ }
+ }
+};
+`,
+ createPaymentLinkCURL:
+ `curl --location --request POST 'https://api.lazerpay.engineering/api/v1/payment-links' \
+
+--header 'Authorization: Bearer YOUR_SECRET_KEY' \
+
+--data-raw '{
+ "title": "Model Rocket Design and Construction",
+ description": "This is for Model Rocket Design and Construction Book",
+ "amount": 100,
+ "type": "standard",
+ "logo": "https://media.istockphoto.com/photos/dubai-skyline-view-from-the-marasi-marina-in-city-business-bay-area-picture-id1309800132",
+ "currency": "USD",
+ "redirect_url": "https://example.com"
+}’`,
+ createPaymentLinkJs:
+ `const options = {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'Authorization': Bearer YOUR_SECRET_KEY
+ },
+ body: JSON.stringify({
+ "title": "Model Rocket Design and Construction",
+ "description": "This is for Model Rocket Design and Construction Book",
+ "amount": 100,
+ "type": "standard",
+ "logo": "https://media.istockphoto.com/photos/dubai-skyline-view-from-the-marasi-marina-in-city-business-bay-area-picture-id1309800132",
+ "currency": "USD",
+ "redirect_url": "https://example.com"
+ })
+}
+fetch('https://api.lazerpay.engineering/api/v1/payment-links', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ createPaymentLinkResponse201:
+ `{
+ "message": "Payment link created",
+ "data": {
+ "id": "5237aa97-56d2-45fc-923e-1265c227f268",
+ "reference": "msdl",
+ "title": "model rocket design and construction",
+ "description": "This is for Model Rocket Design and Construction Book wqrerertret werewre",
+ "amount": "100",
+ "currency": "USD",
+ "redirectUrl": "https://example.com",
+ "logo": "https://media.istockphoto.com/photos/dubai-skyline-view-from-the-marasi-marina-in-city-business-bay-area-picture-id1309800132",
+ "type": "standard",
+ "network": "mainnet",
+ "status": "active",
+ "paymentUrl": "https://lazerpay.finance/pay/model-rocket-design-and-construction-msdl",
+ "createdAt": "2022-04-15T17:04:20.492Z",
+ "updatedAt": "2022-04-15T17:04:20.492Z",
+ },
+ "statusCode": 201,
+ "status": "success"
+}`,
+ createPaymentLinkResponse401:
+ `{
+ "statusCode": 401,
+ "message": "Unsupported request, Please read our API documentation",
+ "status": "error"
+}`,
+ fetchAllPaymentLinkCURL:
+ `curl --location --request GET 'https://api.lazerpay.engineering/api/v1/payment-links’ \
+
+--header 'Authorization: Bearer YOUR_SECRET_KEY'`,
+ fetchAllPaymentLinkJs:
+ `const options = {
+ method: 'GET',
+ headers: {
+ 'x-api-key': Bearer YOUR_SECRET_KEY
+ }
+}
+fetch('https://api.lazerpay.engineering/api/v1/payment-links', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ fetchAllPaymentLinkResponse200:
+ `{
+ "status": "success",
+ "statusCode": 200,
+ "data": [
+ {
+ "id": "5237aa97-56d2-45fc-923e-1265c227f268",
+ "reference": "msdl",
+ "title": "model rocket design and construction",
+ "amount": "100",
+ "currency": "USD",
+ "redirectUrl": "https://example.com",
+ "logo": "https://media.istockphoto.com/photos/dubai-skyline-view-from-the-marasi-marina-in-city-business-bay-area-picture-id1309800132",
+ "type": "standard",
+ "network": "mainnet",
+ "status": "active",
+ "paymentUrl": "https://lazerpay.finance/pay/model-rocket-design-and-construction-msdl",
+ "createdAt": "2022-04-15T17:04:20.492Z",
+ "updatedAt": "2022-04-15T17:04:20.492Z",
+ }
+ ],
+ "count": 1,
+ "currentPage": 1,
+ "nextPage": null,
+ "prevPage": null,
+ "lastPage": 1
+}`,
+ fetchPaymentLinkCURL:
+ `curl --location --request GET 'https://api.lazerpay.engineering/api/v1/payment-links' \
+
+--header 'Authorization': 'Bearer YOUR_SECRET_KEY'
+ 'id_or_reference': 'Bearer ID_OR_REFERENCE'`,
+ fetchPaymentLinkJs:
+ `const options = {
+ method: 'GET',
+ headers: {
+ 'x-api- key': Bearer YOUR_SECRET_KEY,
+ 'id_or_reference': Bearer ID_OR_REFERENCE
+ }
+}
+fetch('https://api.lazerpay.engineering/api/v1/payment-links', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ fetchPaymentLinkResponse200:
+ `{
+ "message": "Payment link retrieved",
+ "data": {
+ "id": "5237aa97-56d2-45fc-923e-1265c227f268",
+ "reference": "msdl",
+ "title": "model rocket design and construction",
+ "amount": "100",
+ "currency": "USD",
+ "redirectUrl": "https://example.com",
+ "logo": "https://media.istockphoto.com/photos/dubai-skyline-view-from-the-marasi-marina-in-city-business-bay-area-picture-id1309800132",
+ "type": "standard",
+ "network": "mainnet",
+ "status": "active",
+ "paymentUrl": "https://lazerpay.finance/pay/model-rocket-design-and-construction-msdl",
+ "createdAt": "2022-04-15T17:04:20.492Z",
+ "updatedAt": "2022-04-15T17:04:20.492Z",
+ },
+ "statusCode": 200,
+ "status": "success"
+}`,
+ updatePaymentLinkCURL:
+ `curl --location --request PUT 'https://api.lazerpay.engineering/api/v1/transaction/initialize' \
+
+--header 'x-api- key': Bearer YOUR_SECRET_KEY
+--data-raw '{
+ "status": "inactive"
+}'`,
+ updatePaymentLinkJs:
+ `const options = {
+ method: 'PUT',
+ headers: {
+ 'x-api- key': Bearer YOUR_SECRET_KEY
+ },
+ body: JSON.stringify({
+ "status": "inactive"
+ })
+}
+fetch('https://api.lazerpay.engineering/api/v1/transaction/initialize', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ updatePaymentLinkResponse200:
+ `{
+ "message": "Payment link updated",
+ "data": {
+ "id": "5237aa97-56d2-45fc-923e-1265c227f268",
+ "reference": "msdl",
+ "title": "model rocket design and construction",
+ "amount": "100",
+ "currency": "USD",
+ "redirectUrl": "https://example.com",
+ "logo": "https://media.istockphoto.com/photos/dubai-skyline-view-from-the-marasi-marina-in-city-business-bay-area-picture-id1309800132",
+ "type": "standard",
+ "network": "mainnet",
+ "status": "inactive",
+ "paymentUrl": "https://lazerpay.finance/pay/model-rocket-design-and-construction-msdl",
+ "createdAt": "2022-04-15T17:04:20.492Z",
+ "updatedAt": "2022-04-15T17:04:20.492Z",
+ },
+ "statusCode": 200,
+ "status": "success"
+ }`,
+ webhookPayload:
+ `{
+ "id": "378b53b2-28fd-4cbd-8fe1-6786d251b7d4",
+ "reference": "MBnOcItpOaP0wkBWzx",
+ "senderAddress": "0x451dEFC27B45808078e875556AF06bCFdC697BA4",
+ "recipientAddress": "0x062FA9157C498C8Ca4E6AF204c132EDE2500e260",
+ "actualAmount": 0.51,
+ "amountPaid": 0.5,
+ "amountPaidFiat": 292.385,
+ "fiatAmount": 300,
+ "amountReceived": 0.52,
+ "amountReceivedFiat": 304.0804,
+ "coin": "BUSD",
+ "currency": "NGN",
+ "hash": "0xe929d55dde3717987191674616a0d3bbcf4b63080434b71fde41ec86aeab5fdd",
+ "blockNumber": 16509617,
+ "type": "received",
+ "acceptPartialPayment": true,
+ "status": "confirmed",
+ "network": "mainnet",
+ "blockchain": "Binance Smart Chain",
+ "paymentLink": {},
+ "paymentButton": {},
+ "metadata": {},
+ "customer": {
+ "id": "1c4d885e-4058-45f0-8d74-ff79fe439e75",
+ "name": "Abdulfatai Suleiman",
+ "email": "abdulfataisuleiman67@gmail.com",
+ "phone": null,
+ "shippingAddress": null
+ },
+ "merchantAddress": "0xFdd5352384162C3342aD018AF61d77538Bdb1257",
+ "feeInCrypto": 0.01,
+ "fiatRate": 0.9998,
+ "cryptoRate": 1,
+ "createdAt": "2022-03-30 13:00:42.614077",
+ "updatedAt": "2022-03-30 13:03:05.175609",
+ "webhookType": "DEPOSIT_TRANSACTION"
+}`,
+ webhookValidateSignature:
+ `var crypto = require('crypto');
"var secret = process.env.SECRET_KEY;
// Using Express
app.post("/my/webhook/url", function(req, res) {
+ //validate event
+ var hash = crypto.createHmac('sha256', secret).update(JSON.stringify(req.body), 'utf8').digest('hex');
- //validate event
- var hash = crypto.createHmac('sha256', secret).update(JSON.stringify(req.body), 'utf8').digest('hex');
+ if (hash == req.headers['x-lazerpay-signature']) {
+ // Retrieve the request's body
+ var event = req.body;
+ // Do something with event
+ }
+ res.send(200);
+});
+}`,
+ cryptoTransferPostCurl:
+ `curl --location --request POST 'https://api.lazerpay.engineering/api/v1/transfer'\
- if (hash == req.headers['x-lazerpay-signature']) {
- // Retrieve the request's body
- var event = req.body;
- var event = req.body;
- }
- res.send(200);
- });
-`,
- cryptoTransferSample3: `const Lazerpay = require('lazerpay-node-sdk');
+--header 'x-api-key: YOUR_SECRET_KEY' \
+
+--data-raw '{
+ "amount": "1",
+ "recipent": "0x0B4d358D349809037003F96A3593ff9015E89efA",
+ "coin": "USDT",
+ "blockchain": "Binance Smart Chain",
+}’`,
+ cryptoTransferPostJs:
+ `const options = {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'Authorization': Bearer YOUR_SECRET_KEY
+ },
+ body: JSON.stringify({
+ "amount": "1",
+ "recipent": "0x0B4d358D349809037003F96A3593ff9015E89efA",
+ "coin": "USDT",
+ "blockchain": "Binance Smart Chain",
+ })
+}
+fetch('https://api.lazerpay.engineering/api/v1/transfer', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ cryptoTransferRequest400:
+ `{
+ "message": "Insufficient funds, check your balance and try again",
+ "statusCode": 400,
+ "status": "error"
+}`,
+ cryptoTransferRequest200:
+ `{
+ "message": "Crypto transfer initiated successfully",
+ "status": "success",
+ "statusCode": 200
+
+}`,
+ crytoTransferSnippetJS:
+ `const Lazerpay = require('lazerpay-node-sdk');
const lazerpay = new Lazerpay(LAZER_PUBLIC_KEY, LAZER_SECRET_KEY);
const crypto_payout_tx = async () => {
- const transaction_payload = {
- amount: 1,
- recipient: '0x0B4d358D349809037003F96A3593ff9015E89efA', // address must be a bep20 address
- coin: 'BUSD',
- blockchain:’Binance Smart Chain’
- };
- try {
- const response = await lazer.Payout.transferCrypto(transaction_payload);
- console.log(response.error);
- } catch (e) {
- } catch (e) {
- console.log(e);
- }
- };
-`,
-
- webHookPayload3: ` {
- "id": "378b53b2-28fd-4cbd-8fe1-6786d251b7d4",
- "reference": "MBnOcItpOaP0wkBWzx",,
- "senderAddress": "0x451dEFC27B45808078e875556AF06bCFdC697BA4",
- "recipientAddress": "0x062FA9157C498C8Ca4E6AF204c132EDE2500e260",
- "actualAmount": 0.51,
- "amountPaid": 0.5,
- "amountPaidFiat": 292.385,
- "fiatAmount": 300,
- "amountReceived": 0.52,
- "amountReceivedFiat": 304.0804,
- "coin": "BUSD",
- "currency": "NGN",
- "hash": "0xe929d55dde3717987191674616a0d3bbcf4b63080434b71fde41ec86aeab5fdd",
- "blockNumber": 16509617,
- "type": "received",
- "acceptPartialPayment": true,
- "status": "confirmed",
- "network": "mainnet",
- "blockchain": "Binance Smart Chain",
- "paymentLink": {},
- "paymentButton": {},
- "customer": {
- "id": "1c4d885e-4058-45f0-8d74-ff79fe439e75",
- "customerName": "Abdulfatai Suleiman",
- "customerEmail": "abdulfataisuleiman67@gmail.com",
- "customerPhone”:null
- },
- "merchantAddress": "0xFdd5352384162C3342aD018AF61d77538Bdb1257",
- "feeInCrypto": 0.01,
- "webhookType": "DEPOSIT_TRANSACTION"
-}
-`,
- webhookpayload4: `var crypto = require('crypto');
-"var secret = process.env.SECRET_KEY;
+ const crypto_payout_tx = async () => {
+ amount: 1,
+ recipient: '0x0B4d358D349809037003F96A3593ff9015E89efA', // address must be a bep20 address
+ coin: 'BUSD',
+ blockchain:’Binance Smart Chain’
+ };
+ try {
+ const response = await lazer.Payout.transferCrypto(transaction_payload);
+ console.log(response.error);
+ } catch (e) {
+ console.log(e);
+ }
+};`,
+ depositWebhookJS: `
+ {
+ "id": "183f0a97-9de8-4cdc-b130-e8dd5f06caf4",
+ "reference": "3H1WTK8k8PC78p6TWEbKptT",
+ "senderAddress": "0x8aFDD7Ee323E98adcB59445AE49118673950Ff19",
+ "recipientAddress": "0x0B4d358D349809037003F96A3593ff9015E89efA",
+ "actualAmount": 100,
+ "amountPaid": 100,
+ "amountReceived": 100,
+ "coin": "USDT",
+ "hash": "0xa3ef6266d29c096eb824112fcb32a90d42276bb1c94f88790f3d47a80992a9d8",
+ "blockNumber": 19767423,
+ "type": "withdrawal",
+ "status": "confirmed",
+ "network": "mainnet",
+ "blockchain": "Binance Smart Chain",
+ "metadata": {} ,
+ "createdAt": "2022-05-30T20:22:54.674Z",
+ "updatedAt": "2022-05-30T20:22:54.674Z",
+ "feeInCrypto": 0,
+ "webhookType": "CRYPTO_TRANSFER"
+ }
+ `, validateWebhookJS:
+ `{
+ var crypto = require('crypto');
+ var secret = process.env.SECRET_KEY;
+ // Using Express
+ app.post("/my/webhook/url", function(req, res) {
+ //validate event
+ var hash = crypto.createHmac('sha256', secret).update(JSON.stringify(req.body), 'utf8').digest('hex');
+ if (hash == req.headers['x-lazerpay-signature']) {
+ // Retrieve the request's body
+ var event = req.body;
+ // Do something with event
+ }
+ res.send(200);
+ });
+}
+`,
+ getStartedAcceptPaymentPostCURL:
+ `curl https://api.lazerpay.com/transaction/initialize
+ -H "Authorization: Bearer YOUR_SECRET_KEY"
+ -H "Content-Type: application/json"
+ -X POST`,
+ createBankPayoutCURL: `curl --location --request POST 'https://api.lazerpay.engineering/api/v1/bank/payouts'\
+
+ --header 'x-api-key: YOUR_SECRET_KEY' \
+
+ --data-raw '{
+ "bank_name": "FIRST BANK PLC",
+ "bank_code": "11",
+ "account_name": "Abdulfatai Suleiman",
+ "account_number": "3125343111",
+ "currency": "NGN",
+ "country": "nigeria",
+ "state": "abuja",
+ "default": true
+ }’`,
+ createBankPayoutJs:
+ `const options = {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'x-api-key': Bearer YOUR_SECRET_KEY
+ },
+ body: JSON.stringify({
+ "bank_name": "FIRST BANK PLC",
+ "bank_code": "11",
+ "account_name": "Abdulfatai Suleiman",
+ "account_number": "3125343111",
+ "currency": "NGN",
+ "country": "nigeria",
+ "state": "abuja",
+ "default": true
+ })
+}
+fetch('https://api.lazerpay.engineering/api/v1/bank/payouts', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ createBankPayout200: `{
+ "status": "success",
+ "message": "Bank Payout created successfully",
+ "data": {
+ "bankName": "XXXX BANK LTD.",
+ "accountName": "XXX inc",
+ "accountNumber": "XXXXXX",
+ "accountType": "personal",
+ "routingNumber": "XXXXX",
+ "currency": "USD",
+ "country": "united state of america",
+ "state": "california",
+ "city": "san francisco, ca",
+ "address": "338 spear street",
+ "postalCode": "XXXXXX",
+ "network": "mainnet",
+ "default": true,
+ "deleted": false,
+ "deletedAt": null,
+ "street": null,
+ "id": "b008f1ea-ed3b-4187-b269-XXXXXXXX",
+ "status": "approved",
+ "createdAt": "2022-09-02T14:54:12.984Z",
+ "updatedAt": "2022-09-02T14:54:12.984Z"
+ },
+ "statusCode": 201
+ }`,
+ createBankPayout404: `{
+ // Response
+ }`,
+ getAllBankPayoutsGetCURL:
+ ` curl --location --request GET 'https://api.lazerpay.engineering/api/v1/bank/payouts \
+
+ --header 'x-api-key: YOUR_PUBLIC_KEY' \
+ `,
+ getAllBankPayoutsGetJs:
+ `const options = {
+ method: 'GET',
+ headers: {
+ 'x-api-key': Bearer YOUR_SECRET_KEY
+ }
+}
+fetch('https://api.lazerpay.engineering/api/v1/bank/payouts', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ getAllBankPayouts200:
+ ` {
+ "message": "Bank Payouts retrieved successfully",
+ "status": "success",
+ "statusCode": 200,
+ "data": [
+ {
+ "id": "b406677c-c028-475f-b029-0df0d39c9321",
+ "bankName": "kuda bank",
+ "bankCode": "090267",
+ "accountName": "suleiman abdulfatai",
+ "accountNumber": "2001670835",
+ "accountType": null,
+ "routingNumber": null,
+ "currency": "NGN",
+ "country": "nigeria",
+ "state": null,
+ "city": null,
+ "address": null,
+ "street": null,
+ "postalCode": null,
+ "network": "testnet",
+ "status": "approved",
+ "default": true,
+ "deleted": false,
+ "createdAt": "2022-08-31T20:55:01.801Z",
+ "updatedAt": "2022-08-31T20:55:01.801Z",
+ "deletedAt": null
+ }
+ ],
+ "count": 1,
+ "currentPage": 1,
+ "nextPage": null,
+ "prevPage": null,
+ "lastPage": 1
+ }`,
+ deleteBankPayoutCURL:
+ `curl --location --request DELETE 'https://api.lazerpay.engineering/api/v1/bank/payouts \
+
+--header 'x-api-key: YOUR_PUBLIC_KEY' \
+`,
+ deleteBankPayoutJs:
+ `const options = {
+ method: 'DELETE',
+ headers: {
+ 'ids': ["b406677c-c028-475f-b029-0df0d39c9321"],
+ 'x-api-key': Bearer YOUR_SECRET_KEY
+ }
+}
+fetch('https://api.lazerpay.engineering/api/v1/bank/payouts', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ deleteBankPayout200:
+ ` {
+ "status": "success",
+ "message": "Bank Payout deleted successfully",
+ "statusCode": 200
+ }`,
+ deleteBankPayout401:
+ ` {
+ // Response
+ }`,
+ updateBankPayoutCURL:
+ `curl --location --request PATCH 'https://api.lazerpay.engineering/api/v1/bank/payouts/'\
+
+--header 'x-api-key: YOUR_SECRET_KEY' \
+
+--data-raw '{
+ "default": true
+}’`,
+ updateBankPayoutJS:
+ `const options = {
+ method: 'PATCH',
+ headers: {
+ 'x-api-key': Bearer YOUR_SECRET_KEY
+ },
+ body: JSON.stringify({
+ "default": true
+ })
+}
+fetch('https://api.lazerpay.engineering/api/v1/bank/payouts/', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ updateBankPayout200: `{
+ "status": "success",
+ "message": "Bank Payout updated successfully",
+ "data": {
+ "id": "2e7fa635-b495-4788-a4ac-XXXXXX",
+ "bankName": "kuda bank",
+ "bankCode": "XXXX",
+ "accountName": "XXXX XXXX",
+ "accountNumber": "XXXXX",
+ "accountType": null,
+ "routingNumber": null,
+ "currency": "NGN",
+ "country": "nigeria",
+ "state": null,
+ "city": null,
+ "address": null,
+ "street": null,
+ "postalCode": null,
+ "network": "mainnet",
+ "status": "approved",
+ "default": true,
+ "deleted": false,
+ "createdAt": "2022-08-29T17:59:43.449Z",
+ "updatedAt": "2022-08-31T21:21:54.900Z",
+ "deletedAt": null
+ },
+ "statusCode": 200
+ }`,
+ getSupportCountryPayoutCURL: `curl --location --request GET 'https://api.lazerpay.engineering/api/v1/bank/payouts/countries'\
+
+--header 'x-api-key: YOUR_SECRET_KEY' \
+ `,
+ getSupportCountryPayoutJs:
+ `const options = {
+ method: 'GET',
+ headers: {
+ 'x-api-key': Bearer YOUR_SECRET_KEY
+ }
+}
+fetch('https://api.lazerpay.engineering/api/v1/bank/payouts/countries', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ getSupportCountryPayout200: `{
+ "message": "Bank Payout Countries retrieved successfully",
+ "data": [
+ {
+ "id": "477a477c-30e7-485a-9cc3-5ae54f4e492d",
+ "name": "Nigeria",
+ "code": "NG",
+ "logoUrl": "https://res.cloudinary.com/lazer/image/upload/v1655832428/Countries%20Logo/ngn-logo_tazf8g.svg",
+ "network": "testnet",
+ "status": "active",
+ "createdAt": "2022-08-24T18:40:29.213Z",
+ "updatedAt": "2022-08-24T18:40:29.213Z",
+ "currencies": [
+ {
+ "id": "2581c366-5a31-4250-9fee-ee078c8712e2",
+ "name": "Nigierian Naira",
+ "code": "NGN",
+ "symbol": "₦",
+ "logoUrl": "https://res.cloudinary.com/lazer/image/upload/v1655832428/Countries%20Logo/ngn-logo_tazf8g.svg",
+ "network": "testnet",
+ "status": "active",
+ "createdAt": "2022-08-24T18:40:29.282Z",
+ "updatedAt": "2022-08-24T18:40:29.282Z"
+ }
+ ]
+ },
+ ...
+ ],
+ "statusCode": 200,
+ "status": "success"
+}`,
+ getSupportCurrenciesPayoutCURL: `curl --location --request GET 'https://api.lazerpay.engineering/api/v1/bank/payouts/currencies'\
+
+--header 'x-api-key: YOUR_SECRET_KEY' \
+ `,
+ getSupportCurrenciesPayoutJs:
+ `const options = {
+ method: 'GET',
+ headers: {
+ 'x-api-key': Bearer YOUR_SECRET_KEY
+ }
+}
+fetch('https://api.lazerpay.engineering/api/v1/bank/payouts/currencies', options)
+.then((response) => response.json())
+.then((result) => console.log('Success', result))`,
+ getSupportCurrenciesPayout200: `{
+ "message": "Bank Payout Currencies retrieved successfully",
+ "data": [
+ {
+ "id": "2581c366-5a31-4250-9fee-ee078c8712e2",
+ "name": "Nigierian Naira",
+ "code": "NGN",
+ "symbol": "₦",
+ "logoUrl": "https://res.cloudinary.com/lazer/image/upload/v1655832428/Countries%20Logo/ngn-logo_tazf8g.svg",
+ "network": "testnet",
+ "status": "active",
+ "createdAt": "2022-08-24T18:40:29.282Z",
+ "updatedAt": "2022-08-24T18:40:29.282Z"
+ },
+ ...
+ ],
+ "statusCode": 200,
+ "status": "success"
+}`,
+ getBanksCURL: `curl --location --request GET 'https://api.lazerpay.engineering/api/v1/bank?country=Nigeria'\
+
+--header 'x-api-key: YOUR_SECRET_KEY' \`
+}`,
+ getBanksJs:
+ `const options = {
+ method: 'GET',
+ headers: {
+ 'x-api-key': Bearer YOUR_SECRET_KEY
+ }
+}
+fetch('https://api.lazerpay.engineering/api/v1/bank?country=Nigeria', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ getBanks200: `{
+ "status": "success",
+ "message": "Banks retrieved successfully",
+ "data": [
+ {
+ "code": "044",
+ "name": "Access Bank"
+ },
+ {
+ "code": "023",
+ "name": "Citi Bank"
+ },
+ {
+ "code": "050",
+ "name": "EcoBank PLC"
+ },
+ ...
+ ],
+ "statusCode": 200
+}`,
+ getPayoutExchangeRateCURL: `curl --location --request GET 'https://api.lazerpay.engineering/api/v1/bank/payouts/rate?coin=DAI¤cy={supported_currency}'\
+
+--header 'x-api-key: YOUR_SECRET_KEY' \`
+`,
+ getPayoutExchangeRateJs:
+ `const options = {
+ method: 'GET',
+ headers: {
+ 'x-api-key': Bearer YOUR_SECRET_KEY
+ }
+}
+fetch('https://api.lazerpay.engineering/api/v1/bank/payouts/rate?coin=DAI¤cy={supported_currency}', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ getPayoutExchangeRate200: `{
+ "message": "Bank payout exchange rate retrieved",
+ "status": "success",
+ "data": {
+ "coin": "DAI",
+ "currency": "NGN",
+ "rate": 690.07
+ },
+ "statusCode": 200
+}`,
+ initiateBankPayoutCURL: `curl --location --request POST 'https://api.lazerpay.engineering/api/v1/bank/payouts/initiate'\
+
+--header 'x-api-key: YOUR_SECRET_KEY' \
+
+--data-raw '{
+ "bank_payout_id": "3ad00043-f408-4da8-85e1-cbc28fbe0060",
+ "coin": "USDT",
+ "amount": 1
+}’
+`,
+ initiateBankPayoutJs:
+ `const options = {
+ method: 'POST',
+ headers: {
+ 'x-api-key': Bearer YOUR_SECRET_KEY
+ },
+ body: JSON.stringify({
+ "bank_payout_id": "3ad00043-f408-4da8-85e1-cbc28fbe0060",
+ "coin": "USDT",
+ "amount": 1
+ })
+}
+fetch('https://api.lazerpay.engineering/api/v1/bank/payouts/initiate', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ initiateBankPayout200: `{
+ "message": "Bank Payout initiated successfully",
+ "status": "success",
+ "statusCode": 200
+}`,
+ swapPostCURL:
+ `curl --location --request POST 'https://api.lazerpay.engineering/api/v1/transaction/initialize' \
+
+--header 'x-api-key: YOUR_PUBLIC_KEY' \
+
+--data-raw '{
+ "from_coin": "USDT",
+ "to_coin": "BUSD",
+ "amount": 0.01,
+ "blockchain": "Binance Smart Chain"
+}’`,
+ swapPostJs:
+ `const options = {
+ method: 'POST',
+ headers: {
+ 'x-api-key': Bearer YOUR_PUBLIC_KEY
+ },
+ body: JSON.stringify({
+ "from_coin": "USDT",
+ "to_coin": "BUSD",
+ "amount": 0.01,
+ "blockchain": "Binance Smart Chain"
+ })
+}
+fetch('https://api.lazerpay.engineering/api/v1/transaction/initialize', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))
+`,
+ swap200:
+ `{
+ "message": "Crypto swap initiated successfully",
+ "status": "success",
+ "statusCode": 200
+}
+`,
+ swap400:
+ `{
+ "message": "Insufficient funds, check your balance and try again",
+ "statusCode": 400,
+ "status": "error"
+}`,
+ swapAmountPostCURL:
+ `curl --location --request POST 'https://api.lazerpay.engineering/api/v1/swap/amount-out' \
+
+--header 'Authorization: YOUR_SECRET_KEY' \
+
+--data-raw '{
+ "from_coin": "USDT",
+ "to_coin": "BUSD",
+ "amount": 0.01,
+ "blockchain": "Binance Smart Chain"
+}’`,
+ swapAmountPostJs:
+ `const options = {
+ method: 'POST',
+ headers: {
+ 'Authorization': Bearer YOUR_SECRET_KEY
+ },
+ body: JSON.stringify({
+ "from_coin": "USDT",
+ "to_coin": "BUSD",
+ "amount": 0.01,
+ "blockchain": "Binance Smart Chain"
+ })
+ }
+ fetch('https://api.lazerpay.engineering/api/v1/swap/amount-out', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))
+ `,
+ swapAmountPost201:
+ `{
+ "message": "Crypto swap amount out retrieved successfully",
+ "status": "success",
+ "statusCode": 200,
+ "data": {
+ "fromCoin": "USDT",
+ "toCoin": "BUSD",
+ "amount": 99.68468056751414
+ }
+}`,
+ swapAmountPost400:
+ `{
+ "message": "Insufficient funds, check your balance and try again",
+ "statusCode": 400,
+ "status": "error"
+}`,
+ swapWebhookJson:
+ `{
+ "id": "63a51487-a570-45d5-b4ea-d6a9be46d77a",
+ "reference": "XebhrfHeO5nhkxGgkb2ag7CB1zI6",
+ "senderAddress": "0x8aFDD7Ee323E98adcB59445AE49118673950Ff19",
+ "recipientAddress": "0x8aFDD7Ee323E98adcB59445AE49118673950Ff19",
+ "actualAmount": 100,
+ "amountPaid": 99.98,
+ "hash": "0xd8f4d9badc12cfe0f82adf631eee8fd973a9fa801e4918510275c6e9b641b3dc",
+ "blockNumber": 19767429,
+ "type": "swap",
+ "status": "confirmed",
+ "network": "mainnet",
+ "blockchain": "Binance Smart Chain",
+ "metadata": {},
+ "fromCoin": "USDT",
+ "toCoin": "BUSD",
+ "createdAt": "2022-05-30T20:23:12.979Z",
+ "updatedAt": "2022-05-30T20:23:12.979Z",
+ "feeInCrypto": 0,
+ "webhookType": "CRYPTO_SWAP"
+}`,
+ swapWebhookSample:
+ `var crypto = require('crypto');
+var secret = process.env.SECRET_KEY;
// Using Express
app.post("/my/webhook/url", function(req, res) {
+ //validate event
+ var hash = crypto.createHmac('sha256', secret).update(JSON.stringify(req.body), 'utf8').digest('hex');
+ if (hash == req.headers['x-lazerpay-signature']) {
+ // Retrieve the request's body
+ var event = req.body;
+ // Do something with event
+ }
+ res.send(200);
+});`,
+ stableCoinSwapPostCURL:
+ `curl --location --request POST 'https://api.lazerpay.engineering/api/v1/transaction/initialize' \
+
+--header 'x-api-key: YOUR_PUBLIC_KEY' \
+
+--data-raw '{
+ "from_coin": "USDT",
+ "to_coin": "BUSD",
+ "amount": 0.01,
+ "blockchain": "Binance Smart Chain"
+}’`,
+ stableCoinSwapPostJs:
+ `const options = {
+ method: 'POST',
+ headers: {
+ 'x-api-key': Bearer YOUR_PUBLIC_KEY
+ },
+ body: JSON.stringify({
+ "from_coin": "USDT",
+ "to_coin": "BUSD",
+ "amount": 0.01,
+ "blockchain": "Binance Smart Chain"
+ })
+};
+fetch('https://api.lazerpay.engineering/api/v1/transaction/initialize', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))
+`,
+ stableCoinSwapPost201:
+ `{
+ "message": "Crypto swap amount initiated successfully",
+ "status": "success",
+ "statusCode": 200,
+ "data": {
+ "fromCoin": "USDT",
+ "toCoin": "BUSD",
+ "amount": 99.68468056751414
+ }
+}`,
+ stableCoinSwapPost400:
+ `{
+ "message": "Insufficient funds, check your balance and try again",
+ "statusCode": 400,
+ "status": "error"
+}`,
+ allTransactionsPostCurl:
+ `curl --location --request GET 'https://api.lazerpay.engineering/api/v1/transactions' \
- //validate event
- var hash = crypto.createHmac('sha256', secret).update(JSON.stringify(req.body), 'utf8').digest('hex');
+--Authorization 'x-api-key: YOUR_PUBLIC_KEY' \
- if (hash == req.headers['x-lazerpay-signature']) {
- // Retrieve the request's body
- var event = req.body;
- // Do something with event
- }
- res.send(200);
- });
+ 'Content-Type': 'application/JSON' \
+ `,
+ allTransactionsPostJs:
+ `const options = {
+ method: 'GET',
+ headers: {
+ 'Authorization': Bearer YOUR_SECRET_KEY
+ }
+};
+fetch('https://api.lazerpay.engineering/api/v1/transaction/initialize', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))
+`,
+ allTransactions200:
+ `{
+ "message": "Transactions retrieved successfully",
+ "status": "success",
+ "statusCode": 200,
+ "data": [
+ {
+ "id": "93754962-XXX-46a2-9858-XXX",
+ "walletId": "XXX-35a2-421f-XXX-d23149572fd7",
+ "externalId": null,
+ "reference": "Vuzr458xTg",
+ "shippingAddress": null,
+ "senderAddress": null,
+ "recipientAddress": "0x79A0cd9390XXXXX1D0651005128d4884094c",
+ "actualAmount": 10,
+ "amountPaid": 0,
+ "amountPaidFiat": 0,
+ "fiatAmount": 10,
+ "amountReceived": 0,
+ "amountReceivedFiat": 0,
+ "fee": 0.1,
+ "coin": "BUSD",
+ "currency": "USD",
+ "hash": null,
+ "blockNumber": null,
+ "type": "received",
+ "acceptPartialPayment": false,
+ "status": "pending",
+ "network": "testnet",
+ "paymentChannel": "crypto_transfer",
+ "blockchain": "Binance Smart Chain",
+ "fiatRate": 1,
+ "cryptoRate": 1,
+ "metadata": {},
+ "fromCoin": null,
+ "toCoin": null,
+ "createdAt": "2022-09-05T22:09:57.119Z",
+ "updatedAt": "2022-09-05T22:09:57.119Z",
+ "customer": {
+ "id": "XXXX-71cc-45e3-8562-XXXX",
+ "walletId": "33cbb77a-XXX-421f-XXX-d23149572fd7",
+ "name": "Abdulfatai Suleiman",
+ "email": "abdulfataisuleiman67@gmail.com",
+ "shippingAddress": null,
+ "phone": null,
+ "network": "testnet",
+ "createdAt": "2022-09-05T22:09:57.119Z",
+ "updatedAt": "2022-09-05T22:09:57.119Z"
+ },
+ "bankPayout": null
+ }
+ ]
+}`,
+ allTransactions400:
+ `{
+ // Response
+}`,
+ getTransactionPostCurl:
+ `curl --location --request GET 'https://api.lazerpay.engineering/api/v1/transactions/:transaction_id' \
+
+--Authorization 'x-api-key: YOUR_PUBLIC_KEY' \
+
+ 'Content-Type': 'application/JSON' \
+ `,
+ getTransactionPostJs:
+ `const options = {
+ method: 'GET',
+ headers: {
+ 'Authorization': Bearer YOUR_SECRET_KEY
+ }
+};
+fetch('https://api.lazerpay.engineering/api/v1/transaction/:transaction_id', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))
+`,
+ getTransaction200:
+ `{
+ "message": "Transactions retrieved successfully",
+ "status": "success",
+ "statusCode": 200,
+ "data": {
+ "id": "93754962-XXX-46a2-9858-XXX",
+ "walletId": "XXX-35a2-421f-XXX-d23149572fd7",
+ "externalId": null,
+ "reference": "Vuzr458xTg",
+ "shippingAddress": null,
+ "senderAddress": null,
+ "recipientAddress": "0x79A0cd9390XXXXX1D0651005128d4884094c",
+ "actualAmount": 10,
+ "amountPaid": 0,
+ "amountPaidFiat": 0,
+ "fiatAmount": 10,
+ "amountReceived": 0,
+ "amountReceivedFiat": 0,
+ "fee": 0.1,
+ "coin": "BUSD",
+ "currency": "USD",
+ "hash": null,
+ "blockNumber": null,
+ "type": "received",
+ "acceptPartialPayment": false,
+ "status": "pending",
+ "network": "testnet",
+ "paymentChannel": "crypto_transfer",
+ "blockchain": "Binance Smart Chain",
+ "fiatRate": 1,
+ "cryptoRate": 1,
+ "metadata": {},
+ "fromCoin": null,
+ "toCoin": null,
+ "createdAt": "2022-09-05T22:09:57.119Z",
+ "updatedAt": "2022-09-05T22:09:57.119Z",
+ "customer": {
+ "id": "XXXX-71cc-45e3-8562-XXXX",
+ "walletId": "33cbb77a-XXX-421f-XXX-d23149572fd7",
+ "name": "Abdulfatai Suleiman",
+ "email": "abdulfataisuleiman67@gmail.com",
+ "shippingAddress": null,
+ "phone": null,
+ "network": "testnet",
+ "createdAt": "2022-09-05T22:09:57.119Z",
+ "updatedAt": "2022-09-05T22:09:57.119Z"
+ },
+ "bankPayout": null
+ }
+}`,
+ getTransaction400:
+ `{
+ // Response
+}`,
+ allCustomersPostCurl:
+ `curl --location --request GET 'https://api.lazerpay.engineering/api/v1/customers' \
+
+--Authorization 'x-api-key: YOUR_PUBLIC_KEY' \
+
+ 'Content-Type': 'application/JSON' \
+ `,
+ allCustomersPostJs:
+ `const options = {
+ method: 'GET',
+ headers: {
+ 'Authorization': Bearer YOUR_SECRET_KEY
+ }
+};
+fetch('https://api.lazerpay.engineering/api/v1/transaction/customers', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))
+`,
+ allCustomers200:
+ `{
+ "message": "Customers retrieved successfully",
+ "status": "success",
+ "statusCode": 200,
+ "data": [
+ {
+ "id": "bc48cc84-71cc-XXX-8562-XXXXX",
+ "walletId": "33cbb77a-35a2-421f-a733-XXXXX",
+ "name": "Abdulfatai Suleiman",
+ "email": "abdulfataisuleiman@XXXX.com",
+ "shippingAddress": null,
+ "phone": null,
+ "network": "testnet",
+ "createdAt": "2022-09-05T22:09:57.119Z",
+ "updatedAt": "2022-09-05T22:09:57.119Z",
+ "transactions": [
+ {
+ "id": "XXXXXX-731e-46a2-XXXX-3495b35d99a6",
+ "walletId": "XXXXXX-35a2-421f-XXXX-d23149572fd7",
+ "reference": "Vuzr458xTg",
+ "senderAddress": null,
+ "recipientAddress": "0x79A0cd9390384XXXXXXXXX5128d4884094c",
+ "actualAmount": 10,
+ "amountPaid": 0,
+ "amountPaidFiat": 0,
+ "fiatAmount": 10,
+ "amountReceived": 0,
+ "amountReceivedFiat": 0,
+ "fee": 0.1,
+ "coin": "BUSD",
+ "currency": "USD",
+ "hash": null,
+ "blockNumber": null,
+ "type": "received",
+ "acceptPartialPayment": false,
+ "status": "pending",
+ "network": "testnet",
+ "paymentChannel": "crypto_transfer",
+ "blockchain": "Binance Smart Chain",
+ "fiatRate": 1,
+ "cryptoRate": 1,
+ "metadata": {},
+ "fromCoin": null,
+ "toCoin": null,
+ "createdAt": "2022-09-05T22:09:57.119Z",
+ "updatedAt": "2022-09-05T22:09:57.119Z"
+ }
+ ]
+ }
+ ],
+ "count": 1,
+ "currentPage": 1,
+ "nextPage": null,
+ "prevPage": null,
+ "lastPage": 1
+}`,
+ allCustomers400:
+ `{
+ // Response
+}`,
+ getCustomerPostCurl:
+ `curl --location --request GET 'https://api.lazerpay.engineering/api/v1/customers/:customer_id' \
+
+--Authorization 'x-api-key: YOUR_SECRET_KEY' \
+
+'Content-Type': 'application/JSON' \
+ `,
+ getCustomerPostJs:
+ `const options = {
+ method: 'GET',
+ headers: {
+ 'Authorization': Bearer YOUR_SECRET_KEY
+ }
+};
+fetch('https://api.lazerpay.engineering/api/v1/customers/:customer_id', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))
+`,
+ getCustomer200:
+ `{
+ "message": "Customers retrieved successfully",
+ "data": [
+ "id": "bc48cc84-71cc-XXX-8562-XXXXX",
+ "walletId": "33cbb77a-35a2-421f-a733-XXXXX",
+ "name": "Abdulfatai Suleiman",
+ "email": "abdulfataisuleiman@XXXX.com",
+ "shippingAddress": null,
+ "phone": null,
+ "network": "testnet",
+ "createdAt": "2022-09-05T22:09:57.119Z",
+ "updatedAt": "2022-09-05T22:09:57.119Z",
+ "transactions": [
+ {
+ "id": "XXXXXX-731e-46a2-XXXX-3495b35d99a6",
+ "walletId": "XXXXXX-35a2-421f-XXXX-d23149572fd7",
+ "reference": "Vuzr458xTg",
+ "senderAddress": null,
+ "recipientAddress": "0x79A0cd9390384XXXXXXXXX5128d4884094c",
+ "actualAmount": 10,
+ "amountPaid": 0,
+ "amountPaidFiat": 0,
+ "fiatAmount": 10,
+ "amountReceived": 0,
+ "amountReceivedFiat": 0,
+ "fee": 0.1,
+ "coin": "BUSD",
+ "currency": "USD",
+ "hash": null,
+ "blockNumber": null,
+ "type": "received",
+ "acceptPartialPayment": false,
+ "status": "pending",
+ "network": "testnet",
+ "paymentChannel": "crypto_transfer",
+ "blockchain": "Binance Smart Chain",
+ "fiatRate": 1,
+ "cryptoRate": 1,
+ "metadata": {},
+ "fromCoin": null,
+ "toCoin": null,
+ "createdAt": "2022-09-05T22:09:57.119Z",
+ "updatedAt": "2022-09-05T22:09:57.119Z"
+ }
+ ]
+ },
+ "status": "success",
+ "statusCode": 200
+}`,
+ getCustomer400:
+ `{
+ // Response
+}`,
+ createProductCurl:
+ `curl --location --request POST 'https://api.lazerpay.engineering/api/v1/products' \
+
+--header 'x-api-key: YOUR_PUBLIC_KEY' \
+
+--data-raw '{
+ "name": "book",
+ "description": "Atomic Habits",
+ "amount": "https://my-fake-cover-image.jpeg",
+ "blockchain": [ { "currency": "USD", "amount": 80000 } ]
+}’`,
+ createProductJs:
+ `const options = {
+ method: 'POST',
+ headers: {
+ 'Authorization': 'Bearer YOUR_SECRET_KEY',
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify({
+ "name": "book",
+ "description": "Atomic Habits",
+ "amount": "https://my-fake-cover-image.jpeg",
+ "blockchain": [ { "currency": "USD", "amount": 80000 } ]
+ })
+};
+fetch('https://api.lazerpay.engineering/api/v1/products', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ createProduct201:
+ `{
+ "message": "Product created successfully",
+ "data": {
+ "name": "not fake product",
+ "description": "not fake description",
+ "businessId": "3dc8842d-fbdc-41a8-ad61-c023afc3a391",
+ "network": "testnet",
+ "prices": [
+ {
+ "id": "f024a92c-ff80-40fe-8cc2-e12e8aa1087d",
+ "amount": 80000,
+ "currency": {
+ "name": "United States Dollar",
+ "symbol": "USD"
+ },
+ "pricingType": "standard"
+ }
+ ],
+ "image": {
+ "url": "https://my-fake-cover-image.jpeg",
+ "createdAt": "2022-09-05T15:14:36.721Z"
+ },
+ "id": "3a78a41a-305b-4061-aea5-8f0f1994fd00",
+ "createdAt": "2022-09-05T15:14:36.721Z",
+ "updatedAt": "2022-09-05T15:14:36.721Z",
+ "active": true
+ },
+ "statusCode": 201,
+ "status": "success"
+}`,
+ createProduct400:
+ `{
+ "statusCode": 400,
+ "message": [
+ "name must be a string",
+ "name should not be empty",
+ "description must be a string",
+ "description should not be empty"
+ ],
+ "error": "Bad Request"
+}`,
+ findProductsCurl:
+ `curl --location --request GET 'https://api.lazerpay.engineering/api/v1/products?network={}{{network}}' \
+
+--header 'x-api-key: YOUR_PUBLIC_KEY' \
+
+ 'Content-Type': 'application/json'
+`,
+ findProductsJs:
+ `const options = {
+ method: 'GET',
+ headers: {
+ 'Authorization': 'Bearer YOUR_SECRET_KEY',
+ 'Content-Type': 'application/json'
+ }
+};
+fetch('https://api.lazerpay.engineering/api/v1/products?network={}{{network}}', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ findProducts200:
+ `{
+ "status": "success",
+ "statusCode": 200,
+ "data": [
+ {
+ "id": "3a78a41a-305b-4061-aea5-XXXX",
+ "name": "Book",
+ "createdAt": "2022-09-05T15:14:36.721Z",
+ "updatedAt": "2022-09-05T15:14:36.721Z",
+ "description": "Atomic Habits",
+ "active": true,
+ "businessId": "3dc8842d-XX-XXX-ad61-c023afc3a391",
+ "network": "testnet",
+ "prices": [
+ {
+ "id": "XX-ff80-40fe-XX-e12e8aa1087d",
+ "amount": "80000",
+ "currency": {
+ "name": "United States Dollar",
+ "symbol": "USD"
+ }
+ }
+ ],
+ "image": {
+ "url": "https://my-fake-cover-image.jpeg",
+ "publicId": "default",
+ "folder": "products"
+ }
+ }
+ ],
+ "count": 1,
+ "currentPage": 1,
+ "nextPage": null,
+ "prevPage": null,
+ "lastPage": 1
+}`,
+ findProducts400:
+ `{
+ // Response
+}`,
+ getProductCurl:
+ `curl --location --request GET 'https://api.lazerpay.engineering/api/v1/products/:id' \
+
+--header 'x-api-key: YOUR_PUBLIC_KEY' \
+
+ 'Content-Type': 'application/json'
+`,
+ getProductJs:
+ `const options = {
+ method: 'GET',
+ headers: {
+ 'Authorization': 'Bearer YOUR_SECRET_KEY',
+ 'Content-Type': 'application/json'
+ }
+};
+fetch('https://api.lazerpay.engineering/api/v1/products/:id', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ getProduct200:
+ `{
+ "message": "Product fetched successfully",
+ "data": {
+ "id": "978ba584-839a-4af2-a673-4bc3b814b54a",
+ "name": "Guccie Purse",
+ "createdAt": "2022-07-25T04:56:07.810Z",
+ "updatedAt": "2022-07-25T04:56:07.810Z",
+ "description": "Bag of Guccie Stuff With sun",
+ "active": true,
+ "userId": "51afc3cd-cbb3-43ac-a404-db2897915ecc",
+ "businessId": "e4b23ecf-9d10-4b4f-9582-20700cf00d1b",
+ "network": "testnet",
+ "prices": [
+ {
+ "id": "ec99bcce-7a57-47c2-adc6-b284db779841",
+ "createdAt": "2022-07-25T04:56:07.810Z",
+ "amount": "8.00",
+ "pricingType": "standard",
+ "currency": {
+ "id": "dedb6fb9-bc74-4a72-a8ce-f6fcc6435de0",
+ "name": "United States Dollar",
+ "symbol": "USD",
+ "logo": null,
+ "status": "active",
+ "createdAt": "2022-07-22T09:05:15.164Z",
+ "updatedAt": "2022-07-22T09:05:15.164Z"
+ },
+ "paymentLinks": []
+ }
+ ],
+ "image": {
+ "id": "b74d0cd5-f972-454f-9d4d-a29a9255098c",
+ "url": "https://res.cloudinary.com/lazer/image/upload/v1654710452/product_img_yfgeb6.png",
+ "publicId": "default",
+ "createdAt": "2022-07-25T04:56:07.810Z",
+ "folder": "products"
+ }
+ },
+ "statusCode": 200,
+ "status": "success"
+}`,
+ getProduct400:
+ `{
+ // Response
+}`,
+ updateProductCurl:
+ `curl --location --request PUT 'https://api.lazerpay.engineering/api/v1/products/:id' \
+
+--header 'Authorization: Bearer YOUR_SECRET_KEY' \
+
+ 'Content-Type': 'application/json'
+
+--data-raw '{
+ "name": "fake product name",
+ "description": "fake description",
+ "cover_photo": "https://my-fake-cover-image-update.jpeg",
+ "active": false
+}’`,
+ updateProductJs:
+ `const options = {
+ method: 'POST',
+ headers: {
+ 'Authorization': 'Bearer YOUR_SECRET_KEY',
+ 'Content-Type': 'application/json'
+ }
+ body: JSON.stringify({
+ "name": "fake product name",
+ "description": "fake description",
+ "cover_photo": "https://my-fake-cover-image-update.jpeg",
+ "active": false
+ })
+};
+fetch('https://api.lazerpay.engineering/api/v1/products/:id', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ updateProduct200:
+ `{
+ "message": "Product fetched successfully",
+ "data": {
+ "id": "978ba584-839a-4af2-a673-4bc3b814b54a",
+ "name": "Chlorine Bubble Gum",
+ "createdAt": "2022-07-25T04:56:07.810Z",
+ "updatedAt": "2022-07-25T05:01:28.949Z",
+ "description": "Tons Of Gums",
+ "active": false,
+ "userId": "51afc3cd-cbb3-43ac-a404-db2897915ecc",
+ "businessId": "e4b23ecf-9d10-4b4f-9582-20700cf00d1b",
+ "network": "testnet",
+ "prices": [
+ {
+ "id": "ec99bcce-7a57-47c2-adc6-b284db779841",
+ "createdAt": "2022-07-25T04:56:07.810Z",
+ "amount": "8.00",
+ "pricingType": "standard",
+ "currency": {
+ "id": "dedb6fb9-bc74-4a72-a8ce-f6fcc6435de0",
+ "name": "United States Dollar",
+ "symbol": "USD",
+ "logo": null,
+ "status": "active",
+ "createdAt": "2022-07-22T09:05:15.164Z",
+ "updatedAt": "2022-07-22T09:05:15.164Z"
+ },
+ "paymentLinks": []
+ }
+ ],
+ "image": {
+ "id": "b74d0cd5-f972-454f-9d4d-a29a9255098c",
+ "url": "https://res.cloudinary.com/lazer/image/upload/v1654710452/product_img_yfgeb6.png",
+ "publicId": "default",
+ "createdAt": "2022-07-25T04:56:07.810Z",
+ "folder": "products"
+ }
+ },
+ "statusCode": 200,
+ "status": "success"
+}`,
+ updateProduct400:
+ `{
+ "statusCode": 400,
+ "message": [
+ "description must be a string",
+ "description should not be empty"
+ ],
+ "error": "Bad Request"
+}`,
+ getPricesCurl:
+ `curl --location --request GET 'https://api.lazerpay.engineering/api/v1/products/:product_id/prices?take=3&page=1' \
+--header 'x-api-key: YOUR_PUBLIC_KEY' \
+
+ 'Content-Type': 'application/json'
`,
+ getPricesJs:
+ `const options = {
+ method: 'GET',
+ headers: {
+ 'Authorization': 'Bearer YOUR_SECRET_KEY',
+ 'Content-Type': 'application/json'
+ }
};
+fetch('https://api.lazerpay.engineering/api/v1/products/:product_id/prices?take=3&page=1', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ getPrices200:
+ `{
+ "status": "success",
+ "statusCode": 200,
+ "data": [
+ {
+ "id": "69d58386-0b29-449d-9401-57ab11ff7c5d",
+ "createdAt": "2022-06-25T17:06:23.531Z",
+ "amount": "20.00",
+ "pricingType": "standard",
+ "currency": {
+ "name": "United Emirates Dirham",
+ "symbol": "AED"
+ },
+ "paymentLinks": [
+ {
+ "id": "a31b321a-d9cf-4377-bffa-79ffafc3387a",
+ "createdAt": "2022-06-27T08:20:32.705Z",
+ "title": "red silver shit",
+ "slug": "BZa3Suc4",
+ "isActive": true
+ },
+ {
+ "id": "331162c3-d9cf-4026-9d22-887b8de5f635",
+ "createdAt": "2022-07-06T17:25:37.875Z",
+ "title": "chlorine candy II",
+ "slug": "J6pkthAE",
+ "isActive": true
+ },
+ {
+ "id": "a29af358-a811-44cd-aab8-8638090434a9",
+ "createdAt": "2022-07-08T18:50:11.315Z",
+ "title": "chlorine candy II",
+ "slug": "G_L9l4Z8",
+ "isActive": true
+ },
+ {
+ "id": "98ce3ecb-742b-4ded-8420-fee4223cb0a7",
+ "createdAt": "2022-07-08T18:50:19.247Z",
+ "title": "chlorine candy II",
+ "slug": "MDKKrLAC",
+ "isActive": true
+ }
+ ]
+ }
+ ],
+ "count": 1,
+ "currentPage": 1,
+ "nextPage": null,
+ "prevPage": null,
+ "lastPage": 1
+}`,
+ getPrices400:
+ `{
+ // Response
+}`,
+ getLinksByPriceCurl:
+ `curl --location --request GET 'https://api.lazerpay.engineering/api/v1/products/:price_id' \
+
+--header 'x-api-key: YOUR_PUBLIC_KEY' \
+
+ 'Content-Type': 'application/json'
+`,
+ getLinksByPriceJs:
+ `const options = {
+ method: 'GET',
+ headers: {
+ 'Authorization': 'Bearer YOUR_SECRET_KEY',
+ 'Content-Type': 'application/json'
+ }
+};
+fetch('https://api.lazerpay.engineering/api/v1/products/:price_id', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ getLinksByPrice200:
+ `{
+ "data": [
+ {
+ "id": "XXX-XX-4bf7-af7f-2cceefcc12bb",
+ "createdAt": "2022-06-26T17:30:43.729Z",
+ "title": "Candy II",
+ "slug": "0B7tKYKB",
+ "isActive": true
+ },
+ {
+ "id": "11f0ad05-acd9-XX-99a8-XXXX",
+ "createdAt": "2022-06-28T08:34:32.041Z",
+ "title": "chlorine candy II",
+ "slug": "mEeqzLI3",
+ "isActive": true
+ }
+ ],
+ "status": "success",
+ "statusCode": 200,
+ "message": "Price links fetched successfully"
+}`,
+ getLinksByPrice400:
+ `{
+ // Response
+}`,
+ addPriceCurl:
+ `curl --location --request POST 'https://api.lazerpay.engineering/api/v1/products/:id/pricing' \
+
+--header 'Authorization: Bearer YOUR_SECRET_KEY' \
+
+ 'Content-Type': 'application/json'
+
+--data-raw '{
+ "amount" : 500000,
+ "currency": "ngn"
+}’`,
+ addPriceJs:
+ `const options = {
+ method: 'POST',
+ headers: {
+ 'Authorization': 'Bearer YOUR_SECRET_KEY',
+ 'Content-Type': 'application/json'
+ }
+ body: JSON.stringify({
+ "amount" : 500000,
+ "currency": "ngn"
+ })
+};
+fetch('https://api.lazerpay.engineering/api/v1/products/:id/pricing', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ addPrice201:
+ `{
+ "message": "Price added successfully",
+ "statusCode": 201,
+ "status": "success",
+ "data": {
+ "amount": 5000,
+ "id": "96688e79-a7b5-4e72-bb67-82bbbfeb6708",
+ "createdAt": "2022-07-25T05:23:41.707Z",
+ "pricingType": "standard",
+ "currency": {
+ "name": "United Emirates Dirham",
+ "symbol": "AED"
+ }
+ }
+}`,
+ addPrice400:
+ `{
+ // Response
+}`,
+ deletePriceCurl:
+ `curl --location --request DELETE 'https://api.lazerpay.engineering/api/v1/products/:price_id' \
+
+--header 'x-api-key: YOUR_PUBLIC_KEY' \
+
+ 'Content-Type': 'application/json'
+`,
+ deletePriceJs:
+ `const options = {
+ method: 'DELETE',
+ headers: {
+ 'Authorization': 'Bearer YOUR_SECRET_KEY',
+ 'Content-Type': 'application/json'
+ }
+};
+fetch('https://api.lazerpay.engineering/api/v1/products/:price_id', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ deletePrice200:
+ `{
+ "message": "Price deleted successfully",
+ "statusCode": 200,
+ "status": "success"
+}`,
+ deletePrice400:
+ `{
+ // Response
+}`,
+ deleteProductCurl:
+ `curl --location --request DELETE 'https://api.lazerpay.engineering/api/v1/products/:id' \
+
+--header 'x-api-key: YOUR_PUBLIC_KEY' \
+
+ 'Content-Type': 'application/json'
+`,
+ deleteProductJs:
+ `const options = {
+ method: 'DELETE',
+ headers: {
+ 'Authorization': 'Bearer YOUR_SECRET_KEY',
+ 'Content-Type': 'application/json'
+ }
+};
+fetch('https://api.lazerpay.engineering/api/v1/products/:id', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ deleteProduct200:
+ `{
+ "message": "Product deleted successfully",
+ "data": "9117c54c-56d6-4ba1-92d3-a92f051c38c1",
+ "statusCode": 200,
+ "status": "success"
+}`,
+ deleteProduct400:
+ `{
+ // Response
+}`,
+ createStandardPaymentCurl:
+ `curl --location --request POST 'https://api.lazerpay.engineering/api/v1/payment_links' \
+
+--data-raw '{
+ "title" : "Payment for Merchandise",
+ "description": "School bags",
+ "options" :{
+ "collect_phone": true,
+ "allow_promo": true,
+ "collect_address":true
+ },
+ "action": {
+ "redirect": true,
+ "redirect_url": "https://local.com",
+ "show_confirmation_page": false,
+ "success_message": "thank you budd!"
+ },
+ "cart": [
+ {
+ "price_id": "4f6a2f7f-3400-4f47-8973-fa8bb2f5d483",
+ "quantity": 10,
+ "quantity_adjustable": false
+ }
+ ]
+}`,
+ createStandardPaymentJs:
+ `const options = {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+ body: JSON.stringify({
+ "title" : "Payment for Merchandise",
+ "description": "School bags",
+ "options" :{
+ "collect_phone": true,
+ "allow_promo": true,
+ "collect_address":true
+ },
+ "action": {
+ "redirect": true,
+ "redirect_url": "https://local.com",
+ "show_confirmation_page": false,
+ "success_message": "thank you budd!"
+ },
+ "cart": [
+ {
+ "price_id": "4f6a2f7f-3400-4f47-8973-fa8bb2f5d483",
+ "quantity": 10,
+ "quantity_adjustable": false
+ }
+ ]
+ })
+};
+fetch('https://api.lazerpay.engineering/api/v1/payment_links', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ createStandardPayment201Cart:
+ `{
+ "data": {
+ "charge": {},
+ "cart": {
+ "id": "fb77e4c7-f99f-4eb1-823a-ac63b6022dd4",
+ "createdAt": "2022-09-05T15:45:40.111Z",
+ "updatedAt": "2022-09-05T15:45:40.111Z",
+ "items": [
+ {
+ "id": 4,
+ "quantity": 20,
+ "quantityAdjustable": false,
+ "price": {
+ "currency": "NGN",
+ "amount": "500000",
+ "id": "d2f6f438-e866-4588-970e-d0e093b4c4ac"
+ },
+ "product": {
+ "id": "3a78a41a-305b-4061-aea5-8f0f1994fd00",
+ "name": "fake product shit mehhhn",
+ "description": "fake description",
+ "image": "https://my-fake-cover-image-update.jpeg"
+ }
+ }
+ ]
+ },
+ "type": "standard",
+ "isActive": true,
+ "network": "testnet",
+ "slug": "BFxwoXCs",
+ "id": "cf5e68a5-8125-42ec-bbf1-660fc52d0de3",
+ "title": "Payment for Merchandise With Cash",
+ "description": "Pay for some nice guccie bags",
+ "businessId": "3dc8842d-fbdc-41a8-ad61-c023afc3a391",
+ "options": {
+ "collectAddress": true,
+ "collectPhone": true,
+ "allowPromotion": true
+ },
+ "action": {
+ "successMessage": "thank you budd!",
+ "redirectUrl": "https://local.me",
+ "redirect": true,
+ "showConfirmationPage": false
+ },
+ "url": "https://lazerpay.finance/pay/BFxwoXCs",
+ "createdAt": "2022-09-05T15:45:40.111Z",
+ "updatedAt": "2022-09-05T15:45:40.111Z"
+ },
+ "message": "Payment link created successfully",
+ "status": "success",
+ "statusCode": 201
+}`,
+ createStandardPayment201Charge:
+ `{
+ "data": {
+ "charge": {
+ "amount": "84000",
+ "currency": "NGN"
+ },
+ "cart": {},
+ "type": "standard",
+ "isActive": true,
+ "network": "testnet",
+ "slug": "EhnESXox",
+ "id": "ac57979f-7494-467a-95d5-ff01e17b856d",
+ "title": "Payment for Merchandise With Cash",
+ "description": "Pay for some nice guccie bags",
+ "businessId": "3dc8842d-fbdc-41a8-ad61-c023afc3a391",
+ "options": {
+ "collectAddress": true,
+ "collectPhone": true,
+ "allowPromotion": true
+ },
+ "action": {
+ "successMessage": "thank you budd!",
+ "redirectUrl": "https://local.me",
+ "redirect": true,
+ "showConfirmationPage": false
+ },
+ "url": "https://lazerpay.finance/pay/EhnESXox",
+ "createdAt": "2022-09-05T15:51:10.018Z",
+ "updatedAt": "2022-09-05T15:51:10.018Z"
+ },
+ "message": "Payment link created successfully",
+ "status": "success",
+ "statusCode": 201
+}`,
+ updateStandardPaymentCurl:
+ `curl --location --request PUT 'https://api.lazerpay.engineering/api/v1/payment_links' \
+
+--data-raw '{
+ "title": "red silver shit with charge",
+ "is_active": true,
+ "description": "really really good payment stuff",
+ "options": {
+ "collect_phone": true,
+ "allow_promo": true,
+ "collect_address": true
+ },
+ "action": {
+ "redirect": false,
+ "redirect_url": "https://local.com/confirm",
+ "show_confirmation_page": false,
+ "success_message": "thank you budd!"
+ },
+ "charge":{
+ "amount":150,
+ "currency": "USD"
+ },
+ "id": "9228de95-b080-4fe7-aefe-483123a2fc88"
+}`,
+ updateStandardPaymentJs:
+ `const options = {
+ method: 'PUT',
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+ body: JSON.stringify({
+ "title": "red silver shit with charge",
+ "is_active": true,
+ "description": "really really good payment stuff",
+ "options": {
+ "collect_phone": true,
+ "allow_promo": true,
+ "collect_address": true
+ },
+ "action": {
+ "redirect": false,
+ "redirect_url": "https://local.com/confirm",
+ "show_confirmation_page": false,
+ "success_message": "thank you budd!"
+ },
+ "charge":{
+ "amount":150,
+ "currency": "USD"
+ },
+ "id": "9228de95-b080-4fe7-aefe-483123a2fc88"
+ })
+};
+fetch('https://api.lazerpay.engineering/api/v1/payment_links', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ updateStandardPayment200Cart:
+ `{
+ "title" : "red silver shit",
+ "description": "i said my silvers and shit ohh",
+ "options" : {
+ "collect_phone":true,
+ "allow_promo": true,
+ "collect_address":true
+ },
+ "action": {
+ "redirect": true,
+ "redirect_url": "https://local.com/confirm",
+ "confirmation_page": true,
+ "success_message": "thank you budd!"
+ },
+ "cart":
+ [
+ {
+ "item_id": 154,
+ "price_id": "510e0cc5-25af-4b78-9c6c-acdd27f6afcc",
+ "quantity": 70,
+ "quantity_adjustable": true
+ }
+ ],
+ "business_id": "56b4d15d-955b-4186-b2fa-b967dc003926",
+ "network": "{{network}}",
+ "id": "eca28731-f634-4bac-8d72-127d6c9a9555"
+}`,
+ updateStandardPayment200Charge:
+ `{
+ "data": {
+ "linkType": "standard",
+ "isActive": false,
+ "network": "testnet",
+ "slug": "KiSguJ-8",
+ "id": "93c0164c-3a36-42ab-bd82-b5c1e67811a7",
+ "title": "red silver shit",
+ "description": "really really good payment",
+ "businessId": "d94a5c08-151c-410f-8c75-c1f637253599",
+ "options": {
+ "id": "4be5ca58-ca98-4a61-ae57-a5d4e1b152b0",
+ "collectPhone": false,
+ "allowPromo": false,
+ "collectAddress": true,
+ "createdAt": "2022-07-17T16:28:01.348Z",
+ "updatedAt": "2022-07-18T05:48:12.802Z"
+ },
+ "action": {
+ "successMessage": "thank you budd!",
+ "redirectUrl": "https://local.com/confirm",
+ "redirect": false,
+ "confirmationPage": false
+ },
+ "charge": {
+ "amount": "1000000.00",
+ "currency": "USD"
+ },
+ "cart": {},
+ "createdAt": "2022-07-17T16:28:01.348Z",
+ "updatedAt": "2022-07-18T05:48:12.802Z"
+ },
+ "status": "success",
+ "statusCode": 200
+}`,
+ createDonationPaymentCurl:
+ `curl --location --request POST 'https://api.lazerpay.engineering/api/v1/payment_links/donation' \
+
+--form 'title="Save Rhinos"'
+--form 'description="Help Save Rhinos"'
+--form 'action[redirect]="false"'
+--form 'action[redirect_url]="https://rhinos.com"'
+--form 'action[success_message]="true"'
+--form 'action[show_confirmation_page]="true"'
+--form 'options[collect_phone]="true"'
+--form 'social_links[facebook]="fb.me/uchenoel"'
+--form 'social_links[twitter]="noelukwa"'
+--form 'social_links[instagram]="noelukwa"'
+--form 'cover_photo=@"/Users/waywardgod/Downloads/kids.jpeg"'
+--form 'business_id="d94a5c08-151c-410f-8c75-c1f637253599"'
+--form 'website_url="https://noel.com"'`,
+ createDonationPaymentJs:
+ `const options = {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+ body: JSON.stringify({
+ "title" : "Save Rhinos",
+ "description": "Help Save Rhinos",
+ "options" :{
+ "collect_phone": true,
+ "allow_promo": true,
+ "collect_address":true
+ },
+ "action": {
+ "redirect": false,
+ "redirect_url": "https://rhinos.com",
+ "show_confirmation_page": false,
+ "success_message": "thank you budd!"
+ },
+ "social_links": {
+ "facebook": "fb.me/uchenoel",
+ "twitter": "noelukwa",
+ "instagram": "noelukwa",
+ },
+
+ })
+};
+fetch('https://api.lazerpay.engineering/api/v1/payment_links', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ createDonationPayment201:
+ `{
+ "data": {
+ "isActive": true,
+ "id": "362e16ce-226b-4e58-92f9-3563b0aa04c0",
+ "title": "red silver shit with cart",
+ "description": "really really good payment stuff",
+ "createdAt": "2022-09-05T15:59:00.799Z",
+ "updatedAt": "2022-09-05T15:59:00.799Z",
+ "type": "donation",
+ "network": "testnet",
+ "action": {
+ "showConfirmationPage": false,
+ "redirectUrl": "https://local.com/confirm",
+ "redirect": false,
+ "successMessage": "thank you budd!"
+ },
+ "slug": "zPHupwbJpsk3",
+ "socialLinks": {
+ "facebook": "fb.me/uche",
+ "twitter": "noelukwa",
+ "instagram": "noelukwa"
+ },
+ "businessId": "3dc8842d-fbdc-41a8-ad61-c023afc3a391",
+ "options": {
+ "collectPhone": true
+ },
+ "url": "https://lazerpay.finance/pay/zPHupwbJpsk3",
+ "websiteUrl": "https://uche.com",
+ "image": "https://random-cover-photo.jpeg",
+ "sessions": []
+ },
+ "message": "Payment link created successfully",
+ "status": "success",
+ "statusCode": 201
+}`,
+ updateDonationPaymentCurl:
+ `curl --location --request PUT 'https://api.lazerpay.engineering/api/v1/payment_links/donation' \
+
+--form 'title="Save Rhinos"'
+--form 'description="Help Save Rhinos"'
+--form 'action[redirect]="false"'
+--form 'action[redirect_url]="https://rhinos.com"'
+--form 'action[success_message]="true"'
+--form 'action[show_confirmation_page]="true"'
+--form 'options[collect_phone]="true"'
+--form 'social_links[facebook]="fb.me/uchenoel"'
+--form 'social_links[twitter]="noelukwa"'
+--form 'social_links[instagram]="noelukwa"'
+--form 'cover_photo=@"/Users/waywardgod/Downloads/kids.jpeg"'
+--form 'business_id="d94a5c08-151c-410f-8c75-c1f637253599"'
+--form 'website_url="https://noel.com"'
+--form 'id="362e16ce-226b-4e58-92f9-XXXX"'`,
+ updateDonationPaymentJs:
+ `const options = {
+ method: 'PUT',
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+ body: JSON.stringify({
+ "title" : "Save Rhinos",
+ "description": "Help Save Rhinos",
+ "options" :{
+ "collect_phone": true,
+ "allow_promo": true,
+ "collect_address":true
+ },
+ "action": {
+ "redirect": false,
+ "redirect_url": "https://rhinos.com",
+ "show_confirmation_page": false,
+ "success_message": "thank you budd!"
+ },
+ "social_links": {
+ "facebook": "fb.me/uchenoel",
+ "twitter": "noelukwa",
+ "instagram": "noelukwa",
+ },
+ "id": "362e16ce-226b-4e58-92f9-XXXX"
+ })
+};
+fetch('https://api.lazerpay.engineering/api/v1/payment_links', options)
+ .then((response) => response.json())
+ .then((result) => console.log('Success', result))`,
+ updateDonationPayment200:
+ `{
+ "data": {
+ "isActive": true,
+ "id": "362e16ce-226b-4e58-92f9-3563b0aa04c0",
+ "title": "red silver shit with cart",
+ "description": "really really good payment stuff",
+ "createdAt": "2022-09-05T15:59:00.799Z",
+ "updatedAt": "2022-09-05T16:01:43.139Z",
+ "type": "donation",
+ "network": "testnet",
+ "action": {
+ "showConfirmationPage": false,
+ "redirectUrl": "https://local.com/confirm",
+ "redirect": false,
+ "successMessage": "thank you budd!"
+ },
+ "slug": "zPHupwbJpsk3",
+ "socialLinks": {
+ "facebook": "fb.me/uche",
+ "twitter": "noelukwa",
+ "instagram": "noelukwa"
+ },
+ "businessId": "3dc8842d-fbdc-41a8-ad61-c023afc3a391",
+ "options": {
+ "collectPhone": true
+ },
+ "url": "https://lazerpay.finance/pay/zPHupwbJpsk3",
+ "websiteUrl": "https://uche.com",
+ "image": "https://random-cover-photo.jpeg",
+ "sessions": []
+ },
+ "status": "success",
+ "statusCode": 200
+}`
+}
diff --git a/layouts/docs.tsx b/layouts/docs.tsx
index 49408e0..345bb3c 100644
--- a/layouts/docs.tsx
+++ b/layouts/docs.tsx
@@ -1,13 +1,22 @@
-import React, { useEffect, useState } from "react"
-import { path } from 'ramda';
-import classNames from "classnames"
+import React, { useEffect, useState } from 'react'
+import { path } from 'ramda'
+import classNames from 'classnames'
import { MDXProvider } from '@mdx-js/react'
-import { motion } from "framer-motion"
-import { DocumentTypes } from "contentlayer/generated"
-import { Divider, FooterWrapper, Header, LzContainer, Sidebar, Reaction, TableOfContents } from "components"
-import Styles from './Layout.module.scss';
-import { components } from "components/mdx-components";
-import { useMediaQuery } from "lib/use-mediaQuery";
+import { motion } from 'framer-motion'
+import { DocumentTypes } from 'contentlayer/generated'
+import {
+ Divider,
+ FooterWrapper,
+ Header,
+ LzContainer,
+ Sidebar,
+ Reaction,
+ TableOfContents,
+} from 'components'
+import { Pagination } from 'components/pagination'
+import Styles from './Layout.module.scss'
+import { components } from 'components/mdx-components'
+import { useMediaQuery } from 'lib/use-mediaQuery'
type DocsLayoutProps = {
children: React.ReactNode
@@ -16,54 +25,74 @@ type DocsLayoutProps = {
export default function DocsLayout({ children, doc }: DocsLayoutProps) {
const isMobile = useMediaQuery('(max-width: 768px)')
- const [sideBarIsOpen, setSideBarIsOpen] = useState(false);
- const toggleSidebar = () => setSideBarIsOpen((prev: boolean) => !prev);
+ const [sideBarIsOpen, setSideBarIsOpen] = useState(false)
+ const toggleSidebar = () => setSideBarIsOpen((prev: boolean) => !prev)
- const hideToc = !path(['frontmatter', 'toc', 'length'], doc);
+ const hideToc = !path(['frontmatter', 'toc', 'length'], doc)
/** Restore layout on screens larger than tablet - 768px */
useEffect(() => {
- if (!isMobile) setSideBarIsOpen(null);
- }, [isMobile]);
+ if (!isMobile) setSideBarIsOpen(null)
+ }, [isMobile])
return (
-
+
+ transition={{ duration: 0.4 }}
+ className='relative min-h-screen transform lg:w-4/5 lg:float-right'
+ >
+ className='fixed z-20 invisible w-full h-screen transition duration-200'
+ />
-
+ className='w-full mt-6 md:pt-4 lg:pt-14'
+ >
+
{children}
-
+
+
+
+
+
- {
- !hideToc && (
-
-
-
- )
- }
-
+ {!hideToc && (
+
+
+
+ )}
+
diff --git a/lib/pagination-utils.ts b/lib/pagination-utils.ts
index dce04c5..72c1dc4 100644
--- a/lib/pagination-utils.ts
+++ b/lib/pagination-utils.ts
@@ -1,25 +1,39 @@
-import sidebar from "sidebar.config"
+import sidebar from "sidebar.config";
+
+export type PaginationType = {
+ label: string;
+ url: string;
+ path: string;
+}
export function getPaginationData() {
- const result: { label: string; url: string }[] = []
+ const result: PaginationType[] = []
for (const group of sidebar) {
- if (group.type !== "category") continue
- const childrens = group.children.map(({ label, id }) => ({
- label: label,
- url: id,
- }))
- result.push(...childrens)
+ if (group.type !== "category") {
+ result.push({ label: group.label, url: group.id, path: group.id })
+ } else {
+ const childrens = group.children.map(({ label, id }) => ({
+ label: label,
+ url: id,
+ path: `${group.id}/${id}`
+ }))
+ result.push(...childrens)
+ }
}
- return result
+ return result;
}
type PaginationData = { framework: string; current: string }
export function paginate({ current }: PaginationData) {
- const data = getPaginationData()
- const index = data.map((child) => child.url).indexOf(current)
- if (index === -1) return { prev: undefined, next: undefined }
- const prev = index > 0 ? data[index - 1] : undefined
- const next = index < data.length - 1 ? data[index + 1] : undefined
- return { prev, next }
+ const data: PaginationType[] = getPaginationData();
+ let currentPage: string = "";
+ data.forEach((child: PaginationType) => {
+ if (current.includes(child.path)) currentPage = child.path;
+ })
+ const index: number = data.map((child: PaginationType) => child.path).indexOf(currentPage);
+ if (index === -1) return { prev: undefined, next: undefined };
+ const prev: PaginationType | undefined = index > 0 ? data[index - 1] : undefined;
+ const next: PaginationType | undefined = index < data.length - 1 ? data[index + 1] : undefined;
+ return { prev, next };
}
diff --git a/lib/use-close-context.ts b/lib/use-close-context.ts
new file mode 100644
index 0000000..963ada8
--- /dev/null
+++ b/lib/use-close-context.ts
@@ -0,0 +1,25 @@
+import { useRef, useState, useEffect } from "react";
+
+export const useCloseContext = (initialValue = false) => {
+ const ref = useRef(null);
+ const [visible, setVisible] = useState(initialValue);
+
+ const handleClickOutside = (e: any) => {
+ if (ref.current && !ref.current.contains(e.target)) setVisible(false);
+ };
+
+ const handleKeyPress = (e: any) => {
+ if (e.key === "Escape") setVisible(false);
+ };
+
+ useEffect(() => {
+ document.addEventListener("click", handleClickOutside, true);
+ document.addEventListener("keydown", handleKeyPress, true);
+ return () => {
+ document.removeEventListener("click", handleClickOutside, true);
+ document.removeEventListener("keydown", handleKeyPress, true);
+ };
+ }, [ref]);
+
+ return { visible, setVisible, ref };
+};
\ No newline at end of file
diff --git a/lib/use-set-reaction.ts b/lib/use-set-reaction.ts
new file mode 100644
index 0000000..5403f82
--- /dev/null
+++ b/lib/use-set-reaction.ts
@@ -0,0 +1,69 @@
+import { useEffect, useState } from 'react';
+import { useRouter } from 'next/router';
+import axios from 'axios';
+import { toast, } from 'react-toastify';
+
+const REACTION_PAGES = 'lz-reacted-pages';
+
+const useSetReaction = () => {
+ const [showReaction, setShowReaction] = useState(false);
+ const [loading, setLoading] = useState(false);
+ const { asPath } = useRouter();
+
+ const getReactionList = (): any | null => {
+ let result = document.cookie.match(new RegExp(REACTION_PAGES + '=([^;]+)'));
+ result && (result = JSON.parse(result[1]));
+ return result;
+ };
+ const setReactionList = (data: any): void => {
+ const cookie = `${REACTION_PAGES}=${JSON.stringify(data)}; path=/;`
+ document.cookie = cookie;
+ };
+
+ const saveReaction = async (value: boolean) => {
+ try {
+ setLoading(true);
+ const response = await sendReactionRequest(value);
+ toast.success(response);
+ const reactionPages: Array | null = getReactionList();
+
+ if (!reactionPages) {
+ setReactionList([asPath]);
+ } else {
+ if (!reactionPages.includes(asPath)) {
+ reactionPages.push(asPath)
+ setReactionList(reactionPages);
+ }
+ }
+ setShowReaction(false)
+ } catch (error) {
+ toast.error('Something went wrong!')
+ } finally {
+ setLoading(false)
+ }
+ }
+
+ const sendReactionRequest = async (value: boolean) => {
+ const response = await axios.post(`https://api.lazerpay.engineering/api/v1/documentation/feedback`, {
+ "page": asPath.slice(6),
+ "is_helpful": value
+ });
+ if (response?.status === 200) {
+ return response?.data?.message || "Your feedback has been sent successfully";
+ }
+ return "Your feedback has been sent successfully";
+ }
+
+ useEffect(() => {
+ let reactionPages: Array | null = getReactionList();
+ if (!reactionPages || !reactionPages.includes(asPath)) {
+ setShowReaction(true)
+ } else {
+ setShowReaction(false)
+ }
+ }, [asPath]);
+
+ return { showReaction, saveReaction, loading }
+}
+
+export default useSetReaction;
\ No newline at end of file
diff --git a/package.json b/package.json
index 65d78d4..4bb865f 100644
--- a/package.json
+++ b/package.json
@@ -16,6 +16,7 @@
"@mdx-js/react": "^2.1.1",
"@types/ramda": "^0.28.14",
"autoprefixer": "^10.4.7",
+ "axios": "^0.27.2",
"babel-plugin-superjson-next": "^0.4.3",
"classnames": "^2.3.1",
"contentlayer": "^0.2.3",
@@ -31,9 +32,11 @@
"prismjs": "^1.28.0",
"ramda": "^0.28.0",
"react": "17.0.2",
+ "react-copy-to-clipboard": "^5.1.0",
"react-dom": "17.0.2",
"react-hook-form": "^7.33.1",
"react-icons": "^4.3.1",
+ "react-toastify": "^9.0.8",
"sass": "^1.51.0",
"sugar": "^2.0.6",
"superjson": "^1.9.1",
diff --git a/pages/_app.tsx b/pages/_app.tsx
index 6c9bf77..847fc09 100644
--- a/pages/_app.tsx
+++ b/pages/_app.tsx
@@ -1,13 +1,22 @@
-import { DefaultSeo } from "next-seo"
-import "../styles/prism.scss"
-import "../styles/globals.scss"
-import siteConfig from "site.config"
+import { DefaultSeo } from 'next-seo'
+import { ToastContainer } from 'react-toastify'
+import '../styles/prism.scss'
+import '../styles/globals.scss'
+import 'react-toastify/dist/ReactToastify.css'
+import siteConfig from 'site.config'
export default function App({ Component, pageProps }) {
return (
<>
+
>
)
}
diff --git a/pages/_document.tsx b/pages/_document.tsx
index 75639ce..036b66c 100644
--- a/pages/_document.tsx
+++ b/pages/_document.tsx
@@ -1,34 +1,34 @@
-import { Html, Head, Main, NextScript } from "next/document"
+import { Html, Head, Main, NextScript } from 'next/document'
export default function Document() {
return (
-
+
-
+
-
-
+
+
diff --git a/pages/docs/[...slug].tsx b/pages/docs/[...slug].tsx
index 1f627ea..1bf324a 100644
--- a/pages/docs/[...slug].tsx
+++ b/pages/docs/[...slug].tsx
@@ -1,13 +1,14 @@
-import { NextSeo } from "next-seo"
-import { useMDX } from "components/mdx-components"
-import { Docs } from "contentlayer/generated"
-import DocsLayout from "layouts/docs"
-import { getDoc } from "lib/contentlayer-utils"
-import { GetServerSideProps } from "next"
-import { Fragment } from "react"
+import { NextSeo } from 'next-seo'
+import { useMDX } from 'components/mdx-components'
+import { Docs } from 'contentlayer/generated'
+import DocsLayout from 'layouts/docs'
+import { getDoc } from 'lib/contentlayer-utils'
+import { GetServerSideProps } from 'next'
+import { Fragment } from 'react'
+import { NotFound } from 'components'
export default function OverviewPage({ doc }: { doc: Docs }) {
- const Component = useMDX(doc?.body?.code)
+ const Component = useMDX(doc?.body?.code) ||
return (
@@ -16,12 +17,14 @@ export default function OverviewPage({ doc }: { doc: Docs }) {
)
}
-export const getServerSideProps: GetServerSideProps<{ doc: Docs }> = async (ctx) => {
- const { slug } = ctx.params;
+export const getServerSideProps: GetServerSideProps<{ doc: Docs }> = async (
+ ctx,
+) => {
+ const { slug } = ctx.params
/** Currently, we have two layer deep nesting, this should be sufficient for our need at the moment */
return {
props: {
- doc: getDoc(slug[0], slug[1]) || null
- }
+ doc: getDoc(slug[0], slug[1]) || null,
+ },
}
}
diff --git a/public/fonts/.DS_Store b/public/fonts/.DS_Store
index f88aaa7..d0a1643 100644
Binary files a/public/fonts/.DS_Store and b/public/fonts/.DS_Store differ
diff --git a/public/fonts/source-code/SourceCodePro-Black.woff b/public/fonts/source-code/SourceCodePro-Black.woff
new file mode 100644
index 0000000..3619500
Binary files /dev/null and b/public/fonts/source-code/SourceCodePro-Black.woff differ
diff --git a/public/fonts/source-code/SourceCodePro-BlackItalic.woff b/public/fonts/source-code/SourceCodePro-BlackItalic.woff
new file mode 100644
index 0000000..bad625c
Binary files /dev/null and b/public/fonts/source-code/SourceCodePro-BlackItalic.woff differ
diff --git a/public/fonts/source-code/SourceCodePro-Bold.woff b/public/fonts/source-code/SourceCodePro-Bold.woff
new file mode 100644
index 0000000..2da0d81
Binary files /dev/null and b/public/fonts/source-code/SourceCodePro-Bold.woff differ
diff --git a/public/fonts/source-code/SourceCodePro-BoldItalic.woff b/public/fonts/source-code/SourceCodePro-BoldItalic.woff
new file mode 100644
index 0000000..876126c
Binary files /dev/null and b/public/fonts/source-code/SourceCodePro-BoldItalic.woff differ
diff --git a/public/fonts/source-code/SourceCodePro-ExtraBold.woff b/public/fonts/source-code/SourceCodePro-ExtraBold.woff
new file mode 100644
index 0000000..6d650f5
Binary files /dev/null and b/public/fonts/source-code/SourceCodePro-ExtraBold.woff differ
diff --git a/public/fonts/source-code/SourceCodePro-ExtraBoldItalic.woff b/public/fonts/source-code/SourceCodePro-ExtraBoldItalic.woff
new file mode 100644
index 0000000..d34c709
Binary files /dev/null and b/public/fonts/source-code/SourceCodePro-ExtraBoldItalic.woff differ
diff --git a/public/fonts/source-code/SourceCodePro-ExtraLight.woff b/public/fonts/source-code/SourceCodePro-ExtraLight.woff
new file mode 100644
index 0000000..751e203
Binary files /dev/null and b/public/fonts/source-code/SourceCodePro-ExtraLight.woff differ
diff --git a/public/fonts/source-code/SourceCodePro-ExtraLightItalic.woff b/public/fonts/source-code/SourceCodePro-ExtraLightItalic.woff
new file mode 100644
index 0000000..a5503fe
Binary files /dev/null and b/public/fonts/source-code/SourceCodePro-ExtraLightItalic.woff differ
diff --git a/public/fonts/source-code/SourceCodePro-Italic.woff b/public/fonts/source-code/SourceCodePro-Italic.woff
new file mode 100644
index 0000000..fa86a69
Binary files /dev/null and b/public/fonts/source-code/SourceCodePro-Italic.woff differ
diff --git a/public/fonts/source-code/SourceCodePro-Light.woff b/public/fonts/source-code/SourceCodePro-Light.woff
new file mode 100644
index 0000000..3f04e18
Binary files /dev/null and b/public/fonts/source-code/SourceCodePro-Light.woff differ
diff --git a/public/fonts/source-code/SourceCodePro-LightItalic.woff b/public/fonts/source-code/SourceCodePro-LightItalic.woff
new file mode 100644
index 0000000..6582ad2
Binary files /dev/null and b/public/fonts/source-code/SourceCodePro-LightItalic.woff differ
diff --git a/public/fonts/source-code/SourceCodePro-Medium.woff b/public/fonts/source-code/SourceCodePro-Medium.woff
new file mode 100644
index 0000000..bc55024
Binary files /dev/null and b/public/fonts/source-code/SourceCodePro-Medium.woff differ
diff --git a/public/fonts/source-code/SourceCodePro-MediumItalic.woff b/public/fonts/source-code/SourceCodePro-MediumItalic.woff
new file mode 100644
index 0000000..98fc621
Binary files /dev/null and b/public/fonts/source-code/SourceCodePro-MediumItalic.woff differ
diff --git a/public/fonts/source-code/SourceCodePro-Regular.woff b/public/fonts/source-code/SourceCodePro-Regular.woff
new file mode 100644
index 0000000..d205d71
Binary files /dev/null and b/public/fonts/source-code/SourceCodePro-Regular.woff differ
diff --git a/public/fonts/source-code/SourceCodePro-SemiBold.woff b/public/fonts/source-code/SourceCodePro-SemiBold.woff
new file mode 100644
index 0000000..3211880
Binary files /dev/null and b/public/fonts/source-code/SourceCodePro-SemiBold.woff differ
diff --git a/public/fonts/source-code/SourceCodePro-SemiBoldItalic.woff b/public/fonts/source-code/SourceCodePro-SemiBoldItalic.woff
new file mode 100644
index 0000000..5398212
Binary files /dev/null and b/public/fonts/source-code/SourceCodePro-SemiBoldItalic.woff differ
diff --git a/public/fonts/source-code/SourceCodePro-Black.ttf b/public/fonts/source-code/old/SourceCodePro-Black.ttf
similarity index 100%
rename from public/fonts/source-code/SourceCodePro-Black.ttf
rename to public/fonts/source-code/old/SourceCodePro-Black.ttf
diff --git a/public/fonts/source-code/SourceCodePro-BlackItalic.ttf b/public/fonts/source-code/old/SourceCodePro-BlackItalic.ttf
similarity index 100%
rename from public/fonts/source-code/SourceCodePro-BlackItalic.ttf
rename to public/fonts/source-code/old/SourceCodePro-BlackItalic.ttf
diff --git a/public/fonts/source-code/SourceCodePro-Bold.ttf b/public/fonts/source-code/old/SourceCodePro-Bold.ttf
similarity index 100%
rename from public/fonts/source-code/SourceCodePro-Bold.ttf
rename to public/fonts/source-code/old/SourceCodePro-Bold.ttf
diff --git a/public/fonts/source-code/SourceCodePro-BoldItalic.ttf b/public/fonts/source-code/old/SourceCodePro-BoldItalic.ttf
similarity index 100%
rename from public/fonts/source-code/SourceCodePro-BoldItalic.ttf
rename to public/fonts/source-code/old/SourceCodePro-BoldItalic.ttf
diff --git a/public/fonts/source-code/SourceCodePro-ExtraBold.ttf b/public/fonts/source-code/old/SourceCodePro-ExtraBold.ttf
similarity index 100%
rename from public/fonts/source-code/SourceCodePro-ExtraBold.ttf
rename to public/fonts/source-code/old/SourceCodePro-ExtraBold.ttf
diff --git a/public/fonts/source-code/SourceCodePro-ExtraBoldItalic.ttf b/public/fonts/source-code/old/SourceCodePro-ExtraBoldItalic.ttf
similarity index 100%
rename from public/fonts/source-code/SourceCodePro-ExtraBoldItalic.ttf
rename to public/fonts/source-code/old/SourceCodePro-ExtraBoldItalic.ttf
diff --git a/public/fonts/source-code/SourceCodePro-ExtraLight.ttf b/public/fonts/source-code/old/SourceCodePro-ExtraLight.ttf
similarity index 100%
rename from public/fonts/source-code/SourceCodePro-ExtraLight.ttf
rename to public/fonts/source-code/old/SourceCodePro-ExtraLight.ttf
diff --git a/public/fonts/source-code/SourceCodePro-ExtraLightItalic.ttf b/public/fonts/source-code/old/SourceCodePro-ExtraLightItalic.ttf
similarity index 100%
rename from public/fonts/source-code/SourceCodePro-ExtraLightItalic.ttf
rename to public/fonts/source-code/old/SourceCodePro-ExtraLightItalic.ttf
diff --git a/public/fonts/source-code/SourceCodePro-Italic.ttf b/public/fonts/source-code/old/SourceCodePro-Italic.ttf
similarity index 100%
rename from public/fonts/source-code/SourceCodePro-Italic.ttf
rename to public/fonts/source-code/old/SourceCodePro-Italic.ttf
diff --git a/public/fonts/source-code/SourceCodePro-Light.ttf b/public/fonts/source-code/old/SourceCodePro-Light.ttf
similarity index 100%
rename from public/fonts/source-code/SourceCodePro-Light.ttf
rename to public/fonts/source-code/old/SourceCodePro-Light.ttf
diff --git a/public/fonts/source-code/SourceCodePro-LightItalic.ttf b/public/fonts/source-code/old/SourceCodePro-LightItalic.ttf
similarity index 100%
rename from public/fonts/source-code/SourceCodePro-LightItalic.ttf
rename to public/fonts/source-code/old/SourceCodePro-LightItalic.ttf
diff --git a/public/fonts/source-code/SourceCodePro-Medium.ttf b/public/fonts/source-code/old/SourceCodePro-Medium.ttf
similarity index 100%
rename from public/fonts/source-code/SourceCodePro-Medium.ttf
rename to public/fonts/source-code/old/SourceCodePro-Medium.ttf
diff --git a/public/fonts/source-code/SourceCodePro-MediumItalic.ttf b/public/fonts/source-code/old/SourceCodePro-MediumItalic.ttf
similarity index 100%
rename from public/fonts/source-code/SourceCodePro-MediumItalic.ttf
rename to public/fonts/source-code/old/SourceCodePro-MediumItalic.ttf
diff --git a/public/fonts/source-code/SourceCodePro-Regular.ttf b/public/fonts/source-code/old/SourceCodePro-Regular.ttf
similarity index 100%
rename from public/fonts/source-code/SourceCodePro-Regular.ttf
rename to public/fonts/source-code/old/SourceCodePro-Regular.ttf
diff --git a/public/fonts/source-code/SourceCodePro-SemiBold.ttf b/public/fonts/source-code/old/SourceCodePro-SemiBold.ttf
similarity index 100%
rename from public/fonts/source-code/SourceCodePro-SemiBold.ttf
rename to public/fonts/source-code/old/SourceCodePro-SemiBold.ttf
diff --git a/public/fonts/source-code/SourceCodePro-SemiBoldItalic.ttf b/public/fonts/source-code/old/SourceCodePro-SemiBoldItalic.ttf
similarity index 100%
rename from public/fonts/source-code/SourceCodePro-SemiBoldItalic.ttf
rename to public/fonts/source-code/old/SourceCodePro-SemiBoldItalic.ttf
diff --git a/public/icons/arrow-down.tsx b/public/icons/arrow-down.tsx
new file mode 100644
index 0000000..24205c7
--- /dev/null
+++ b/public/icons/arrow-down.tsx
@@ -0,0 +1,8 @@
+const ArrowDown = () => (
+
+
+)
+
+export default ArrowDown
\ No newline at end of file
diff --git a/public/icons/arrow-right-icon.tsx b/public/icons/arrow-right-icon.tsx
index 61a88e6..1eb9725 100644
--- a/public/icons/arrow-right-icon.tsx
+++ b/public/icons/arrow-right-icon.tsx
@@ -1,4 +1,4 @@
-const ArrowRightIcon = () => {
+const ArrowRightIcon = (props) => {
return (
)
diff --git a/public/icons/customers-icon.tsx b/public/icons/customers-icon.tsx
new file mode 100644
index 0000000..9ae221c
--- /dev/null
+++ b/public/icons/customers-icon.tsx
@@ -0,0 +1,32 @@
+export default function CustomersIcon() {
+ return (
+
+ )
+}
diff --git a/public/icons/error-icon.tsx b/public/icons/error-icon.tsx
index e176d93..0aaeeac 100644
--- a/public/icons/error-icon.tsx
+++ b/public/icons/error-icon.tsx
@@ -3,7 +3,7 @@ export default function ErrorIcon() {