-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fiat on Ramp: Payments #1666
Merged
Merged
Fiat on Ramp: Payments #1666
Changes from 132 commits
Commits
Show all changes
138 commits
Select commit
Hold shift + click to select a range
d56d9c3
Add react-native-payments
wachunei 3164ffd
Initial apple pay screen
wachunei c68d033
Add Transak order updates and notifications
wachunei 20fa41f
Hide debug view
wachunei fc9a629
Add quick amounts and keypad behavior
wachunei 9578cea
Add 0. case to keypad
wachunei 0445dbc
Add some more details about transak
wachunei bff7bac
enable-apple-pay
estebanmino 34759b8
Add initial apple pay processing
wachunei 9b771c5
Add react-native-payments
wachunei b8808cd
Initial apple pay screen
wachunei 466dc97
Add Transak order updates and notifications
wachunei fa3e24d
Hide debug view
wachunei c1254a4
Add quick amounts and keypad behavior
wachunei 26d1a0f
Add 0. case to keypad
wachunei 3b2685d
Add some more details about transak
wachunei 82524ff
Add initial apple pay processing
wachunei 71ecdb3
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
wachunei ef783ea
Merge branch 'enable-apple-pay' into feature/rn-payments
wachunei c42c070
Reorganize components and variables
wachunei 662be37
analytics only on not dev
estebanmino cc647ba
startwatcher
estebanmino 93b08e3
Add Wyre Apple Pay processing
wachunei 0548602
Move images to images folder
wachunei 9474f8a
dev
estebanmino e787ff5
Optimize for small devices
wachunei 710977b
Merge branch 'develop' into fix-env-vars
estebanmino 5befb4c
Add Android Purchase Method Screen
wachunei 03a74f2
Make Wyre Apple Pay depend on selected network
wachunei 0ea2e99
Remove react-native-dotenv
wachunei ce3c932
Merge remote-tracking branch 'origin/fix-env-vars' into feature/rn-pa…
wachunei 9713380
Fix env vars, babel plugin replaces string, is not an object
wachunei a34c5f8
Add i18n for fiat orders ui and notifications
wachunei 1776256
Add missing i18n to apple pay amount screen
wachunei 4a63230
Fix i18n argument for failed fiat order placement
wachunei 773e581
Add home graphic
wachunei 7be3c73
Add Logger to Fiat Orders creation and processing
wachunei ceea681
Add Aborted apple pay check
wachunei a5d61bb
env.
estebanmino d1f5bf1
Merge branch 'fix-env-vars' into feature/rn-payments
estebanmino 1a19dfa
Add wyre rates to apple pay amount screen
wachunei 594463f
add react-native-payments from fork
wachunei 6e7250a
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
estebanmino d3738cc
Add Logger.message
wachunei b4475fa
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
estebanmino d37dff2
circleci
estebanmino 4bcff46
Add AppConstants
wachunei 86b6cdf
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
estebanmino 7fe6e92
Add requestbin debugging
wachunei 7a78633
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
estebanmino 3c2758d
Fix apple pay attempt
wachunei 5ac16d5
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
estebanmino 94e41a1
Limit card payment to debit cards
wachunei 1826453
Fix wyre transfer fees and update order always in state
wachunei c4c80ab
Format amount in Fiat Order notification
wachunei 027156a
Deactivate Wyre promotion
wachunei 1bfb007
Add alert when trying to buy in incorrect network
wachunei ed643b8
Add some missing translations
wachunei 98966c6
Add buy eth to SendTo balance 0 warning
wachunei 928a05e
Change credit card to debit card and transfer
wachunei 216af76
Remove home graphic and change display rules
wachunei d6c50ca
Fix margins
wachunei be1e6cb
Add allowedToBuy function to control by device and network
wachunei 35e2f03
Improve paymentMethod Modal for small screens
wachunei 4e8dfbe
Add Analytics
wachunei 6b94bb3
Merge branch 'develop' into feature/rn-payments
wachunei 7946431
Add improved Receive Drawer
wachunei 0813398
Remove logger.messages and add errors to track
wachunei c40ba88
Merge branch 'feature/improved-receive-drawer' into feature/rn-payments
wachunei 9df2107
Remove logger.messages and add errors to track
wachunei 5e2af7a
Merge branch 'develop' into feature/rn-payments
wachunei b5686b2
Move Fiat Orders polling frequency to AppConstants
wachunei 81a2e9d
Merge branch 'develop' into feature/rn-payments
wachunei 691512b
Fix duplicated proptypes for transak webview
wachunei c0821d3
Remove .env from .gitignore
wachunei 690f4a1
Add marginVertical and documentation to props in Base text component
wachunei c1e3ead
Add marginVertical and documentation to props in base Title component
wachunei 89a0191
Use same disabled style for text and logo in apple pay button
wachunei 43b8f26
Remove code used for debugging
wachunei 4cc2a5e
Add apple pay UI i18n
wachunei 5160c79
Add propTypes comments to Apple Pay Payment Method screen
wachunei c8ff36b
Remove comments from network alert
wachunei ff770cf
Remove Roboto font usage
wachunei 62514f4
Add createdAt property to FiatOrder
wachunei 4bbd5fd
Add cryptoAmount to transakOrderRedirect handler
wachunei 543776f
Add Fiat Orders List View
wachunei d837098
Merge branch 'develop' into feature/rn-payments
wachunei a8af8ce
Remove unnecessary fragment
wachunei f58d193
Merge branch 'develop' into feature/rn-payments
wachunei fade784
Add toLocaleString to Order summary
wachunei eb87d61
Prevent duplicate add order
wachunei 370d2af
Merge branch 'develop' into feature/rn-payments
wachunei 485f65f
Merge branch 'develop' into feature/rn-payments
wachunei fd1be9d
Merge branch 'develop' into feature/rn-payments
wachunei ff8cc54
Fix summary displaying NaN values
wachunei 010ebdf
Merge branch 'develop' into feature/rn-payments
estebanmino 3533135
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
estebanmino 9b5e309
bump CURRENT_PROJECT_VERSION:
estebanmino 2ea4e2d
Update merchant ids
wachunei 8129a60
Add error logger when apple pay fails
wachunei 60c4d76
merchantids
estebanmino f35cba8
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
estebanmino 368cceb
Merge branch 'develop' into feature/rn-payments
estebanmino 60084ba
publish-pre-release-android:
estebanmino 7d386e9
Merge branch 'develop' into feature/rn-payments
estebanmino 8f852c2
npx jetify
estebanmino e4aa389
xMerge branch 'develop' into feature/rn-payments
wachunei a6e28f0
Conditionally show account name
wachunei a5b94b8
Add ScrollView hack to modal
wachunei 78bca9e
Fix apple pay keypad for small device
wachunei c8da160
Fix transak logo for iphone 5
wachunei bf63807
issue 7
estebanmino 34b1d08
Improve heading title in iphone5s
wachunei a0565ed
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
estebanmino e523aa8
Merge branch 'develop' into feature/rn-payments
estebanmino 7831658
bump 514
estebanmino d50c5b4
Update countries list
wachunei 2cdb69c
bump 515
estebanmino fae9bc7
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
estebanmino 83dafe6
:protectWalletModalVisible:
estebanmino fcfcbd9
centeredTitle
estebanmino 8388e39
more protectWalletModalVisible
estebanmino fa2b76c
516
estebanmino 7f625f0
protectWalletModalVisible
estebanmino 6e49761
send android to browser
estebanmino 89b348a
circleci
estebanmino 1e1dfb7
Merge branch 'develop' into feature/rn-payments
estebanmino b75c99a
Revert "circleci"
estebanmino b2c2a02
react-native-webview
estebanmino 46a31a2
Revert "send android to browser"
estebanmino 01e9460
iuse react-native-webview-forked
estebanmino 8c9dcf1
517
estebanmino 39edafe
circleci
estebanmino 10cefbd
518
estebanmino 9069c89
Merge branch 'develop' into feature/rn-payments
estebanmino a82e69e
Merge branch 'develop' into feature/rn-payments
estebanmino fe1cedd
mocks and snaps
estebanmino 3a6764b
Merge branch 'develop' into feature/rn-payments
estebanmino File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { View, StyleSheet, TouchableOpacity } from 'react-native'; | ||
import Ionicons from 'react-native-vector-icons/Ionicons'; | ||
import { colors, fontStyles } from '../../styles/common'; | ||
|
||
import Text from './Text'; | ||
|
||
const styles = StyleSheet.create({ | ||
modalContainer: { | ||
width: '100%', | ||
backgroundColor: colors.white, | ||
borderRadius: 10 | ||
}, | ||
modalView: { | ||
flexDirection: 'column', | ||
justifyContent: 'center', | ||
alignItems: 'center' | ||
}, | ||
header: { | ||
borderBottomWidth: StyleSheet.hairlineWidth, | ||
borderColor: colors.grey100, | ||
flexDirection: 'row' | ||
}, | ||
title: { | ||
flex: 1, | ||
textAlign: 'center', | ||
fontSize: 18, | ||
marginVertical: 12, | ||
marginHorizontal: 24, | ||
color: colors.fontPrimary, | ||
...fontStyles.bold | ||
}, | ||
closeIcon: { paddingTop: 4, position: 'absolute', right: 16 }, | ||
body: { | ||
paddingHorizontal: 15 | ||
}, | ||
section: { | ||
paddingVertical: 16, | ||
flexDirection: 'row' | ||
}, | ||
sectionBorderBottom: { | ||
borderBottomColor: colors.grey100, | ||
borderBottomWidth: 1 | ||
}, | ||
column: { | ||
flex: 1 | ||
}, | ||
columnEnd: { | ||
alignItems: 'flex-end' | ||
}, | ||
sectionTitle: { | ||
...fontStyles.normal, | ||
fontSize: 10, | ||
color: colors.grey500, | ||
marginBottom: 8 | ||
} | ||
}); | ||
const DetailsModal = ({ children }) => ( | ||
<View style={styles.modalView}> | ||
<View style={styles.modalContainer}>{children}</View> | ||
</View> | ||
); | ||
|
||
const DetailsModalHeader = ({ style, ...props }) => <View style={[styles.header, style]} {...props} />; | ||
const DetailsModalTitle = ({ style, ...props }) => <Text style={[styles.title, style]} {...props} />; | ||
const DetailsModalCloseIcon = ({ style, ...props }) => ( | ||
<TouchableOpacity style={[styles.closeIcon, style]} {...props}> | ||
<Ionicons name={'ios-close'} size={38} /> | ||
</TouchableOpacity> | ||
); | ||
const DetailsModalBody = ({ style, ...props }) => <View style={[styles.body, style]} {...props} />; | ||
const DetailsModalSection = ({ style, borderBottom, ...props }) => ( | ||
<View style={[styles.section, borderBottom && styles.sectionBorderBottom]} {...props} /> | ||
); | ||
const DetailsModalSectionTitle = ({ style, ...props }) => <Text style={[styles.sectionTitle, style]} {...props} />; | ||
const DetailsModalColumn = ({ style, end, ...props }) => ( | ||
<View style={[styles.column, end && styles.columnEnd, style]} {...props} /> | ||
); | ||
|
||
DetailsModal.Header = DetailsModalHeader; | ||
DetailsModal.Title = DetailsModalTitle; | ||
DetailsModal.CloseIcon = DetailsModalCloseIcon; | ||
DetailsModal.Body = DetailsModalBody; | ||
DetailsModal.Section = DetailsModalSection; | ||
DetailsModal.SectionTitle = DetailsModalSectionTitle; | ||
DetailsModal.Column = DetailsModalColumn; | ||
|
||
/** | ||
* Any other external style defined in props will be applied | ||
*/ | ||
const stylePropType = PropTypes.oneOfType([PropTypes.object, PropTypes.array]); | ||
|
||
DetailsModal.propTypes = { | ||
children: PropTypes.node | ||
}; | ||
|
||
DetailsModalHeader.propTypes = { | ||
style: stylePropType | ||
}; | ||
DetailsModalTitle.propTypes = { | ||
style: stylePropType | ||
}; | ||
DetailsModalCloseIcon.propTypes = { | ||
style: stylePropType | ||
}; | ||
DetailsModalBody.propTypes = { | ||
style: stylePropType | ||
}; | ||
DetailsModalSection.propTypes = { | ||
style: stylePropType, | ||
/** | ||
* Adds a border to the bottom of the section | ||
*/ | ||
borderBottom: PropTypes.bool | ||
}; | ||
DetailsModalSectionTitle.propTypes = { | ||
style: stylePropType | ||
}; | ||
DetailsModalColumn.propTypes = { | ||
style: stylePropType, | ||
/** | ||
* Aligns column content to flex-end | ||
*/ | ||
end: PropTypes.bool | ||
}; | ||
export default DetailsModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { StyleSheet, View } from 'react-native'; | ||
import Device from '../../util/Device'; | ||
import { colors, fontStyles } from '../../styles/common'; | ||
import Text from './Text'; | ||
|
||
const styles = StyleSheet.create({ | ||
wrapper: { | ||
padding: 15, | ||
minHeight: Device.isIos() ? 95 : 100 | ||
}, | ||
date: { | ||
color: colors.fontSecondary, | ||
fontSize: 12, | ||
marginBottom: 10, | ||
...fontStyles.normal | ||
}, | ||
content: { | ||
flexDirection: 'row' | ||
}, | ||
actions: { | ||
flexDirection: 'row', | ||
paddingTop: 10, | ||
paddingLeft: 40 | ||
}, | ||
icon: { | ||
flexDirection: 'row', | ||
alignItems: 'center' | ||
}, | ||
body: { | ||
flex: 1, | ||
marginLeft: 15 | ||
}, | ||
amounts: { | ||
flex: 0.6, | ||
alignItems: 'flex-end' | ||
}, | ||
title: { | ||
fontSize: 15, | ||
color: colors.fontPrimary | ||
}, | ||
amount: { | ||
fontSize: 15, | ||
color: colors.fontPrimary | ||
}, | ||
fiatAmount: { | ||
fontSize: 12, | ||
color: colors.fontSecondary, | ||
textTransform: 'uppercase' | ||
} | ||
}); | ||
|
||
const ListItem = ({ style, ...props }) => <View style={[styles.wrapper, style]} {...props} />; | ||
|
||
const ListItemDate = ({ style, ...props }) => <Text style={[styles.date, style]} {...props} />; | ||
const ListItemContent = ({ style, ...props }) => <View style={[styles.content, style]} {...props} />; | ||
const ListItemActions = ({ style, ...props }) => <View style={[styles.actions, style]} {...props} />; | ||
const ListItemIcon = ({ style, ...props }) => <View style={[styles.icon, style]} {...props} />; | ||
const ListItemBody = ({ style, ...props }) => <View style={[styles.body, style]} {...props} />; | ||
const ListItemTitle = ({ style, ...props }) => <Text style={[styles.title, style]} {...props} />; | ||
const ListItemAmounts = ({ style, ...props }) => <View style={[styles.amounts, style]} {...props} />; | ||
const ListItemAmount = ({ style, ...props }) => <Text style={[styles.amount, style]} {...props} />; | ||
const ListItemFiatAmount = ({ style, ...props }) => <Text style={[styles.fiatAmount, style]} {...props} />; | ||
|
||
ListItem.Date = ListItemDate; | ||
ListItem.Content = ListItemContent; | ||
ListItem.Actions = ListItemActions; | ||
ListItem.Icon = ListItemIcon; | ||
ListItem.Body = ListItemBody; | ||
ListItem.Title = ListItemTitle; | ||
ListItem.Amounts = ListItemAmounts; | ||
ListItem.Amount = ListItemAmount; | ||
ListItem.FiatAmount = ListItemFiatAmount; | ||
|
||
export default ListItem; | ||
|
||
/** | ||
* Any other external style defined in props will be applied | ||
*/ | ||
const stylePropType = PropTypes.oneOfType([PropTypes.object, PropTypes.array]); | ||
|
||
ListItem.propTypes = { | ||
style: stylePropType | ||
}; | ||
ListItemDate.propTypes = { | ||
style: stylePropType | ||
}; | ||
ListItemContent.propTypes = { | ||
style: stylePropType | ||
}; | ||
ListItemActions.propTypes = { | ||
style: stylePropType | ||
}; | ||
ListItemIcon.propTypes = { | ||
style: stylePropType | ||
}; | ||
ListItemBody.propTypes = { | ||
style: stylePropType | ||
}; | ||
ListItemTitle.propTypes = { | ||
style: stylePropType | ||
}; | ||
ListItemAmounts.propTypes = { | ||
style: stylePropType | ||
}; | ||
ListItemAmount.propTypes = { | ||
style: stylePropType | ||
}; | ||
ListItemFiatAmount.propTypes = { | ||
style: stylePropType | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { useState } from 'react'; | ||
|
||
function ModalHandler({ children }) { | ||
const [isVisible, setVisible] = useState(false); | ||
|
||
const showModal = () => setVisible(true); | ||
const hideModal = () => setVisible(true); | ||
const toggleModal = () => setVisible(!isVisible); | ||
|
||
if (typeof children === 'function') { | ||
return children({ isVisible, toggleModal, showModal, hideModal }); | ||
} | ||
|
||
return children; | ||
} | ||
|
||
export default ModalHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import Text from './Text'; | ||
import { colors } from '../../styles/common'; | ||
import { StyleSheet } from 'react-native'; | ||
import { FIAT_ORDER_STATES } from '../../reducers/fiatOrders'; | ||
import { strings } from '../../../locales/i18n'; | ||
|
||
const styles = StyleSheet.create({ | ||
status: { | ||
marginTop: 4, | ||
fontSize: 12, | ||
letterSpacing: 0.5 | ||
} | ||
}); | ||
|
||
export const ConfirmedText = props => <Text bold green style={styles.status} {...props} />; | ||
export const PendingText = props => <Text bold style={[styles.status, { color: colors.orange }]} {...props} />; | ||
export const FailedText = props => <Text bold style={[styles.status, { color: colors.red }]} {...props} />; | ||
|
||
function StatusText({ status, context, ...props }) { | ||
switch (status) { | ||
case 'Confirmed': | ||
case 'confirmed': | ||
return <ConfirmedText>{strings(`${context}.${status}`)}</ConfirmedText>; | ||
case 'Pending': | ||
case 'pending': | ||
case 'Submitted': | ||
case 'submitted': | ||
return <PendingText>{strings(`${context}.${status}`)}</PendingText>; | ||
case 'Failed': | ||
case 'Cancelled': | ||
case 'failed': | ||
case 'cancelled': | ||
return <FailedText>{strings(`${context}.${status}`)}</FailedText>; | ||
|
||
case FIAT_ORDER_STATES.COMPLETED: | ||
return <ConfirmedText>{strings(`${context}.completed`)}</ConfirmedText>; | ||
case FIAT_ORDER_STATES.PENDING: | ||
return <PendingText>{strings(`${context}.pending`)}</PendingText>; | ||
case FIAT_ORDER_STATES.FAILED: | ||
return <FailedText>{strings(`${context}.failed`)}</FailedText>; | ||
case FIAT_ORDER_STATES.CANCELLED: | ||
return <FailedText>{strings(`${context}.cancelled`)}</FailedText>; | ||
|
||
default: | ||
return ( | ||
<Text bold style={styles.status}> | ||
{status} | ||
</Text> | ||
); | ||
} | ||
} | ||
|
||
StatusText.defaultProps = { | ||
context: 'transaction' | ||
}; | ||
|
||
StatusText.propTypes = { | ||
status: PropTypes.string.isRequired, | ||
context: PropTypes.string | ||
}; | ||
|
||
export default StatusText; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reminder to fix this when merge