Docs
  • What We Do
  • Supported Countries, Payment Methods, and Cryptocurrencies
  • Getting Started
  • Integration Guides
    • API
      • Required Headers
      • Create a User
      • Assign a Deposit Address
      • KYC
      • Link and Verify a Bank Account
        • Re-link Bank Account
        • Update Bank Account
        • Delete Bank Account
      • Transaction Limits
      • Buy Crypto (ACH)
      • Transaction Monitoring
      • Transaction History
    • React Native
      • Installation
      • Session Token and Wallet Signing
      • Preset Order Details
      • Example
      • Reference
      • Release History
      • User experience
        • Sign up
        • Sign in
        • Buy crypto
        • Settings & activity
    • React JS (Beta)
      • Installation
      • Session Token and Wallet Signing
      • Preset Orders
      • Callbacks
      • Theming
      • Example
      • Reference
      • Release History
  • API Reference
    • Endpoints
      • Auth
        • Crypto Wallet
        • Email OTP
        • SMS OTP
      • Activity
      • Bank
      • Client
      • Config
      • Crypto
      • Users
      • Wallets
      • Webhook Registrations
    • Custom Headers
    • Error Codes
    • Types Glossary
    • Postman
    • Open API Specification
    • Webhooks
  • Design Reference
    • UI/UX Starter kit
    • UI Requirements
  • Guides
    • Sandbox Testing
    • User Authentication
    • Link a new Signing Wallet to an Existing User
    • Plaid Bank Linking
      • Plaid OAuth Support
    • Client Dashboard (Alpha)
  • User Support Reference
    • User Account Flags
      • KYC Review
      • Transaction Processing
      • NSFs and Returned Payments
      • Fraud
    • Transactional Emails
Powered by GitBook
On this page

Was this helpful?

  1. Integration Guides
  2. React JS (Beta)

Callbacks

PreviousPreset OrdersNextTheming

Last updated 1 year ago

Was this helpful?

onTransactionComplete

A function that is called whenever a transaction is completed even if there was a failure. As part of the data in the OrderStatus object, you will receive the userId for the user that completed the transaction and the ActivityItem detailing the transaction. The userId and activityItem will not be returned if there was an error in processing the order.

The OrderStatus object is described

Example

<RatioButton onTransactionComplete={(orderStatus: OrderStatus)=> {
    alert(orderStatus.status)
}}/>

onClose

A function that is called after the Ratio Modal WebView. There is no default behaviour if not provided. As of writing this documentation this function will be called when the user presses the close button in the dialog. It will call the "onClose" function and then close the dialog.

Example

<RatioButton onClose={() => {
    alert('Closed')
}}/>

onLogin

A function that is called when the a user is fully authenticated. It is also called when the user's account has been created. The callback returns a RatioUser object that is described .

Example

<RatioButton onLogin={(user: RatioUser) => {
    alert(user.firstName)
}}/>

onPress

An async function that is called as soon as the user pressed the RatioButton component. Please note that if an error occurs in this function, the onError callback (see below) is called with an Error object that details the error. While the onPress is being processed, the RatioButton is disabled and shows loading text.

Example

<RatioButton onPress={async () => {
    await yourFunction()
}}/>

onError

A function that takes error object. This is called if an error occurs when the RatioButton is pressed and before the modal shows. The error object that is passed in is the standard JavaScript error object.

Example

<RatioButton onError={(error: Error) => {
    alert(error)
}}/>
here
here