diff --git a/src/fiatExchanges/quotes/ExternalQuote.test.ts b/src/fiatExchanges/quotes/ExternalQuote.test.ts index b4f9c51135a..6d83f05586b 100644 --- a/src/fiatExchanges/quotes/ExternalQuote.test.ts +++ b/src/fiatExchanges/quotes/ExternalQuote.test.ts @@ -233,7 +233,20 @@ describe('ExternalQuote', () => { tokenId: mockCusdTokenId, }) quote.navigate() - expect(navigateToURI).toHaveBeenCalled() + expect(navigateToURI).toHaveBeenCalledWith('https://www.moonpay.com/') + }) + it('calls navigateToURI with quote specific url', () => { + const quote = new ExternalQuote({ + quote: { + ...(mockProviders[1].quote as RawProviderQuote[])[0], + url: 'https://example.com', + }, + provider: mockProviders[1], + flow: CICOFlow.CashIn, + tokenId: mockCusdTokenId, + }) + quote.navigate() + expect(navigateToURI).toHaveBeenCalledWith('https://example.com') }) }) diff --git a/src/fiatExchanges/quotes/ExternalQuote.ts b/src/fiatExchanges/quotes/ExternalQuote.ts index f510ec2f978..b959561850b 100644 --- a/src/fiatExchanges/quotes/ExternalQuote.ts +++ b/src/fiatExchanges/quotes/ExternalQuote.ts @@ -127,7 +127,8 @@ export default class ExternalQuote extends NormalizedQuote { tokenId: this.tokenId, }) } else { - navigateToURI(this.provider.url!) + const url = this.quote.url ?? this.provider.url + navigateToURI(url!) } } diff --git a/src/fiatExchanges/utils.tsx b/src/fiatExchanges/utils.tsx index 37c028c1b3e..6c286d20760 100644 --- a/src/fiatExchanges/utils.tsx +++ b/src/fiatExchanges/utils.tsx @@ -81,6 +81,7 @@ export interface RawProviderQuote { returnedAmount?: number fiatFee?: number extraReqs?: { mobileCarrier: 'Safaricom' | 'MTN' } + url?: string } export interface LegacyMobileMoneyProvider {