Docs

GetBuyWithFiatStatus

Get onramp status for an intent id returned by BuyWithFiat.

Usage

using Thirdweb.Pay;
public async void GetStatus()
{
var status = await ThirdwebManager.Instance.SDK.Pay.GetBuyWithFiatStatus(_intentId);
if (status.Status == OnRampStatus.PAYMENT_FAILED.ToString() || status.Status == OnRampStatus.ON_RAMP_TRANSFER_FAILED.ToString())
ThirdwebDebug.LogWarning($"Failed! Reason: {status.FailureMessage}");
ThirdwebDebug.Log($"Status: {JsonConvert.SerializeObject(status, Formatting.Indented)}");
}

In some cases, you may onramp to an intermediary token that requires an additional step, in these cases the CRYPTO_SWAP_REQUIRED status indicates that the onramp transfer has completed and you may now use the intent id to trigger a BuyWithCrypto transaction to get to your destination token. The flow is the same for GetBuyWithCryptoQuote, though you may now pass the intent id as a parameter to link both statuses together.