Skip to content

Commit d75f31e

Browse files
Add preferredProvider option for thirdweb pay (#103)
Co-authored-by: 0xFirekeeper <0xFirekeeper@gmail.com>
1 parent c158709 commit d75f31e

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

Thirdweb.Console/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@
411411
// Console.WriteLine($"Supported currencies: {JsonConvert.SerializeObject(supportedCurrencies, Formatting.Indented)}");
412412

413413
// // Get a Buy with Fiat quote
414+
// var fiatQuoteParamsWithProvider = new BuyWithFiatQuoteParams(fromCurrencySymbol: "USD", toAddress: walletAddress, toChainId: "137", toTokenAddress: Constants.NATIVE_TOKEN_ADDRESS, toAmount: "20", preferredProvider: "STRIPE");
414415
// var fiatQuoteParams = new BuyWithFiatQuoteParams(fromCurrencySymbol: "USD", toAddress: walletAddress, toChainId: "137", toTokenAddress: Constants.NATIVE_TOKEN_ADDRESS, toAmount: "20");
415416
// var fiatOnrampQuote = await ThirdwebPay.GetBuyWithFiatQuote(client, fiatQuoteParams);
416417
// Console.WriteLine($"Fiat onramp quote: {JsonConvert.SerializeObject(fiatOnrampQuote, Formatting.Indented)}");

Thirdweb/Thirdweb.Pay/ThirdwebPay.GetBuyWithFiatQuote.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public static async Task<BuyWithFiatQuoteResult> GetBuyWithFiatQuote(ThirdwebCli
2626
{ "toTokenAddress", buyWithFiatParams.ToTokenAddress },
2727
{ "toAmount", buyWithFiatParams.ToAmount },
2828
{ "toAmountWei", buyWithFiatParams.ToAmountWei },
29+
{ "preferredProvider", buyWithFiatParams.PreferredProvider },
2930
{ "maxSlippageBPS", buyWithFiatParams.MaxSlippageBPS?.ToString() }
3031
};
3132

Thirdweb/Thirdweb.Pay/Types.GetBuyWithFiatQuote.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ public class BuyWithFiatQuoteParams(
1818
string toAmount = null,
1919
string toAmountWei = null,
2020
double? maxSlippageBPS = null,
21-
bool isTestMode = false
21+
bool isTestMode = false,
22+
string preferredProvider = null
2223
)
2324
{
2425
/// <summary>
@@ -39,6 +40,11 @@ public class BuyWithFiatQuoteParams(
3940
[JsonProperty("fromAmountUnits")]
4041
public string FromAmountUnits { get; set; } = fromAmountUnits;
4142

43+
/// <summary>
44+
/// The provider to use on the application for thirdweb pay
45+
/// </summary>
46+
[JsonProperty("preferredProvider")]
47+
public string PreferredProvider { get; set; } = preferredProvider;
4248
/// <summary>
4349
/// The address to receive the purchased tokens.
4450
/// </summary>

0 commit comments

Comments
 (0)