⚛️ React Environment Properties
This page is for advanced / cryptocurrency-native companies. If that’s not you, head back to the Quickstart for the standard flows.
Core props
| Property | Required | Description |
|---|---|---|
| merchantId | Y | The merchant identifier - the target of the checkout (Contact Coinflow support for this) |
| env | N | The environment - defaults to prod, for testing set it to staging |
| amount | N | Fix the amount of the purchase |
| N | Set the default email to use in email entry fields | |
| onSuccess | N | Specify a function to run when the checkout process succeeds |
| customerInfo | N | Additional information about the customer (See example) |
| chargebackProtectionData | N | Information to formulate the chargeback protection logic (See example) |
| webhookInfo | N | Product or transaction based information that you want transmitted when you receive webhooks regarding the purchase (See example) |
| planCode | N | When a subscription is being purchased, the code of the subscription plan |
| settlementType | N | The settlement method to use for the proceeds of a purchase. (Credits, USDC, or Bank) |
| disableApplePay | N | Ability to disable Apple Pay |
| disableGooglePay | N | Ability to disable Google Pay |
| debugTx | N | Setting this to true will sign the transaction with the wallet, and send the transaction with no preflight checks allowing for easier debug of any issues. |
| origins | N | If rendering the Coinflow component within multiple nested iframes, all ancestors in the chain must be provided as a comma-separated list. |
Advanced: Solana integration props
These props are only required when integrating Coinflow with a Solana program. Card and ACH integrations can skip this section.
| Property | Required | Description |
|---|---|---|
| wallet | Required for Solana | The Solana wallet adapter. If your customers don’t have a wallet, see Wallet Implementation. |
| blockchain | Required for Solana | The blockchain for the purchase (solana) |
| connection | Required for Solana | The Solana RPC connection |
| transaction | N | Transaction for the user to run which redeems their credits with your on-chain program. Create this transaction just like you would for any other Solana transfer. |
| partialSigners | N | Keypairs of partial signers to sign the transaction with — required when initializing new accounts as the new account keypair must sign the transaction. |
| token | N | The token to use for the purchase. Defaults to USDC. Currently only supported on Solana. |
| supportsVersionedTransactions | N | Instruct the system that you support versioned transactions |
| rent | N | Specify the Solana network rent (in lamports) to add to the total. (See example) |
Usage
Base (card or ACH checkout)
<CoinflowPurchase
merchantId='<YOUR MERCHANT ID>'
env='prod|sandbox|staging'
amount={100}
email={'customer@example.com'}
onSuccess={() => console.log('Purchase complete')}
/>;
Advanced: Solana integration
import {useWallet, useConnection} from '@solana/wallet-adapter-react';
const wallet = useWallet();
const {connection} = useConnection();
<CoinflowPurchase
wallet={wallet}
merchantId='<YOUR MERCHANT ID>'
env='prod|sandbox|staging'
connection={connection}
blockchain='solana'
/>;
Advanced: Rent
const rent = { lamports: 100000 }
Webhook Info
// This is only an example - this is merchant defined
const webhookInfo = {
productId: 'N421',
code: 'PX8242342',
}
Chargeback Protection
const chargebackProtection = [
{
productName: 'Widget',
productType: 'computingContract',
quantity: 1,
rawProductData: {
description: 'Market best widgets'
}
}
]
The product type settings:
inGameProduct
gameOfSkill
dataStorage
computingResources
sportsTicket
eSportsTicket
musicTicket
conferenceTicket
virtualSportsTicket
virtualESportsTicket
virtualMusicTicket
virtualConferenceTicket
alcohol
DLC
subscription
fundACause
realEstate
computingContract
digitalArt
topUp
The raw product data is optional but can be used to provide additional information to assist in the chargeback protection decision.
Customer Info
// All the fields are optional
const custonmerInfo = {
name: 'Suzy Customer',
verificationId: '123',
displayName: 'Suzy',
address: '123 Main St'
city: 'Somewhereville',
state: 'AK',
zip: '99546',
country: 'US',
ip: '172.10.0.1'
lat: '58.2005N',
lng: '152.2100W'
}