React Component for Coinflow Withdraw
npm install @coinflowlabs/react``
import {useWallet} from '@solana/wallet-adapter-react';
const wallet = useWallet();
const connection = useConnection();
`
Props:
- wallet: The Solana Wallet Adapter WalletmerchantId
- : Your Merchant ID (Contact Coinflow support for this)connection
- : Solana Connectionenv
- (optional): This defaults to prodsandbox
- For testing set to onSuccess
- (optional): function to run when the withdrawal process is successfullockAmount
- (optional): Whether to let the user select the amount to withdraw or to disable the inputamount
- (optional): The amount to withdraw - required if lockAmount=truetokens
- (optional): Define a list to filter the available tokenslockDefaultToken
- (optional): Only allow the default token to be usedemail
- (optional): Set the default email to be used in entry fieldsbankAccountLinkRedirect
- (optional): The URL to be used for bank account setupadditionalWallets
- (optional): Define additional wallets to assign to the userusePermit
- (optional): Pass as false to disable permit message signing for EVM and use approve transactionstransactionSigner
- (optional): Public Key of the wallet which will actually execute the withdrawal transaction. Must be associated with the same withdrawer as the main wallet.
`
import {useWallet} from '@solana/wallet-adapter-react';
const wallet = useWallet();
const connection = useConnection();
`
Props:
- subtotal (optional): Fix the amount of purchasewallet
- : The Solana Wallet Adapter WalletmerchantId
- : Your Merchant ID (Contact Coinflow support for this)connection
- : Solana Connectionenv
- (optional): This defaults to prodstaging
- For testing set to onSuccess
- (optional): function to run when the purchase process is successfultransaction
- (optional): transaction for the user to run which redeems their credits with your smart contract. Create this transaction just like you would for a normal user who has USDC in their account.debugTx
- (optional): 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.planCode
- (optional): When a subscription is being purchased, the code of the subscription plan.settlementType
- (optional): The settlement method to use for the proceeds of a purchase. (Credits, USDC, or Bank)webhookInfo
- (optional): Product or transaction based information that you want transmitted when you receive webhooks regarding the purchaseemail
- (optional): Set the default email to use in email entry fieldschargebackProtectionData
- (optional):customerInfo
- (optional): Additional information about the customerallowedPaymentMethods
- (optional): The payment methods displayed on the UI. If omitted, all available payment methods will be displayed.rent
- (optional, Solana only): Specify the blockchain rent amount to add to the totalnativeSolToConvert
- (optional, Solana only): Specify the amount of native SOL to convert wSOL for the purchasejwtToken
- (optional): A JWT token which encodes verified checkout parameters to prevent spoofing of arguments.supportEmail
- (optional): Your business support email address to use for support inquirieszeroAuthorization
- (optional): Pass in true if you wish to perform a zero authorization card transaction
CoinflowUtils
- getFeePayer - Return the PublicKey of the Coinflow Fee Payer
- Internal change to a query parameter name for zero authorization
- Added zeroAuthorization parameter to allow zero authorization card transactions
- NSure SDK added as a dependency
- Added email as a field for customerInfo
- Large performance improvements when loading the Checkout Form
- Added redemptionCheck to purchase (Solana only)
- Added allowedWithdrawSpeeds query parameter to allow merchants to specify what withdraw speeds are allowed. The default is all.
- Added more chargebackProtectionData product types
- Added partialUsdcChecked property to pre-check partial USDC payment checkbox
- Added Multi-Currency Presentment via the presentment property
- Improving Withdraw With Session Keys
- credentialless added synchronously before render
- Add credentialless to iframe
- Fixing onAuthDeclined callback
- Added seller prop to chargebackProtectionData
- Added 3DS Challenge Handling to the standalone Google Pay button
- Added allowedPaymentMethods to CoinflowPurchase
- Options are:
- 'card' = Credit and debit cards
- 'ach' = ACH bank account transfers
- 'fasterPayments' = UK Faster Payments (GBP Bank Transfers)
- 'sepa' = SEPA bank account transfers (EUR Bank Transfers)
- 'pix' = Pix bank account transfers (BRL Bank Transfers)
- 'usdc' = USDC
- 'googlePay' = Google Pay
- 'applePay' = Apple Pay
- 'credits' = Credits
- Allow copy to clipboard for Coinflow Iframe
- Added onAuthDeclined callback to CoinflowPurchase
- Deprecating amount and token in favor of subtotal which can be accessed via the following ways:
- Added multi-currency support for presentment
- SEPA and UK Faster Payments support
`js`
{
cents: number;
currency: 'USD' | 'EUR' | 'GBP' | 'BRL';
}
or
`js`
{
address: string;
amount: number;
}
- Updating optional peer dependencies to play nice with various bundlers
- Added sessionKey authentication mechanism to CoinflowWithdraw
- Added sessionKey authentication mechanism to CoinflowPurchase
- Added onError callback to Apple Pay and Google Pay buttons
- Added overlay to digital wallet buttons to make the loading time 0
- CoinflowPurchaseV2 component added for a modernized purchase flow
- Added arbitrum blockchain support
- Added getWalletFromEmail function to CoinflowUtils
- Added placeholder CSS to card form elements
- Custom fonts for card elements
- Allow custom taker on reservoir transactions
- Memoize styles on credit card inputs
- Add base blockchain support
- Added AuthOnly parameter to CoinflowPurchase
- Require signMessage on wallets for stronger withdraw authentication
- Added new ChargebackProtectionData productTypes
- Added waitForHash to EvmTransactionData
- Added theme props to Coinflow components for easy color control
- Added orderId option for reservoir items
- Added nativeSolToConvert for Solana transactions
- Settlement type param for settlement control
- Customer info param for added reporting capabilities
- Added disableGooglePay and disableApplePay props to CoinflowPurchase
- Added support for EVM NFT purchases
- Update to CoinflowPurchaseProtection to make partnerId required
Breaking Changes
- Added supportsVersionedTransactions to CoinflowWithdraw allowing platforms with wallets that support versioned transactions to Withdraw non-USDC/EuroE tokens in a single transaction with better prices.
- This is enabled to true by default. If you are using a wallet that does not support versioned transactions, you must set supportsVersionedTransactions in CoinflowWithdraw to false.
- Added new property lockDefaultToken which locks the withdrawal option to the users default currency (USDC or EUROe)
- Added support for paying solana rent for a transaction
- Added camera support document verification
- Added built in support for SSR which fixes a "window not defined" error.
- Added support for Apple Pay and Google Pay
- Added the CoinflowCardForm component which allows merchants to collect credit card information from their users in a PCI compliant way. Tokenize it, and then utilize the remainder of Coinflow's APIs.
- Added support for Ethereum Mainnet
- Added typing for ChargebackProtectionDatatoken
- Added prop for CoinflowPurchase with polygon
Support Versioned Transactions in CoinflowPurchase
Added useSocket property to handle browser instances where iframe messages are unavailable
- Bug fix to set useHeightChange url param to true if using the handleHeightChange prop
- Added handleHeightChange to all components to allow for dynamic height changes
- Removing hard requirements for most large 3rd party libraries
- Improved type checking for wallets and transactions
- Added support for Polygon blockchain
- Added support for Solana Checkout with non-USDC tokens
- Added support for Ethereum Mainnet blockchain
- Added support for the NEAR blockchain
- Added Withdraw and Purchase history components
- Fixing bug with Magic Wallet and Versioned Transactions
- Added the ability to sign transactions
- Added CoinflowUtils.getFeePayer()` to get the Coinflow fee payer PublicKey
- Fixing an issue when passing partialSigners not working with the setup transaction
- Setup and Redeem transactions now run gasless, which doesnt require the user to have SOL in their account to interact with coinflow
- Added the optional debugTx parameter to allow for easier debugging of any redeem transaction related issues.
- Added the optional partialSigners parameter to CoinflowPurchase component so redeem txs that require partial signers can be supported.
- Added the transaction optional parameter to CoinflowPurchase component enabling automatic redemption of credits on purchases.