Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paul/new banxa #4476

Merged
merged 20 commits into from
Sep 26, 2023
Merged

Paul/new banxa #4476

merged 20 commits into from
Sep 26, 2023

Conversation

paullinator
Copy link
Member

@paullinator paullinator commented Sep 21, 2023

CHANGELOG

none

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

@paullinator paullinator force-pushed the paul/newBanxa branch 3 times, most recently from 2931480 to b251601 Compare September 21, 2023 20:35
"paymentTypes": ["pix"],
"description": "Fee: 3-4%\nSettlement: 5 min - 24 hours",
"title": "Pix",
"// Do not enable until we have a Pix logo": "",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Still enabled

Copy link
Member Author

Choose a reason for hiding this comment

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

Didn't want to block this merge for 3.19 and we can easily patch later. I created a task for design to create one.

@@ -37,7 +37,7 @@ export type FiatProviderQuoteErrorTypes = FiatProviderQuoteErrorTypesLimit | Fia
// amountType
export type FiatProviderQuoteError =
| { providerId: string; errorType: FiatProviderQuoteErrorTypesOther }
| { providerId: string; errorType: FiatProviderQuoteErrorTypesLimit; errorAmount?: number }
| { providerId: string; errorType: FiatProviderQuoteErrorTypesLimit; errorAmount?: number; displayCurrencyCode?: string }
Copy link
Collaborator

Choose a reason for hiding this comment

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

direction would be useful to add here too

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nevermind, saw the next commit

@@ -107,12 +107,12 @@ export const amountQuoteFiatPlugin: FiatPluginFactory = async (params: FiatPlugi
// Pop up modal to pick wallet/asset
// TODO: Filter wallets according to fiats supported by allowed providers
Copy link
Collaborator

Choose a reason for hiding this comment

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

This TODO seems outdated now. Looks like we're just going to always force a fiat
if required, regardless of the wallet fiat

Copy link
Member Author

Choose a reason for hiding this comment

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

Not always. There are cases where a payment method can allow different fiats. ie Visa/MC

@@ -206,17 +208,18 @@ export const amountQuoteFiatPlugin: FiatPluginFactory = async (params: FiatPlugi
goodQuotes.push(quote)
}

const noQuoteText = direction === 'buy' ? lstrings.fiat_plugin_buy_no_quote : lstrings.fiat_plugin_sell_no_quote
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move error string logic into getBestError/getErrorText

Copy link
Member Author

Choose a reason for hiding this comment

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

This would duplicate the logic in the two funcs getBestError/getErrorText. Where it is now keeps the logic consistent.

@@ -137,7 +137,7 @@ export const amountQuoteFiatPlugin: FiatPluginFactory = async (params: FiatPlugi
showUi.enterAmount({
headerTitle: isBuy ? sprintf(lstrings.fiat_plugin_buy_currencycode, currencyCode) : sprintf(lstrings.fiat_plugin_sell_currencycode_s, currencyCode),
initState: {
value1: '500'
value1: defaultFiatAmount ?? '500'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's move the default assignment to the top

lockUriPath: true,
nativePlugin: amountQuoteFiatPlugin,
forceFiatCurrencyCode: 'iso:TRY',
defaultFiatAmount: '2000',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this amount so much higher than our normal 500?

Copy link
Member Author

Choose a reason for hiding this comment

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

Turkish Lira is worth a LOT less

Copy link
Member Author

Choose a reason for hiding this comment

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

500 Lira doesn't meet the minimum purchase

Copy link
Collaborator

@Jon-edge Jon-edge Sep 22, 2023

Choose a reason for hiding this comment

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

Maybe we can do a TODO to have a conversion mechanism for default fiats if we ever do fiat-fiat rates

@paullinator paullinator force-pushed the paul/newBanxa branch 2 times, most recently from 9dc75e2 to b6c39ad Compare September 26, 2023 00:28
@paullinator
Copy link
Member Author

/rebase

Replace some wyre plugin check with dummy plugin check to retain code logic for future use.
Not all are enabled in this commit
This bypasses the wallet currency code so certain payment types can be ensured to use the right currency code filters (ie sepa)
Remove Poli as it is being deprecated
Retaining component code for rewards card as we expect to re-use that in the future.
This requires allowing the min/max limit error to specify the currencycode as Banxa only supports limits in the fiat amount, not the crypto amount
The original index of paymenttype would duplicate payment methods of the same payment type to stomp on top of each other. The 'id' is the true unique identifier.
Banxa's `api/payment-methods` does not return sell payment methods unless a source asset is specified. Even then it only returns paymentmethod objects which specify that one asset as allowed.

We now query the sell payment methods at getSupportedAssets for BTC, then possibly again in getQuote if the crypto asset isn't in the cache.
@paullinator paullinator merged commit a2a35ec into develop Sep 26, 2023
2 checks passed
@paullinator paullinator deleted the paul/newBanxa branch September 26, 2023 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants