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

Fiat on Ramp: Payments #1666

Merged
merged 138 commits into from
Aug 18, 2020
Merged
Show file tree
Hide file tree
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 Jun 3, 2020
3164ffd
Initial apple pay screen
wachunei Jun 13, 2020
c68d033
Add Transak order updates and notifications
wachunei Jun 13, 2020
20fa41f
Hide debug view
wachunei Jun 13, 2020
fc9a629
Add quick amounts and keypad behavior
wachunei Jun 15, 2020
9578cea
Add 0. case to keypad
wachunei Jun 15, 2020
0445dbc
Add some more details about transak
wachunei Jun 15, 2020
bff7bac
enable-apple-pay
estebanmino Jun 16, 2020
34759b8
Add initial apple pay processing
wachunei Jun 17, 2020
9b771c5
Add react-native-payments
wachunei Jun 3, 2020
b8808cd
Initial apple pay screen
wachunei Jun 13, 2020
466dc97
Add Transak order updates and notifications
wachunei Jun 13, 2020
fa3e24d
Hide debug view
wachunei Jun 13, 2020
c1254a4
Add quick amounts and keypad behavior
wachunei Jun 15, 2020
26d1a0f
Add 0. case to keypad
wachunei Jun 15, 2020
3b2685d
Add some more details about transak
wachunei Jun 15, 2020
82524ff
Add initial apple pay processing
wachunei Jun 17, 2020
71ecdb3
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
wachunei Jun 17, 2020
ef783ea
Merge branch 'enable-apple-pay' into feature/rn-payments
wachunei Jun 17, 2020
c42c070
Reorganize components and variables
wachunei Jun 17, 2020
662be37
analytics only on not dev
estebanmino Jun 17, 2020
cc647ba
startwatcher
estebanmino Jun 18, 2020
93b08e3
Add Wyre Apple Pay processing
wachunei Jun 18, 2020
0548602
Move images to images folder
wachunei Jun 18, 2020
9474f8a
dev
estebanmino Jun 18, 2020
e787ff5
Optimize for small devices
wachunei Jun 18, 2020
710977b
Merge branch 'develop' into fix-env-vars
estebanmino Jun 18, 2020
5befb4c
Add Android Purchase Method Screen
wachunei Jun 18, 2020
03a74f2
Make Wyre Apple Pay depend on selected network
wachunei Jun 18, 2020
0ea2e99
Remove react-native-dotenv
wachunei Jun 19, 2020
ce3c932
Merge remote-tracking branch 'origin/fix-env-vars' into feature/rn-pa…
wachunei Jun 19, 2020
9713380
Fix env vars, babel plugin replaces string, is not an object
wachunei Jun 19, 2020
a34c5f8
Add i18n for fiat orders ui and notifications
wachunei Jun 19, 2020
1776256
Add missing i18n to apple pay amount screen
wachunei Jun 19, 2020
4a63230
Fix i18n argument for failed fiat order placement
wachunei Jun 19, 2020
773e581
Add home graphic
wachunei Jun 20, 2020
7be3c73
Add Logger to Fiat Orders creation and processing
wachunei Jun 22, 2020
ceea681
Add Aborted apple pay check
wachunei Jun 22, 2020
a5d61bb
env.
estebanmino Jun 22, 2020
d1f5bf1
Merge branch 'fix-env-vars' into feature/rn-payments
estebanmino Jun 22, 2020
1a19dfa
Add wyre rates to apple pay amount screen
wachunei Jun 22, 2020
594463f
add react-native-payments from fork
wachunei Jun 22, 2020
6e7250a
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
estebanmino Jun 22, 2020
d3738cc
Add Logger.message
wachunei Jun 22, 2020
b4475fa
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
estebanmino Jun 23, 2020
d37dff2
circleci
estebanmino Jun 23, 2020
4bcff46
Add AppConstants
wachunei Jun 23, 2020
86b6cdf
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
estebanmino Jun 23, 2020
7fe6e92
Add requestbin debugging
wachunei Jun 23, 2020
7a78633
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
estebanmino Jun 23, 2020
3c2758d
Fix apple pay attempt
wachunei Jun 24, 2020
5ac16d5
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
estebanmino Jun 24, 2020
94e41a1
Limit card payment to debit cards
wachunei Jun 24, 2020
1826453
Fix wyre transfer fees and update order always in state
wachunei Jun 24, 2020
c4c80ab
Format amount in Fiat Order notification
wachunei Jun 24, 2020
027156a
Deactivate Wyre promotion
wachunei Jun 24, 2020
1bfb007
Add alert when trying to buy in incorrect network
wachunei Jun 24, 2020
ed643b8
Add some missing translations
wachunei Jun 24, 2020
98966c6
Add buy eth to SendTo balance 0 warning
wachunei Jun 25, 2020
928a05e
Change credit card to debit card and transfer
wachunei Jun 25, 2020
216af76
Remove home graphic and change display rules
wachunei Jun 25, 2020
d6c50ca
Fix margins
wachunei Jun 25, 2020
be1e6cb
Add allowedToBuy function to control by device and network
wachunei Jun 26, 2020
35e2f03
Improve paymentMethod Modal for small screens
wachunei Jun 26, 2020
4e8dfbe
Add Analytics
wachunei Jun 26, 2020
6b94bb3
Merge branch 'develop' into feature/rn-payments
wachunei Jun 30, 2020
7946431
Add improved Receive Drawer
wachunei Jun 30, 2020
0813398
Remove logger.messages and add errors to track
wachunei Jul 1, 2020
c40ba88
Merge branch 'feature/improved-receive-drawer' into feature/rn-payments
wachunei Jul 1, 2020
9df2107
Remove logger.messages and add errors to track
wachunei Jul 1, 2020
5e2af7a
Merge branch 'develop' into feature/rn-payments
wachunei Jul 2, 2020
b5686b2
Move Fiat Orders polling frequency to AppConstants
wachunei Jul 2, 2020
81a2e9d
Merge branch 'develop' into feature/rn-payments
wachunei Jul 10, 2020
691512b
Fix duplicated proptypes for transak webview
wachunei Jul 10, 2020
c0821d3
Remove .env from .gitignore
wachunei Jul 10, 2020
690f4a1
Add marginVertical and documentation to props in Base text component
wachunei Jul 10, 2020
c1e3ead
Add marginVertical and documentation to props in base Title component
wachunei Jul 10, 2020
89a0191
Use same disabled style for text and logo in apple pay button
wachunei Jul 10, 2020
43b8f26
Remove code used for debugging
wachunei Jul 10, 2020
4cc2a5e
Add apple pay UI i18n
wachunei Jul 10, 2020
5160c79
Add propTypes comments to Apple Pay Payment Method screen
wachunei Jul 10, 2020
c8ff36b
Remove comments from network alert
wachunei Jul 10, 2020
ff770cf
Remove Roboto font usage
wachunei Jul 14, 2020
62514f4
Add createdAt property to FiatOrder
wachunei Jul 16, 2020
4bbd5fd
Add cryptoAmount to transakOrderRedirect handler
wachunei Jul 17, 2020
543776f
Add Fiat Orders List View
wachunei Jul 18, 2020
d837098
Merge branch 'develop' into feature/rn-payments
wachunei Jul 18, 2020
a8af8ce
Remove unnecessary fragment
wachunei Jul 18, 2020
f58d193
Merge branch 'develop' into feature/rn-payments
wachunei Jul 20, 2020
fade784
Add toLocaleString to Order summary
wachunei Jul 20, 2020
eb87d61
Prevent duplicate add order
wachunei Jul 21, 2020
370d2af
Merge branch 'develop' into feature/rn-payments
wachunei Jul 21, 2020
485f65f
Merge branch 'develop' into feature/rn-payments
wachunei Jul 22, 2020
fd1be9d
Merge branch 'develop' into feature/rn-payments
wachunei Jul 23, 2020
ff8cc54
Fix summary displaying NaN values
wachunei Jul 23, 2020
010ebdf
Merge branch 'develop' into feature/rn-payments
estebanmino Aug 6, 2020
3533135
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
estebanmino Aug 6, 2020
9b5e309
bump CURRENT_PROJECT_VERSION:
estebanmino Aug 6, 2020
2ea4e2d
Update merchant ids
wachunei Aug 10, 2020
8129a60
Add error logger when apple pay fails
wachunei Aug 10, 2020
60c4d76
merchantids
estebanmino Aug 10, 2020
f35cba8
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
estebanmino Aug 10, 2020
368cceb
Merge branch 'develop' into feature/rn-payments
estebanmino Aug 11, 2020
60084ba
publish-pre-release-android:
estebanmino Aug 12, 2020
7d386e9
Merge branch 'develop' into feature/rn-payments
estebanmino Aug 13, 2020
8f852c2
npx jetify
estebanmino Aug 13, 2020
e4aa389
xMerge branch 'develop' into feature/rn-payments
wachunei Aug 13, 2020
a6e28f0
Conditionally show account name
wachunei Aug 13, 2020
a5b94b8
Add ScrollView hack to modal
wachunei Aug 13, 2020
78bca9e
Fix apple pay keypad for small device
wachunei Aug 13, 2020
c8da160
Fix transak logo for iphone 5
wachunei Aug 13, 2020
bf63807
issue 7
estebanmino Aug 13, 2020
34b1d08
Improve heading title in iphone5s
wachunei Aug 13, 2020
a0565ed
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
estebanmino Aug 13, 2020
e523aa8
Merge branch 'develop' into feature/rn-payments
estebanmino Aug 13, 2020
7831658
bump 514
estebanmino Aug 13, 2020
d50c5b4
Update countries list
wachunei Aug 13, 2020
2cdb69c
bump 515
estebanmino Aug 13, 2020
fae9bc7
Merge branch 'feature/rn-payments' of github.com:wachunei/metamask-mo…
estebanmino Aug 13, 2020
83dafe6
:protectWalletModalVisible:
estebanmino Aug 14, 2020
fcfcbd9
centeredTitle
estebanmino Aug 14, 2020
8388e39
more protectWalletModalVisible
estebanmino Aug 14, 2020
fa2b76c
516
estebanmino Aug 14, 2020
7f625f0
protectWalletModalVisible
estebanmino Aug 14, 2020
6e49761
send android to browser
estebanmino Aug 17, 2020
89b348a
circleci
estebanmino Aug 17, 2020
1e1dfb7
Merge branch 'develop' into feature/rn-payments
estebanmino Aug 17, 2020
b75c99a
Revert "circleci"
estebanmino Aug 17, 2020
b2c2a02
react-native-webview
estebanmino Aug 17, 2020
46a31a2
Revert "send android to browser"
estebanmino Aug 17, 2020
01e9460
iuse react-native-webview-forked
estebanmino Aug 17, 2020
8c9dcf1
517
estebanmino Aug 17, 2020
39edafe
circleci
estebanmino Aug 18, 2020
10cefbd
518
estebanmino Aug 18, 2020
9069c89
Merge branch 'develop' into feature/rn-payments
estebanmino Aug 18, 2020
a82e69e
Merge branch 'develop' into feature/rn-payments
estebanmino Aug 18, 2020
fe1cedd
mocks and snaps
estebanmino Aug 18, 2020
3a6764b
Merge branch 'develop' into feature/rn-payments
estebanmino Aug 18, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,26 +176,27 @@ workflows:
only:
- master
- develop
- prep-node-deps:
filters:
branches:
ignore:
- master
- develop
- lint:
requires:
- prep-node-deps
- test-unit:
requires:
- prep-node-deps
- feature/rn-payments
Copy link
Contributor

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

