Skip to content

Commit

Permalink
chore(merge): release 4.61 to 4.62
Browse files Browse the repository at this point in the history
  • Loading branch information
schnogz committed Dec 17, 2021
2 parents 478d921 + c0fccd2 commit 424c046
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,9 @@ export default ({ api, coreSagas, networks }: { api: APIType; coreSagas: any; ne
} as WalletOptionsType['domains'])

let attributes

const paymentSuccessLink = `${domains.walletHelper}/wallet-helper/3ds-payment-success/#/`

if (
order.paymentType === BSPaymentTypes.PAYMENT_CARD ||
order.paymentType === BSPaymentTypes.USER_CARD
Expand All @@ -470,10 +473,9 @@ export default ({ api, coreSagas, networks }: { api: APIType; coreSagas: any; ne
order.paymentMethodId || paymentMethodId
? {
everypay: {
customerUrl: `${domains.walletHelper}/wallet-helper/everypay/#/response-handler`
customerUrl: paymentSuccessLink
},
// TODO add correct redirect url here for checkout, everypay and stripe, like `card-provider`
redirectURL: `${domains.walletHelper}/wallet-helper/everypay/#/response-handler`
redirectURL: paymentSuccessLink
}
: undefined
} else if (account?.partner === BankPartners.YAPILY) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ const getPayloadObjectForStep = (payload: StepActionsPayload) => {
case 'CHECKOUT_CONFIRM':
case 'ORDER_SUMMARY':
case 'OPEN_BANKING_CONNECT':
return { order: payload.order, step: payload.step }
case '3DS_HANDLER_EVERYPAY':
case '3DS_HANDLER_STRIPE':
case '3DS_HANDLER_CHECKOUTDOTCOM':
Expand Down Expand Up @@ -470,6 +469,7 @@ const buySellSlice = createSlice({
break
case '3DS_HANDLER_EVERYPAY':
case '3DS_HANDLER_STRIPE':
case '3DS_HANDLER_CHECKOUTDOTCOM':
case 'CHECKOUT_CONFIRM':
case 'OPEN_BANKING_CONNECT':
case 'ORDER_SUMMARY':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { bindActionCreators } from 'redux'
import styled from 'styled-components'

import { WalletOptionsType } from '@core/types'
import DataError from 'components/DataError'
import { FlyoutWrapper } from 'components/Flyout'
import { actions, selectors } from 'data'
import { RootState } from 'data/rootReducer'
Expand All @@ -23,8 +24,8 @@ const ThreeDSHandlerCheckoutDotCom = ({ buySellActions, domains, order }: Props)
throw new Error('Order is not defined')
}

const handlePostMessage = async ({ data }: { data: { provider: 'checkoutdotcom' } }) => {
if (data.provider !== 'checkoutdotcom') return
const handlePostMessage = async ({ data }: { data: { payment: 'successful' } }) => {
if (data.payment !== 'successful') return

buySellActions.pollOrder(order.id)
}
Expand All @@ -35,7 +36,15 @@ const ThreeDSHandlerCheckoutDotCom = ({ buySellActions, domains, order }: Props)
return () => window.removeEventListener('message', handlePostMessage, false)
})

const paymentLink = encodeURIComponent(order.attributes?.cardProvider?.paymentLink || '')
const handleRefresh = () => {
buySellActions.destroyCheckout()
}

if (!order.attributes?.cardProvider?.paymentLink) {
return <DataError onClick={handleRefresh} />
}

const paymentLink = encodeURIComponent(order.attributes.cardProvider.paymentLink)

return (
<CustomFlyoutWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class ThreeDSHandlerEverypay extends PureComponent<Props, State> {
window.removeEventListener('message', this.handlePostMessage, false)
}

handlePostMessage = ({ data }: { data: { provider: 'everypay' } }) => {
if (data.provider !== 'everypay') return
handlePostMessage = ({ data }: { data: { payment: 'successful' } }) => {
if (data.payment !== 'successful') return

this.setState({ threeDSCallbackReceived: true })
// @ts-ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,21 @@ const ThreeDSHandlerStripe = ({ buySellActions, domains, order }: Props) => {
buySellActions.destroyCheckout()
}

if (
!order.attributes?.cardProvider?.publishableApiKey ||
!order.attributes?.cardProvider?.clientSecret
) {
return <DataError onClick={handleRefresh} />
}

if (isError) {
return <DataError onClick={handleRefresh} />
}

return (
<CustomFlyoutWrapper>
<Iframe
src={`${domains.walletHelper}/wallet-helper/stripe/#/paymentLink/${order?.attributes?.cardProvider?.publishableApiKey}/${order?.attributes?.cardProvider?.clientSecret}`}
src={`${domains.walletHelper}/wallet-helper/stripe/#/paymentLink/${order.attributes.cardProvider.publishableApiKey}/${order.attributes.cardProvider.clientSecret}`}
/>
</CustomFlyoutWrapper>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const MarketForm: React.FC<Props> = (props: Props) => {
{props.marketplace.collection?.name}
</Text>
<Text style={{ marginTop: '8px' }} color='black' weight={600} size='14px'>
<FormattedMessage id='copy.7_day_vol' defaultMessage='7 Day Volume' />
<FormattedMessage id='copy.one_day_vol' defaultMessage='1 Day Volume' />
</Text>
<CoinDisplay
coin='ETH'
Expand Down Expand Up @@ -135,8 +135,8 @@ const MarketForm: React.FC<Props> = (props: Props) => {
value: item.value
}),
[
{ text: 'Volume: High to Low', value: '7_day_vol-DESC' },
{ text: 'Volume: Low to High', value: '7_day_vol-ASC' },
{ text: 'Volume: High to Low', value: 'one_day_vol-DESC' },
{ text: 'Volume: Low to High', value: 'one_day_vol-ASC' },
{ text: 'Floor Price: High to Low', value: 'floor_price-DESC' },
{ text: 'Floor Price: Low to High', value: 'floor_price-ASC' },
{ text: 'Avg. Price: High to Low', value: 'average_price-DESC' },
Expand Down Expand Up @@ -198,5 +198,5 @@ type Props = OwnProps
export default reduxForm<{}, OwnProps>({
destroyOnUnmount: false,
form: 'nftMarketplace',
initialValues: { collection: 'doodles-official', sortBy: '7_day_vol-DESC' }
initialValues: { collection: 'doodles-official', sortBy: 'one_day_vol-DESC' }
})(MarketForm)
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default ({ apiUrl, get, post }) => {
}

const getNftCollections = (
sortedBy = '7_day_vol',
sortedBy = 'one_day_vol',
direction = 'DESC'
): ExplorerGatewayNftCollectionType[] => {
return get({
Expand Down

0 comments on commit 424c046

Please sign in to comment.