Skip to content

Commit

Permalink
remove cc checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
SamueleA committed Sep 27, 2023
1 parent 40aa9e9 commit f52867c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 59 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ Sequence Kit 🧰 is a library enabling developers to easily integrate web3 wall
- Connect via social logins eg: facebook, google, discord, etc...! 🔐🪪
- Connect to popular web3 wallets eg: walletConnect, metamask ! 🦊 ⛓️
- Full-fledged embedded wallet for coins and collectibles 👛 🖼️ 🪙
- Fiat onramp 💵 💶 💴 💷


View the [demo](https://0xsequence.github.io/kit)! 👀

Expand Down
27 changes: 0 additions & 27 deletions examples/react/src/utils/settings.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,7 @@
import { CheckoutSettings } from '@0xsequence/kit-checkout'
import { abi } from '../constants'

export const getCheckoutSettings = (address?: string) => {
const deadline = String(Math.round(new Date().getTime()/ 1000) + 3600)

const usdcAmount = '1'

const checkoutSettings: CheckoutSettings = {
creditCardCheckout: {
chainId: 137,
receiptTitle: 'Custom Sequence Kit Checkout Demo',
abi: JSON.stringify(abi),
methodName: 'buyTokens',
methodArguments: {
"_recipient":"$WALLET",
"_deadline": deadline,
"_maxCurrency": `${Number(usdcAmount) * 10 ** 6}`,
"_tokenIds":["65570"],
"_tokensBoughtAmounts":["100"],
"_extraFeeRecipients":[],
"_extraFeeAmounts":[]
},
recipientAddress: address || '',
contractAddress: '0x8bb759bb68995343ff1e9d57ac85ff5c5fb79334',
currency: 'USDC',
currencyAmount: `${usdcAmount}`,
collectionContractAddress: '0x631998e91476da5b870d741192fc5cbc55f5a52e',
onSuccess: () => { console.log('success') },
onError: () => { console.log('error') },
},
cryptoCheckout: {
chainId: 137,
triggerTransaction: async () => { console.log('triggered transaction') },
Expand Down
11 changes: 1 addition & 10 deletions packages/checkout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ Sequence Kit Checkout
<img src="../../public/docs/checkout-modal.png">
</div>

Checkout modal for Sequence Kit.
Will display a list of collectibles and allows either checking out with a credit card or through crypto directly.
Checkout modal for Sequence Kit. Displays a list a summary of collectibles to be purchased

# Installing the module
First install the package:
Expand Down Expand Up @@ -70,19 +69,11 @@ Example [settings](../../examples/react/src/utils/settings.ts)

```js
const checkoutSettings = {
creditCardCheckout: {...},
cryptoCheckout: {...},
orderSummaryItems: {...}
}
```

### creditCardCheckout
The `creditCardCheckout` setting of the settings object contains information that will be passed to [Paper](https://getpaper.xyz/).

View the paper documentation for [more information](https://docs.withpaper.com/reference/create-checkout-elements-client-secret).

If this field is empty the credit card checkout button will not be visible.

### cryptoCheckout
The `cryptoCheckout` specifies settings regarding checking out with crypto.
An example usecase might be interacting with a minting contract.
Expand Down
30 changes: 15 additions & 15 deletions packages/checkout/src/contexts/CheckoutModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ interface OrderSummaryItem {
}

export interface CheckoutSettings {
creditCardCheckout?: {
chainId: number
abi: string
methodName: string
contractAddress: string
recipientAddress: string
receiptTitle: string
methodArguments: MethodArguments
currency: string
currencyAmount: string
collectionContractAddress?: string
email?: string
onSuccess?: (transactionHash: string) => void
onError?: (error: Error) => void
},
// creditCardCheckout?: {
// chainId: number
// abi: string
// methodName: string
// contractAddress: string
// recipientAddress: string
// receiptTitle: string
// methodArguments: MethodArguments
// currency: string
// currencyAmount: string
// collectionContractAddress?: string
// email?: string
// onSuccess?: (transactionHash: string) => void
// onError?: (error: Error) => void
// },
cryptoCheckout?: {
chainId: number,
triggerTransaction: () => void,
Expand Down
10 changes: 5 additions & 5 deletions packages/checkout/src/views/CheckoutSelection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ export const CheckoutSelection = () => {
const { address: accountAddress } = useAccount()

const cryptoCheckoutSettings = settings?.cryptoCheckout
const creditCardCheckoutSettings = settings?.creditCardCheckout
// const creditCardCheckoutSettings = settings?.creditCardCheckout
const displayCryptoCheckout = !!cryptoCheckoutSettings
const displayCreditCardCheckout = !!creditCardCheckoutSettings
// const displayCreditCardCheckout = !!creditCardCheckoutSettings

const {
data: contractInfoData,
Expand Down Expand Up @@ -77,7 +77,7 @@ export const CheckoutSelection = () => {

const orderSummaryItems = settings?.orderSummaryItems || []

const chainId = settings?.cryptoCheckout?.chainId || settings?.creditCardCheckout?.chainId || 1
const chainId = settings?.cryptoCheckout?.chainId || 1

const onClickPayWithCard = () => {
setNavigation({
Expand Down Expand Up @@ -150,7 +150,7 @@ export const CheckoutSelection = () => {
justifyContent="center"
gap="2"
>
{displayCreditCardCheckout && (
{/* {displayCreditCardCheckout && (
<Button
style={{
borderRadius: vars.radii.md,
Expand All @@ -164,7 +164,7 @@ export const CheckoutSelection = () => {
rightIcon={ChevronRightIcon}
onClick={onClickPayWithCard}
/>
)}
)} */}
{displayCryptoCheckout && (!isInsufficientBalance && !isLoading) && (
<Button
style={{
Expand Down

0 comments on commit f52867c

Please sign in to comment.