# - prep-node-deps:
# filters:
# branches:
# ignore:
# - master
# - develop
# - lint:
# requires:
# - prep-node-deps
# - test-unit:
# requires:
# - prep-node-deps
# - test-e2e-ios:
# requires:
# - prep-node-deps
# - test-unit
- all-tests-pass:
requires:
- lint
- test-unit
# - all-tests-pass:
# requires:
# - lint
# - test-unit
# - test-e2e-ios
# - upload-coverage:
# requires:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.metamask;

import com.facebook.react.ReactApplication;
import com.reactnativecommunity.webviewforked.RNCWebViewForkedPackage;
import com.cmcewen.blurview.BlurViewPackage;
import android.content.Context;
import com.facebook.react.PackageList;
Expand Down
2 changes: 2 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
rootProject.name = 'MetaMask'
include ':react-native-webview-forked'
project(':react-native-webview-forked').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview-forked/android')
include ':@react-native-community_blur'
project(':@react-native-community_blur').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/blur/android')
include ':lottie-react-native'
Expand Down
127 changes: 127 additions & 0 deletions app/components/Base/DetailsModal.js
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;
112 changes: 112 additions & 0 deletions app/components/Base/ListItem.js
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
};
17 changes: 17 additions & 0 deletions app/components/Base/ModalHandler.js
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;
64 changes: 64 additions & 0 deletions app/components/Base/StatusText.js
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;
Loading