Skip to content

Conversation

@edwardysun
Copy link
Contributor

@edwardysun edwardysun commented Nov 6, 2024

Problem solved

Allow customers to override the fiat provider routing and specify the provider they want.

Fixes https://linear.app/thirdweb/issue/CNCT-2227/pro-only-keep-stripe-as-a-provider-for-pay


PR-Codex overview

This PR introduces the ability to specify a custom fiat provider through a new providerOverride parameter across several components, enhancing flexibility in fiat transactions.

Detailed summary

  • Added providerOverride parameter to ConnectButtonProps.ts.
  • Updated useSendTransaction.ts to include providerOverride.
  • Modified BuyScreen.tsx to pass providerOverride from buyWithFiatOptions.
  • Enhanced getQuote.ts with documentation for providerOverride.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@vercel
Copy link

vercel bot commented Nov 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 8:40pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 8:40pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 8:40pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 8:40pm

@changeset-bot
Copy link

changeset-bot bot commented Nov 6, 2024

⚠️ No Changeset found

Latest commit: 008cae5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 6, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@linear
Copy link

linear bot commented Nov 6, 2024

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 43 KB (0%) 861 ms (0%) 340 ms (+98.51% 🔺) 1.2 s
thirdweb (cjs) 103.05 KB (0%) 2.1 s (0%) 469 ms (+25.51% 🔺) 2.6 s
thirdweb (minimal + tree-shaking) 4.85 KB (0%) 97 ms (0%) 41 ms (+343.03% 🔺) 138 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 10 ms (+39.8% 🔺) 20 ms
thirdweb/react (minimal + tree-shaking) 17.56 KB (0%) 352 ms (0%) 24 ms (-40.89% 🔽) 375 ms

@codecov
Copy link

codecov bot commented Nov 6, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 45.69%. Comparing base (11d287b) to head (8318871).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
packages/thirdweb/src/pay/buyWithFiat/getQuote.ts 0.00% 1 Missing ⚠️
...act/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5330      +/-   ##
==========================================
- Coverage   45.69%   45.69%   -0.01%     
==========================================
  Files        1069     1069              
  Lines       55588    55590       +2     
  Branches     4062     4062              
==========================================
  Hits        25403    25403              
- Misses      29496    29498       +2     
  Partials      689      689              
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 11d287b
packages 40.83% <0.00%> (-0.01%) ⬇️

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
...react/core/hooks/transaction/useSendTransaction.ts 5.92% <ø> (ø)
packages/thirdweb/src/pay/buyWithFiat/getQuote.ts 2.43% <0.00%> (-0.07%) ⬇️
...act/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx 0.09% <0.00%> (-0.01%) ⬇️

* By default, we choose a recommended provider based on the location of the user, KYC status, and currency.
* If this is set, we will always choose this specific onramp provider, or error if this provider cannot support the user.
*/
providerOverride?: FiatProvider;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its weird to have both options. i think if ppl expect to be able to override, then lets just change the behavior of preferred to error if its not available

@edwardysun edwardysun closed this Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants