⚛️ React Environment Properties

Developers can use this documentation for environmental settings that determine how the checkout process functions.

⚙️ Properties

PropertyRequiredDescription
wallet✅ YesSolana wallet adapter.
blockchain✅ YesBlockchain used for purchase — must be "solana".
merchantId✅ YesMerchant ID (contact Approvely support to obtain).
connection✅ YesSolana connection object.
env❌ NoEnvironment (prod by default; use staging or sandbox for testing).
onSuccess❌ NoCallback function triggered upon successful checkout.
transaction❌ NoSolana transaction object for redeeming credits. Create as you would for a normal user with USDC.
partialSigners❌ NoArray of Keypair objects used for signing (e.g., for initializing new accounts).
debugTx❌ NoSet to true to skip preflight checks for debugging.
token❌ NoToken used for purchase (defaults to USDC; only Solana supported).
planCode❌ NoPlan code for subscriptions.
settlementType❌ NoSettlement method (Credits, USDC, or Bank).
amount❌ NoFixed purchase amount.
webhookInfo❌ NoObject containing transaction/product info to include in webhook payloads.
email❌ NoDefault email for pre-filling user email field.
chargebackProtectionData❌ NoProduct metadata for chargeback protection logic.
disableApplePay❌ NoDisable Apple Pay.
disableGooglePay❌ NoDisable Google Pay.
customerInfo❌ NoAdditional customer metadata.
supportsVersionedTransactions❌ NoEnable support for Solana versioned transactions.
rent❌ NoRent object specifying blockchain rent in lamports.
origins❌ NoComma-separated list of ancestor iframes when nested in multiple layers.

🚀 Usage

🧱 Base Example

import { useWallet } from '@solana/wallet-adapter-react';
import { useConnection } from '@solana/wallet-adapter-react';

const wallet = useWallet();
const { connection } = useConnection();

<CoinflowPurchase 
  wallet={wallet}
  merchantId='<YOUR MERCHANT ID>'
  blockchain="solana"
  env='prod' // or 'staging' or 'sandbox'
  connection={connection}
/>;

📡 Webhook Info

Example:

const webhookInfo = {
  productId: 'N421',
  code: 'PX8242342',
};

🔐 Chargeback Protection

const chargebackProtection = [
  {
    productName: 'Widget',
    productType: 'computingContract',
    quantity: 1,
    rawProductData: {
      description: 'Market best widgets',
    },
  },
];

SupportedproductType values:

inGameProduct, gameOfSkill, dataStorage, computingResources, sportsTicket,
eSportsTicket, musicTicket, conferenceTicket, virtualSportsTicket,
virtualESportsTicket, virtualMusicTicket, virtualConferenceTicket,
alcohol, DLC, subscription, fundACause, realEstate, computingContract,
digitalArt, topUp

rawProductData is optional but helps improve chargeback protection logic.


👤 Customer Info

const customerInfo = {
  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',
};

All fields are optional.


🧾 Rent Example

const rent = {
  lamports: 100000,
};