@@ -38,6 +38,7 @@ import StyledLink from '../../components/StyledLink';
3838import { withUser } from '../../components/UserProvider' ;
3939
4040import { isValidExternalRedirect } from '../../pages/external-redirect' ;
41+ import { CustomPayoutMethodInstructions } from '../edit-collective/sections/receive-money/CustomPayoutMethodInstructions' ;
4142import { formatAccountDetails } from '../edit-collective/utils' ;
4243import Link from '../Link' ;
4344import { Survey , SURVEY_KEY } from '../Survey' ;
@@ -308,26 +309,11 @@ class ContributionFlowSuccess extends React.Component {
308309 } ;
309310
310311 renderBankTransferInformation = ( ) => {
311- const instructions = get ( this . props . data , 'order.toAccount.host.settings.paymentMethods.manual.instructions' , null ) ;
312- const bankAccount = get ( this . props . data , 'order.toAccount.host.bankAccount.data' , null ) ;
313-
312+ const customPaymentProvider = get ( this . props . data , 'order.customPaymentProvider' ) ;
314313 const amount = get ( this . props . data , 'order.amount.valueInCents' , 0 ) ;
315314 const platformTipAmount = get ( this . props . data , 'order.platformTipAmount.valueInCents' , 0 ) ;
316315 const totalAmount = amount + platformTipAmount ;
317316 const currency = get ( this . props . data , 'order.amount.currency' ) ;
318- const formattedAmount = formatCurrency ( totalAmount , currency , {
319- locale : this . props . intl . locale ,
320- currencyDisplay : 'code' ,
321- } ) ;
322-
323- const formattedValues = {
324- account : bankAccount ? formatAccountDetails ( bankAccount ) : '' ,
325- reference : get ( this . props . data , 'order.legacyId' , null ) ,
326- amount : formattedAmount ,
327- collective : get ( this . props . data , 'order.toAccount.name' , null ) ,
328- // Deprecated but still needed for compatibility
329- OrderId : get ( this . props . data , 'order.legacyId' , null ) ,
330- } ;
331317
332318 return (
333319 < Flex flexDirection = "column" justifyContent = "center" width = { [ 1 , 3 / 4 ] } px = { [ 4 , 0 ] } py = { [ 2 , 0 ] } >
@@ -338,31 +324,29 @@ class ContributionFlowSuccess extends React.Component {
338324 values = { I18nFormatters }
339325 />
340326 </ MessageBox >
341- { instructions && (
327+ { this . props . data ?. order ?. status === ORDER_STATUS . PENDING && customPaymentProvider && (
342328 < BankTransferInfoContainer my = { 3 } p = { 4 } >
343329 < H3 >
344330 < FormattedMessage id = "NewContributionFlow.PaymentInstructions" defaultMessage = "Payment instructions" />
345331 </ H3 >
346332 < Flex mt = { 2 } >
347- < Flex style = { { whiteSpace : 'pre-wrap' } } > { formatManualInstructions ( instructions , formattedValues ) } </ Flex >
333+ < CustomPayoutMethodInstructions
334+ instructions = { customPaymentProvider . instructions }
335+ formattedValues = { {
336+ // TODO account: accountDetails,
337+ reference : get ( this . props . data , 'order.legacyId' , null ) ,
338+ amount : formatCurrency ( totalAmount , currency , {
339+ locale : this . props . intl . locale ,
340+ currencyDisplay : 'name' ,
341+ } ) ,
342+ collective : get ( this . props . data , 'order.toAccount.name' , null ) ,
343+ // Deprecated but still needed for compatibility
344+ OrderId : get ( this . props . data , 'order.legacyId' , null ) ,
345+ } }
346+ />
348347 </ Flex >
349348 </ BankTransferInfoContainer >
350349 ) }
351- < Flex px = { 3 } mt = { 2 } >
352- < P fontSize = "16px" color = "black.700" >
353- < FormattedMessage
354- id = "NewContributionFlow.InTheMeantime"
355- defaultMessage = "In the meantime, you can see what {collective} is up to <CollectiveLink>on their Collective page</CollectiveLink>."
356- values = { {
357- collective : this . props . data . order . toAccount . name ,
358- CollectiveLink : getI18nLink ( {
359- as : Link ,
360- href : `/${ this . props . data . order . toAccount . slug } ` ,
361- } ) ,
362- } }
363- />
364- </ P >
365- </ Flex >
366350 </ Flex >
367351 ) ;
368352 } ;
0 commit comments