diff --git a/app/assets/mastercard.png b/app/assets/mastercard.png
new file mode 100644
index 00000000..ed0c2411
Binary files /dev/null and b/app/assets/mastercard.png differ
diff --git a/app/assets/pump_addcard.png b/app/assets/pump_addcard.png
new file mode 100644
index 00000000..97695188
Binary files /dev/null and b/app/assets/pump_addcard.png differ
diff --git a/app/assets/pump_grey.png b/app/assets/pump_grey.png
index 5f18f916..c3c0c918 100644
Binary files a/app/assets/pump_grey.png and b/app/assets/pump_grey.png differ
diff --git a/app/assets/pump_logo.png b/app/assets/pump_logo.png
index 0e0f2b57..38a61160 100644
Binary files a/app/assets/pump_logo.png and b/app/assets/pump_logo.png differ
diff --git a/app/assets/pump_plain.png b/app/assets/pump_plain.png
index eee23318..7e86ff51 100644
Binary files a/app/assets/pump_plain.png and b/app/assets/pump_plain.png differ
diff --git a/app/assets/visa.png b/app/assets/visa.png
new file mode 100644
index 00000000..c0076a20
Binary files /dev/null and b/app/assets/visa.png differ
diff --git a/app/components/api/endpoints.js b/app/components/api/endpoints.js
index 25e91907..65a0c4b8 100644
--- a/app/components/api/endpoints.js
+++ b/app/components/api/endpoints.js
@@ -99,6 +99,7 @@ const getStores = post_pay + "stores";
const getStoreDetails = post_pay + "stores/details";
const payOutsideStore = post_pay + "pay/outside/store";
const getTransactionDetails = post_pay + "transactions";
+const getTransactionStatusDetails = post_pay + "transactions/statuspoll";
const postClaim = post_pay + "postpay/claim";
const postpay = post_pay + "postpay";
const getWalletPublicKey = post_pay + "wallet/register/publickey";
@@ -185,6 +186,7 @@ export default {
getStoreDetails,
payOutsideStore,
getTransactionDetails,
+ getTransactionStatusDetails,
postClaim,
postpay,
getFunding,
diff --git a/app/components/api/postpayapi.js b/app/components/api/postpayapi.js
index 97c25410..2ae3f459 100644
--- a/app/components/api/postpayapi.js
+++ b/app/components/api/postpayapi.js
@@ -18,12 +18,12 @@ export default async function API(endpoint, method, headers, params, body, onSuc
'Content-Type': 'application/json',
'x-p97-tenantid': '8ba3cd89-74be-4a7a-91a5-5eb59a2040b8',
'x-p97-apikey': EP.post_pay_api_key,
- 'x-p97-latitude': location.latitude,
- 'x-p97-longitude': location.longitude,
+ 'x-p97-latitude': location.latitude.toString(),
+ 'x-p97-longitude': location.longitude.toString(),
'x-p97-deviceid': deviceID,
'x-p97-appversionnumber': versionNumb,
'x-p97-appbundleid': appBundleID,
- 'x-p97-os': OS,
+ 'x-p97-os': "Android",
'x-p97-clientosversion': versionRelease
}
@@ -60,13 +60,14 @@ export default async function API(endpoint, method, headers, params, body, onSuc
'x-p97-clientosversion': versionRelease
}
- let paramsItem = Object.entries(params).map(([key, value]) => `${key}=${value}`)
-
if(endpoint.includes("/")) {
const newURL = endpoint.split("/");
url = newURL[0].includes(":") ? newURL[0] : EP[newURL[0]];
url = `${url}/${newURL[1]}`;
+ } else if(endpoint === "getTransactionStatusDetails") {
+ url = EP[endpoint] + `/${params.transactionID}`
} else {
+ let paramsItem = Object.entries(params).map(([key, value]) => `${key}=${value}`)
url = paramsItem.length > 1 ? `${EP[endpoint]}?${paramsItem.join('&').toString()}` : `${EP[endpoint]}/${Object.entries(params).map(([key, value]) => value).join('').toString()}`
}
diff --git a/app/components/assets.manager.js b/app/components/assets.manager.js
index c4add19f..138214d9 100644
--- a/app/components/assets.manager.js
+++ b/app/components/assets.manager.js
@@ -70,7 +70,10 @@ const icons = {
successmpinupdate: require("../assets/success_icon.png"),
no_connection: require('../assets/empty_state_no_internet.png'),
- animated_loading: require("../assets/loading.gif")
+ animated_loading: require("../assets/loading.gif"),
+
+ newMasterCard: require("../assets/mastercard.png"),
+ newVisa: require("../assets/visa.png")
}
const cards = {
diff --git a/app/components/drawer.js b/app/components/drawer.js
index 06594dee..43d107f7 100644
--- a/app/components/drawer.js
+++ b/app/components/drawer.js
@@ -97,7 +97,7 @@ const styles = {
marginTop: Theme.screen.h / 2 - 270,
},
android: {
- marginTop: Theme.screen.h / 4 + 10,
+ marginTop: Theme.screen.h / 2 - 230,
},
}),
},
@@ -131,7 +131,7 @@ class CustomDrawer extends React.PureComponent {
onLogout = async () => {
this.setState({ loading: true })
NetInfo.netstatus(async (isConnected) => {
- await DB.remove("iqair")
+
if (isConnected) {
this.setState({ loading: false })
this.logoutAccount(success => {
@@ -151,7 +151,7 @@ class CustomDrawer extends React.PureComponent {
logoutAccount = (successCallback, errorCallback) => {
DB.logoutAccount(success => {
successCallback()
- }, error => {
+ }, error => {
errorCallback()
})
}
diff --git a/app/components/elements.js b/app/components/elements.js
index 94e353b1..c15ada90 100644
--- a/app/components/elements.js
+++ b/app/components/elements.js
@@ -252,7 +252,7 @@ const transactiontable = function(Props){
if(item.item == 'EPURSE' || item.item == '') return null
return (
- {item.item}
+ {item.item}
{item.quantity}
{"\u20B1"} {Theme.formatter.CRNCY(item.price)}
)
@@ -750,7 +750,8 @@ const customAlert = function(props) {
noText,
yesButtonOnly,
noButtonOnly,
- theme
+ theme,
+ children
} = props;
if(!open) return null;
@@ -782,13 +783,20 @@ const customAlert = function(props) {
borderRadius: 10,
alignItems: 'center'
}}>
- {title}
- {body}
+ {
+ children ?
+ children
+ :
+ <>
+ {title}
+ {body}
-
- { !yesButtonOnly && {noText ? noText : "Cancel"} }
- { !noButtonOnly && {yesText ? yesText : "Yes"} }
-
+
+ { !yesButtonOnly && {noText ? noText : "Cancel"} }
+ { !noButtonOnly && {yesText ? yesText : "Yes"} }
+
+ >
+ }
diff --git a/app/components/header/guest.js b/app/components/header/guest.js
index f6ef7992..8d010146 100644
--- a/app/components/header/guest.js
+++ b/app/components/header/guest.js
@@ -75,7 +75,7 @@ class Header extends React.PureComponent {
-
+
Guest
diff --git a/app/components/storage/index.js b/app/components/storage/index.js
index 2c4ae47e..fa7633ae 100644
--- a/app/components/storage/index.js
+++ b/app/components/storage/index.js
@@ -401,6 +401,8 @@ export const setLogin = async () => {
export const logoutAccount = async (callback, catcher) => {
try{
+ await AsyncStorage.removeItem("iqair");
+ await AsyncStorage.removeItem("pumpPaymentCards");
await AsyncStorage.setItem(DBName + "enter_mpin", "false")
callback()
} catch(error) {
diff --git a/app/redux/reducers/AlertReducer.js b/app/redux/reducers/AlertReducer.js
index c9d511ae..b61d6a59 100644
--- a/app/redux/reducers/AlertReducer.js
+++ b/app/redux/reducers/AlertReducer.js
@@ -10,7 +10,8 @@ const initialState = {
noText: "",
yesButtonOnly: false,
noButtonOnly: false,
- theme: undefined
+ theme: undefined,
+ children: undefined
}
export function alertReducer(state = initialState, action) {
diff --git a/app/screens/account/activate/otp.js b/app/screens/account/activate/otp.js
index d3dac5e4..ef9f7da5 100644
--- a/app/screens/account/activate/otp.js
+++ b/app/screens/account/activate/otp.js
@@ -92,7 +92,6 @@ class TermsConditions extends React.Component {
lcard_uuid: success.data.userDetails.lcard_uuid,
mobile_number: success.data.userDetails.mobile
}
- console.log(this.props.route.params)
DB.setsession(sessiondata, (res) => {
this.setState({ loading: false })
if(onSuccess.status == 1){
diff --git a/app/screens/account/index.js b/app/screens/account/index.js
index 4e3b4e95..21d509d3 100644
--- a/app/screens/account/index.js
+++ b/app/screens/account/index.js
@@ -356,6 +356,7 @@ class About extends React.PureComponent {
fontFamily: 'Arial',
color: Theme.colors.primary,
marginLeft: 10,
+ marginBottom: 10,
fontSize: 16,
}}>
Add a Card
diff --git a/app/screens/login/apply/details.js b/app/screens/login/apply/details.js
index 3ff8715a..fbd3a287 100644
--- a/app/screens/login/apply/details.js
+++ b/app/screens/login/apply/details.js
@@ -7,7 +7,7 @@ import {
Text,
Image,
Alert,
- Keyboard
+ Platform
} from 'react-native';
import {
FormControl,
@@ -139,7 +139,7 @@ class ApplyCardDetails extends React.Component {
behavior='padding'
keyboardVerticalOffset={Platform.OS === 'ios' ? 50 : 70}
>
-
+
diff --git a/app/screens/login/apply/form.js b/app/screens/login/apply/form.js
index ed3cb3d4..6440a335 100644
--- a/app/screens/login/apply/form.js
+++ b/app/screens/login/apply/form.js
@@ -124,7 +124,7 @@ class ApplyForm extends React.Component {
//this.setState({ loading: true })
let uuid = await DB.get("deviceUUID");
let body = {
- birthdate: Theme.formatter.DT4API(Platform.OS === "android" ? this.state.selectedDate : this.state.birthdate || ""),
+ birthdate: Platform.OS === "android" ? this.state.selectedDate : Theme.formatter.DT4API(this.state.birthdate || ""),
cardtype_uuid: this.state.card.card_uuid,
deviceUUID: uuid,
email: this.state.email,
@@ -133,7 +133,7 @@ class ApplyForm extends React.Component {
lastname: this.state.lname,
mobile: Theme.formatter.PMBL(this.state.number.substr(1, this.state.number.length-1) || "")
}
-
+
await REQUEST("registerAndValidate", "post", {}, {}, body, async (signup) => {
console.log("APPLY RESULT", signup.data)
if(signup.status == 1){
@@ -151,7 +151,7 @@ class ApplyForm extends React.Component {
//this.setState({ loading: true })
let uuid = await DB.get("deviceUUID")
let body = {
- birthdate: Theme.formatter.DT4API(Platform.OS === "android" ? this.state.selectedDate : this.state.birthdate || ""),
+ birthdate: Platform.OS === "android" ? this.state.selectedDate : Theme.formatter.DT4API(this.state.birthdate || ""),
cardtype_uuid: this.state.card.card_uuid,
deviceUUID: uuid,
email: this.state.email,
@@ -160,7 +160,7 @@ class ApplyForm extends React.Component {
lastname: this.state.lname,
mobile: Theme.formatter.PMBL(this.state.number.substr(1, this.state.number.length-1) || "")
}
-
+
await REQUEST("registerAndValidate", "post", {}, {}, body, async (signup) => {
console.log("APPLY RESULT", signup.data)
if(signup.status == 1){
@@ -178,7 +178,7 @@ class ApplyForm extends React.Component {
this.setState({ loading: true })
let uuid = await DB.get("deviceUUID")
let body = {
- birthdate: Theme.formatter.DT4API(this.state.birthdate || ""),
+ birthdate: Theme.formatter.DT4API(Platform.OS === 'android' ? this.state.selectedDate : this.state.birthdate || ""),
cardtype_uuid: this.state.card.card_uuid,
deviceUUID: uuid,
email: this.state.email,
@@ -187,9 +187,8 @@ class ApplyForm extends React.Component {
lastname: this.state.lname,
mobile: Theme.formatter.PMBL(this.state.number.substr(1, this.state.number.length-1) || "")
}
-
+
await REQUEST("submitRegistration", "post", {}, {}, body, async (signup) => {
- console.log("APPLY RESULT", signup.data)
if(signup.status == 1){
await REQUEST("user_profile", "get", {
Authorization: "Bearer " + signup.data.token,
@@ -218,7 +217,7 @@ class ApplyForm extends React.Component {
this.setState({ loading: true })
let uuid = await DB.get("deviceUUID")
let body = {
- birthdate: Theme.formatter.DT4API(this.state.birthdate || ""),
+ birthdate: Platform.OS === "android" ? this.state.selectedDate : Theme.formatter.DT4API(this.state.birthdate || ""),
cardtype_uuid: this.state.card.card_uuid,
deviceUUID: uuid,
email: this.state.email,
@@ -227,6 +226,8 @@ class ApplyForm extends React.Component {
lastname: this.state.lname,
mobile: Theme.formatter.PMBL(this.state.number.substr(1, this.state.number.length-1) || "")
}
+
+ console.log(body)
await REQUEST("apply", "post", {}, {}, body, async (signup) => {
console.log("APPLY RESULT", signup.data)
diff --git a/app/screens/login/apply/otp.js b/app/screens/login/apply/otp.js
index dcd93b7f..2de24158 100644
--- a/app/screens/login/apply/otp.js
+++ b/app/screens/login/apply/otp.js
@@ -111,7 +111,7 @@ class TermsConditions extends React.PureComponent {
this.setState({ resend: true })
}
}, error => {
- console.log(error)
+ console.log('the err: ' + JSON.stringify(error));
})
}else{
Elements.nointernet2(this.props)
diff --git a/app/screens/login/index.js b/app/screens/login/index.js
index b02a735e..b30bfbdf 100644
--- a/app/screens/login/index.js
+++ b/app/screens/login/index.js
@@ -208,12 +208,12 @@ class AddAccountCard extends React.PureComponent {
-
+
{this.setState({ openOptions: true })}} style={{padding: 15, alignItems: 'flex-start', flex: 1}}>
- Contact Us
+ Contact Us
{}} style={{padding: 15, justifyContent: 'flex-end', flex: 1}}>
- {version}
+ {version}
diff --git a/app/screens/main/tab.js b/app/screens/main/tab.js
index 51ba95bc..0b70e4ba 100644
--- a/app/screens/main/tab.js
+++ b/app/screens/main/tab.js
@@ -1,10 +1,12 @@
-import React, {useEffect} from 'react';
-import { Platform, TouchableOpacity, Text } from 'react-native';
+import React from 'react';
+import { Platform, TouchableOpacity, View, Text } from 'react-native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { createStackNavigator } from '@react-navigation/stack';
-import { useNavigation, useRoute } from '@react-navigation/native';
+import { useNavigation } from '@react-navigation/native';
+import Theme from '../../components/theme.style';
+import Icon from '../../components/icons';
+import DB from '../../components/storage/';
import Elements from '../../components/elements.js';
-import Theme from '../../components/theme.style.js';
import HomeScreen from './home.js';
import PromosScreen from './promo/';
@@ -12,6 +14,8 @@ import IQAir from '../iqair';
import PayatpumpScreen from './../payatpump'; //disable temporarily
import StationsScreen from './station/';
import RewardsScreen from './rewards.js';
+import { useDispatch, useSelector } from 'react-redux';
+import { closeModal, openModal } from '../../redux/actions/AlertActions.js';
const Tab = createBottomTabNavigator();
@@ -38,8 +42,70 @@ const screenOptions = ({ route }) => ({
});
const PayatpumpTab = (navigation) => {
+ const app_theme = useSelector(state => state.appThemeReducer.theme);
+ const dispatch = useDispatch();
+
+ const noEmailContainer = () => {
+ const close = () => {
+ dispatch(closeModal());
+ }
+
+ const proceed = () => {
+ navigation.navigation.navigate('Payatpump');
+ dispatch(closeModal());
+ }
+
+ const update = () => {
+ dispatch(closeModal());
+ }
+
+ return (
+
+
+
+
+ No Email address is registered in your Account.
+ Update your Profile to receive an Email receipt.
+
+
+ Update Profile
+
+
+
+ Proceed without Updating
+
+
+ )
+ }
+
+ const onPress = async () => {
+ const isGuest = await DB.get("is_guest");
+ const user = await DB.profile();
+
+ if(isGuest) {
+ return dispatch(openModal({
+ open: true,
+ title: "Warning",
+ body: `You won't be able to access some\nof the pages unless you will enroll your\ncard or login.`,
+ yesText: "Okay",
+ yesButtonOnly: true,
+ theme: app_theme
+ }));
+ };
+
+ if(!user.data.email) {
+ return dispatch(openModal({
+ open: true,
+ children: noEmailContainer(),
+ theme: app_theme
+ }));
+ }
+
+ navigation.navigation.navigate('Payatpump');
+ }
+
return (
- navigation.navigation.navigate('Payatpump')}
+
@@ -81,12 +147,11 @@ const Home = () => {
}
export default function App(navigation) {
-
return (
-
+ {/* */}
diff --git a/app/screens/myprofile/profile/edit.js b/app/screens/myprofile/profile/edit.js
index de2c97bd..bc090b0a 100644
--- a/app/screens/myprofile/profile/edit.js
+++ b/app/screens/myprofile/profile/edit.js
@@ -218,8 +218,20 @@ class EditProfile extends React.PureComponent {
})
}
+ resetData = () => {
+ this.setState({
+ newmobile: "",
+ newaddress: null,
+ newcity: null,
+ vehicleType: null,
+ fuelType: null,
+ maritalStatus: null,
+ gender: null
+ })
+ }
+
updateProfileBlob = async (successCallback, errorCallback) => {
- let SESSION = await DB.session()
+ let SESSION = await DB.session();
let params = {
userProfile: this.state.userProfile,
newmobile: this.state.newmobile,
@@ -244,7 +256,7 @@ class EditProfile extends React.PureComponent {
Utils.responseHandler(res, () => {
successCallback(res)
}, (errors) => {
- console.log(errors)
+ console.log(errors)
errorCallback(errors)
}, this.props)
}
@@ -300,6 +312,7 @@ class EditProfile extends React.PureComponent {
this.setState({ loading: true })
if(this.state.newphoto) {
this.fetchProfileBlob(success => {
+ this.resetData();
this.setState({ loading: false })
if(success.status == 0) {
this.setState({ errors: success })
@@ -310,6 +323,7 @@ class EditProfile extends React.PureComponent {
})
}
}, error => {
+ this.resetData();
this.setState({ loading: false })
setTimeout(() => {
if(this.state.newphoto) {
@@ -327,6 +341,7 @@ class EditProfile extends React.PureComponent {
} else {
this.setState({ loading: true })
this.updateProfileBlob(success => {
+ this.resetData();
this.setState({ loading: false })
if(success.status == 0) {
this.setState({ errors: success })
@@ -337,6 +352,7 @@ class EditProfile extends React.PureComponent {
})
}
}, error => {
+ this.resetData();
this.setState({ loading: false })
setTimeout(() => {
if(this.state.newphoto) {
@@ -371,7 +387,6 @@ class EditProfile extends React.PureComponent {
this.setState({ focused: false });
if(this.hasChanges()){
-
if(this.state.newmobile != "" && this.state.newmobile.replace("+", "") != this.state.userProfile.mobile){
this.SaveWithOtp()
}else{
@@ -594,7 +609,7 @@ class EditProfile extends React.PureComponent {
{
let navigation = this.props.navigation.navigation
navigation.navigate("EditProfile", {data: this.state.userProfile, onGoBack: (data) => {
- console.log(data)
this.setState({ userProfile: data, loading: false })
this.init()
}})
@@ -116,7 +114,7 @@ class MyProfile extends React.PureComponent {
render() {
if(!this.state.connected) return this.renderNoInternetView()
return (
-
+
@@ -194,18 +192,18 @@ class MyProfile extends React.PureComponent {
- {/*
+
this.props.navigation.navigation.navigate('PayatpumpPaymentList', { displaySelectionCard: true })}
style={{ flexDirection: 'row', justifyContent: 'center', alignItems: 'center', marginLeft: 16 }}>
- Pay at Pump Payment Methods
+ Pump and GO Payment Method
- */}
+
diff --git a/app/screens/myprofile/transaction/transaction.js b/app/screens/myprofile/transaction/transaction.js
index 1efa9582..706c485b 100644
--- a/app/screens/myprofile/transaction/transaction.js
+++ b/app/screens/myprofile/transaction/transaction.js
@@ -1,14 +1,8 @@
import * as React from 'react';
-import { useState, useEffect, useCallback, useContext } from 'react';
import { connect } from "react-redux";
-import { SafeAreaView, ScrollView, Linking, Button, View, Text, TouchableOpacity, RefreshControl, Platform } from 'react-native';
-import {useNetInfo} from "@react-native-community/netinfo";
-// import NetInfo from "@react-native-community/netinfo";
+import { ScrollView, Linking, View, Text, RefreshControl } from 'react-native';
import NetInfo from "../../../components/netstatus";
-import CustomHeader from '../../../components/header.js';
-import Assets from '../../../components/assets.manager.js';
import Theme from '../../../components/theme.style.js';
-import Icon from '../../../components/icons.js';
import Elements from '../../../components/elements.js';
import REQUEST from '../../../components/api/';
import DB from '../../../components/storage/';
@@ -46,7 +40,8 @@ class MyTransactions extends React.Component {
}
init = async () => {
- const SESSION = await DB.session()
+ const SESSION = await DB.session();
+
this.setState({ connected: true, loading: true })
await REQUEST("transactions", "get", {
Authorization: SESSION.token,
@@ -56,7 +51,7 @@ class MyTransactions extends React.Component {
}, (error) => {
this.setState({ loading: false })
}
- )
+ );
}
renderTransactions = () => {
diff --git a/app/screens/payatpump/fragments/stationdetailspanel.js b/app/screens/payatpump/fragments/stationdetailspanel.js
index 4ff63730..eb478da4 100644
--- a/app/screens/payatpump/fragments/stationdetailspanel.js
+++ b/app/screens/payatpump/fragments/stationdetailspanel.js
@@ -17,7 +17,8 @@ import {
List,
ListItem,
Left,
- Right
+ Right,
+ Divider
} from 'native-base';
import REQUEST_POST_PAY from '../../../components/api/postpayapi';
import Assets from '../../../components/assets.manager.js';
@@ -53,7 +54,6 @@ const styles = {
},
modalView: {
margin: 25,
- borderRadius: 15,
padding: 20,
alignItems: "center",
shadowColor: "#000",
@@ -235,7 +235,7 @@ const PayatpumpStationDetails = (props) => {
transparent={true}
visible={showModal}>
-
+
{!initiateCancel && !confirmProceed && ( {
setInitiateCancel(true)
@@ -251,6 +251,7 @@ const PayatpumpStationDetails = (props) => {
{confirmProceed && ConfirmPumpSelectorView()}
+
)
}
@@ -258,23 +259,23 @@ const PayatpumpStationDetails = (props) => {
const CancelPumpSelectorView = () => {
return (
<>
-
- Are you sure you want to cancel the transaction?
+
+ Are you sure you want to{'\n'}cancel the transaction?
-
+
+ {
+ setInitiateCancel(false)
+ selectedPump != null ? setInitiateProceed(true) : setInitiateProceed(false)
+ }} style={{ width: 100, height: 44, margin: 12, backgroundColor: Theme.colors.white, borderColor: Theme.colors.primary, borderWidth: 0.5, alignItems: 'center', justifyContent: 'center', borderRadius: 5 }}>
+ No
+
{
setShowModal(false)
setInitiateCancel(false)
setInitiateProceed(false)
setSelectedPump(null)
- }} style={{ width: 100, height: 44, margin: 12, backgroundColor: Theme.colors.white, borderColor: Theme.colors.primary, borderWidth: 0.5, alignItems: 'center', justifyContent: 'center', borderRadius: 5 }}>
- Cancel Transaction
-
- {
- setInitiateCancel(false)
- selectedPump != null ? setInitiateProceed(true) : setInitiateProceed(false)
}} style={{ width: 100, height: 44, margin: 12, backgroundColor: Theme.colors.primary, justifyContent: 'center', alignItems: 'center', borderRadius: 5 }}>
- Continue Transaction
+ Yes
>
@@ -282,28 +283,28 @@ const PayatpumpStationDetails = (props) => {
}
const ProceedPumpSelectorView = () => {
- let message = selectedPump != null ? `This will process your transaction at Pump ${selectedPump.pumpNumber}.` : "No selected pump."
+ let message = selectedPump != null ? `This will process your transaction at` : "No selected pump."
return (
- <>
-
+
+
-
- {message}
+
+ {message} {selectedPump != null && Pump {selectedPump.pumpNumber}.}
-
+
Please ensure that this is the correct pump and click Ok below to proceed.
-
+
{
setInitiateCancel(false)
setInitiateProceed(false)
}}
- style={{ padding: 10, width: 100, backgroundColor: Theme.colors.primary, justifyContent: 'center', alignItems: 'center', borderRadius: 5 }}>
- Ok
+ style={{ paddingVertical: 5, width: 120, backgroundColor: Theme.colors.primary, justifyContent: 'center', alignItems: 'center', borderRadius: 5 }}>
+ OK
- >
+
)
}
@@ -311,7 +312,7 @@ const PayatpumpStationDetails = (props) => {
let message = selectedPump != null ? "Processing..." : "No selected pump."
return (
<>
-
+
{/*
*/}
@@ -327,46 +328,56 @@ const PayatpumpStationDetails = (props) => {
const PumpListView = (currentSelectedPump) => {
return (
<>
- Please select the pump
+ Please select your Pump no.{'\n'} to process the payment.
index.toString()}
+ contentContainerStyle={{ alignItems: 'center'}}
data={props.data.fuelService?.fuelingPoints}
scrollEnabled={true}
showsVerticalScrollIndicator={false}
renderItem={({item, index}) => {
let available = item.pumpStatus == "Available"
return (
- {
- setInitiateProceed(true)
- console.log(item);
- setSelectedPump(item)
- }} key={index} style={{ alignItems: 'center', justifyContent: 'center', margin: 20 }}>
- {(currentSelectedPump != null && currentSelectedPump.pumpNumber == item.pumpNumber) ? (
-
-
-
- ) : (
-
-
-
- )}
- {item.pumpNumber}
+ {
+ setInitiateProceed(true)
+ setSelectedPump(item)
+ }}
+ style={{marginHorizontal: 15, marginBottom: 10, borderColor: (currentSelectedPump != null && currentSelectedPump.pumpNumber == item.pumpNumber) ? Theme.colors.primary : "transparent", borderWidth: 4, borderRadius: 15}}>
+
+
+ {index + 1}
+
+
)
}}
numColumns={2}
/>
+
{
if(selectedPump != null) {
setConfirmProceed(true)
initiateTransaction()
}
}}>
- Ok
+ OK
>
)
diff --git a/app/screens/payatpump/pumppaymentlist.js b/app/screens/payatpump/pumppaymentlist.js
index cbc75cbe..9feb4e14 100644
--- a/app/screens/payatpump/pumppaymentlist.js
+++ b/app/screens/payatpump/pumppaymentlist.js
@@ -8,6 +8,7 @@ import {
FlatList,
Image,
StyleSheet,
+ Alert,
Modal
} from 'react-native';
import REQUEST_POST_PAY from '../../components/api/postpayapi';
@@ -18,7 +19,7 @@ import Assets from '../../components/assets.manager.js';
import Elements from '../../components/elements.js';
import DB from '../../components/storage/';
import CustomSafeArea from '../../components/safeArea.component';
-
+import { returnIcon } from '../../utils/card';
class PayatpumpPaymentList extends React.Component {
@@ -31,8 +32,11 @@ class PayatpumpPaymentList extends React.Component {
defaultCardIndex: -1,
defaultSelectedCard: null,
showModal: false,
+ showCardAdded: false,
+ showCardDeleted: false,
deleteCard: null,
loading: false,
+ newlyAddedCard: null,
isShowSelectionCard: this.props.route.params?.displaySelectionCard
}
@@ -68,15 +72,13 @@ class PayatpumpPaymentList extends React.Component {
if(enableDefaultCard) {
defaultIndex = mergedWallets.findIndex(item => item.userPaymentSourceId === defaultCard.userPaymentSourceId);
selectedDefaultCard = mergedWallets[defaultIndex];
-
- if(setDefault) {
- await DB.set(
- "pumpPaymentCards",
- JSON.stringify(selectedDefaultCard),
- () => {},
- () => {}
- )
- }
+
+ await DB.set(
+ "pumpPaymentCards",
+ JSON.stringify(selectedDefaultCard),
+ () => {},
+ () => {}
+ )
} else {
if(selectedCard && !setDefault) {
defaultIndex = mergedWallets.findIndex(item => item.userPaymentSourceId === selectedCard.userPaymentSourceId);
@@ -114,6 +116,7 @@ class PayatpumpPaymentList extends React.Component {
}, 300)
} else {
if(res.success) {
+ let selectedCard = await DB.get("pumpPaymentCards");
let defaultCardIndex = -1;
let defaultSelectedCard = null;
let wallets = this.state.cards.filter(item => {
@@ -124,19 +127,22 @@ class PayatpumpPaymentList extends React.Component {
})
if(wallets.length > 0) {
- defaultCardIndex = 0;
- defaultSelectedCard = wallets[defaultCardIndex];
+ let checker = wallets.find(item => item.userPaymentSourceId === selectedCard.userPaymentSourceId);
+ if(!checker) {
+ defaultCardIndex = 0;
+ defaultSelectedCard = wallets[defaultCardIndex];
- this.props.route?.params.onSelectedPaymentCard(defaultSelectedCard)
+ this.props.route?.params.onSelectedPaymentCard && this.props.route?.params.onSelectedPaymentCard(defaultSelectedCard)
- await DB.set(
- "pumpPaymentCards",
- JSON.stringify(defaultSelectedCard),
- () => {},
- () => {}
- )
+ await DB.set(
+ "pumpPaymentCards",
+ JSON.stringify(defaultSelectedCard),
+ () => {},
+ () => {}
+ )
+ }
} else {
- this.props.route?.params.onSelectedPaymentCard(null)
+ this.props.route?.params.onSelectedPaymentCard && this.props.route?.params.onSelectedPaymentCard(null)
await DB.set(
"pumpPaymentCards",
@@ -145,8 +151,8 @@ class PayatpumpPaymentList extends React.Component {
() => {}
)
}
-
- this.setState({ cards: wallets, defaultCardIndex: defaultCardIndex, defaultSelectedCard: defaultSelectedCard, deleteCard: null })
+
+ this.setState({ showCardDeleted: true, cards: wallets, defaultCardIndex: defaultCardIndex, defaultSelectedCard: defaultSelectedCard, deleteCard: null })
} else {
setTimeout(() => {
Alert.alert('Error', 'Failed to get fund. Try again.')
@@ -171,8 +177,8 @@ class PayatpumpPaymentList extends React.Component {
"pumpPaymentCards",
JSON.stringify(defaultSelectedCard),
() => {
- this.props.route?.params.onSelectedPaymentCard(defaultSelectedCard)
- this.props.navigation.goBack()
+ this.props.route?.params.onSelectedPaymentCard && this.props.route?.params.onSelectedPaymentCard(defaultSelectedCard)
+ this.props.navigation.goBack();
},
() => {}
)
@@ -180,8 +186,10 @@ class PayatpumpPaymentList extends React.Component {
}
- onAddNewCard = (response, enableDefaultCard, setDefault) => {
- this.getFunding(response, enableDefaultCard, setDefault)
+ onAddNewCard = (response, enableDefaultCard) => {
+ console.log(response);
+ this.setState({showCardAdded: true, newlyAddedCard: response});
+ this.getFunding(response, enableDefaultCard);
}
renderDeleteErrorModal = () => {
@@ -192,33 +200,99 @@ class PayatpumpPaymentList extends React.Component {
visible={this.state.showModal}>
{}} style={styles.centeredView}>
- {this.state.deleteCard != null ? (
- <>
- {'Are you sure you want to delete this card?'}
-
- this.setState({ showModal: false })} style={{ width: 100, height: 30, backgroundColor: Theme.colors.primary, alignItems: 'center', justifyContent: 'center', borderRadius: 5, marginRight: 10 }}>
- No
-
- this.deleteCard()} style={{ width: 100, height: 30, backgroundColor: Theme.colors.white, alignItems: 'center', justifyContent: 'center', borderRadius: 5, borderColor: Theme.colors.primary, borderWidth: 0.5, marginLeft: 10 }}>
- Yes
-
-
- >
- ) : (
- <>
-
- {'Please Select Card...'}
- this.setState({ showModal: false })} style={{ width: 80, height: 30, backgroundColor: Theme.colors.primary, alignItems: 'center', justifyContent: 'center', borderRadius: 5 }}>
- Ok
+ {this.state.deleteCard != null ? (
+ <>
+ {'Are you sure you want to delete this card?'}
+
+ this.setState({ showModal: false })} style={{ width: 100, height: 30, backgroundColor: Theme.colors.primary, alignItems: 'center', justifyContent: 'center', borderRadius: 5, marginRight: 10 }}>
+ No
- >
- )}
+ this.deleteCard()} style={{ width: 100, height: 30, backgroundColor: Theme.colors.white, alignItems: 'center', justifyContent: 'center', borderRadius: 5, borderColor: Theme.colors.primary, borderWidth: 0.5, marginLeft: 10 }}>
+ Yes
+
+
+ >
+ ) : (
+ <>
+
+ {'Please Select Card...'}
+ this.setState({ showModal: false })} style={{ width: 80, height: 30, backgroundColor: Theme.colors.primary, alignItems: 'center', justifyContent: 'center', borderRadius: 5 }}>
+ Ok
+
+ >
+ )}
)
}
+ renderCardAdded = () => {
+ let card = this.state.cards.find(item => item.userPaymentSourceId === this.state.newlyAddedCard?.userPaymentSourceId);
+ if(card && this.state.showCardAdded && !this.state.loading) {
+ return (
+
+
+
+ Card Ending in {card?.lastFour} has been{'\n'}successfully added!
+
+ {this.setState({ showCardAdded: false, newlyAddedCard: null })}} style={{paddingVertical: 10, borderRadius: 5, marginTop: 10, width: 120, backgroundColor: Theme.colors.primary, alignItems: 'center'}}>
+ OK
+
+
+
+ )
+ }
+
+ return null
+ }
+
+ renderCardDeleted = () => {
+ if(this.state.showCardDeleted) {
+ return (
+
+
+ Deleted Successfully
+ Your card has been successfully{'\n'}deleted!
+ {this.setState({ showCardDeleted: false })}} style={{paddingVertical: 5, borderRadius: 5, marginTop: 10, width: 120, backgroundColor: Theme.colors.primary, alignItems: 'center'}}>
+ OK
+
+
+
+ )
+ }
+
+ return null;
+ }
+
renderCardList = () => {
return (
{
- // this.setState({ defaultCardIndex: this.state.isShowSelectionCard ? -1 : this.state.defaultCardIndex == index ? -1 : index, defaultSelectedCard: this.state.defaultCardIndex == index ? null : item });
this.submitPaymentCard(item);
}} key={index} style={{ flex: 1, alignItems: 'center', justifyContent: 'center', flexDirection: 'row', backgroundColor: this.props.app_theme?.theme.dark ? this.props.app_theme?.theme.colors.background : Theme.colors.white, padding: 12 }}>
{this.state.defaultCardIndex == index && }
-
+
{`**** **** **** ${item.lastFour}`}
{this.state.defaultCardIndex == index && Primary}
@@ -283,7 +356,6 @@ class PayatpumpPaymentList extends React.Component {
color={this.props.app_theme?.theme.colors.text}
visible={this.state.loading} />
- {this.renderDeleteErrorModal()}
{this.renderCardList()}
Add a Card
@@ -308,6 +381,9 @@ class PayatpumpPaymentList extends React.Component {
+ {this.renderCardAdded()}
+ {this.renderCardDeleted()}
+ {this.renderDeleteErrorModal()}
)
}
diff --git a/app/screens/payatpump/pumppaymentmethod.js b/app/screens/payatpump/pumppaymentmethod.js
index 1b99dd77..498f54ce 100644
--- a/app/screens/payatpump/pumppaymentmethod.js
+++ b/app/screens/payatpump/pumppaymentmethod.js
@@ -22,6 +22,7 @@ import Assets from '../../components/assets.manager.js';
import Cipher from '../../components/cardencrypt/encryptcard';
import DB from '../../components/storage/';
import CustomSafeArea from '../../components/safeArea.component';
+import { returnIcon } from '../../utils/card';
class PayatpumpPaymentMethodList extends React.Component {
@@ -41,7 +42,7 @@ class PayatpumpPaymentMethodList extends React.Component {
showModal: false,
pubkey: null,
verificationUrl: null,
- setPrimary: false
+ cardDetails: null
}
componentDidMount() {
@@ -104,17 +105,6 @@ class PayatpumpPaymentMethodList extends React.Component {
onError('Failed to add new card. Try again.')
}
}
- // if(res.success == undefined) {
- // onError(res.Message)
- // } else {
- // if(res.success) {
- // if(res.response.result) {
- // onSuccess({ userPaymentSourceId: res.response.userPaymentSourceId, referenceNumber: res.response.referenceNumber })
- // }
- // } else {
- // onError('Error', 'Failed to get fund. Try again.')
- // }
- // }
}, (error) => {
onError('Error', error)
})
@@ -135,7 +125,6 @@ class PayatpumpPaymentMethodList extends React.Component {
REQUEST_POST_PAY('addCreditCard', 'post', {
token: USER_PROFILE.data.auth_p97
}, {}, params, (res) => {
- console.log(res)
if(res.success == undefined) {
onError(res.Message)
} else {
@@ -161,7 +150,8 @@ class PayatpumpPaymentMethodList extends React.Component {
parts.push(match.substring(i, i+4))
}
var cardnumber = parts.length ? parts.join(' ') : number
- this.setState({ cardNumber: cardnumber });
+
+ this.setState({ cardNumber: cardnumber, cardDetails: cardValidator.number(cardnumber) });
}
_handlingCardExpiry = (number) => {
@@ -193,7 +183,7 @@ class PayatpumpPaymentMethodList extends React.Component {
} else {
this.setState({ loading: false })
if(res.success) {
- this.props.route?.params.onAddNewCard({ userPaymentSourceId: res.response.userPaymentSourceId, referenceNumber: res.response.referenceNumber }, this.state.enableDefaultCard, this.state.setPrimary)
+ this.props.route?.params.onAddNewCard({ userPaymentSourceId: res.response.userPaymentSourceId, referenceNumber: res.response.referenceNumber }, this.state.enableDefaultCard)
} else {
setTimeout(() => {
Alert.alert('Error', res.Message)
@@ -219,13 +209,15 @@ class PayatpumpPaymentMethodList extends React.Component {
let cardExpiry = `${this.state.cardExpiry.split("/")[0]}${numberYear}${this.state.cardExpiry.split("/")[1]}`
let cardCvv = this.state.cardCVV
- if(cardValidator.number(cardnumber).card.type === "jcb") {
- Alert.alert('Error', `${cardValidator.number(cardnumber).card.niceType} is not available. Please use different card type.`)
+ console.log(cardnumber.length);
+
+ if(!cardValidator.number(cardnumber)?.card?.type || cardnumber.length < 16) {
+ Alert.alert('Error', `Invalid card number. Please use different card type.`)
return
}
- if(!cardValidator.number(cardnumber)?.card?.type) {
- Alert.alert('Error', `Invalid card number. Please use different card type.`)
+ if(cardValidator.number(cardnumber)?.card?.type === "jcb") {
+ Alert.alert('Error', `${cardValidator.number(cardnumber)?.card?.niceType} is not available. Please use different card type.`)
return
}
@@ -243,12 +235,13 @@ class PayatpumpPaymentMethodList extends React.Component {
let cardDetails = { pan: cardnumber, expDate: cardExpiry, cvv: cardCvv }
this.setState({ loading: true })
this.addCard(JSON.stringify(cardDetails), this.state.pubkey, cardValidator.number(cardnumber).card.niceType, onSuccess => {
- this.setState({ loading: false })
setTimeout(() => {
this.props.navigation.navigate('VerificationWebview', {...onSuccess, onSuccessAuthentication:(referenceNumber) => this._onAuthenticationSuccess(referenceNumber)})
+ this.setState({ loading: false })
}, 500);
},
error => {
+ Alert.alert('Error', `Something went wrong, please try again later.`)
this.setState({ loading: false })
})
}
@@ -272,7 +265,6 @@ class PayatpumpPaymentMethodList extends React.Component {
}
onStateChange = (webviewState) => {
- console.log(webviewState)
}
renderWebview = () => {
@@ -326,7 +318,7 @@ class PayatpumpPaymentMethodList extends React.Component {
onChangeText={(value) => this._handlingCardNumber(value)}
style={{ flex: 1, color: this.props.app_theme?.theme.colors.text }}
/>
-
+
@@ -363,10 +355,10 @@ class PayatpumpPaymentMethodList extends React.Component {
Set as primary card
this.setState({ setPrimary: !this.state.setPrimary })}
+ value={this.state.enableDefaultCard}
+ trackColor={this.state.enableDefaultCard && {true: "#6887ed"}}
+ thumbColor={this.state.enableDefaultCard && "blue"}
+ onChange={() => this.setState({ enableDefaultCard: !this.state.enableDefaultCard })}
/>
)
@@ -395,8 +387,8 @@ class PayatpumpPaymentMethodList extends React.Component {
{this.state.verificationUrl != null && this.renderWebview()}
- Your card will be changed to ensure that it's valid.
- Charge amount will be automatically refunded.
+ Your card will be charged to ensure that it's valid.
+ Charged amount will be automatically refunded.
this.submitNewAddedCard()}
style={{ height: 50, marginBottom: 16, backgroundColor: Theme.colors.primary, justifyContent: 'center', alignItems: 'center', borderRadius: 5, marginHorizontal: 35 }}>
diff --git a/app/screens/payatpump/pumppaymentsuccess.js b/app/screens/payatpump/pumppaymentsuccess.js
index dc5c51ec..15afdf6e 100644
--- a/app/screens/payatpump/pumppaymentsuccess.js
+++ b/app/screens/payatpump/pumppaymentsuccess.js
@@ -6,12 +6,11 @@ import {
View,
Text,
Keyboard,
- ScrollView,
- TextInput,
- Dimensions
+ ScrollView
} from 'react-native';
import Theme from '../../components/theme.style.js';
-
+import REQUEST_POST_PAY from '../../components/api/postpayapi';
+import DB from '../../components/storage';
class PayatpumpPaymentSuccess extends React.Component {
@@ -22,12 +21,15 @@ class PayatpumpPaymentSuccess extends React.Component {
state = {
email: null,
keyboardHeight: 0,
- data: this.props.route?.params?.transactionData
+ data: this.props.route?.params?.transactionData,
+ transactionDetails: this.props.route?.params?.transactionDetails,
+ newDetails: this.props.route?.params?.newDetails.response,
+ loading: true
}
componentDidMount() {
- this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow)
- this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide)
+ this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow);
+ this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);
}
componentWillUnmount() {
@@ -43,7 +45,19 @@ class PayatpumpPaymentSuccess extends React.Component {
this.setState({ keyboardHeight: 0 })
}
+ getPoints = () => {
+ let points = this.state.newDetails?.loyaltyPointsMessages[0].earnedRewardSummary || 0;
+ let totalPayment = parseInt(this.state.newDetails?.formattedTotal.slice(1));
+ if(points === 0 && (totalPayment >= 100)) {
+ const newPoints = totalPayment * .01;
+ return newPoints.toFixed(2);
+ } else {
+ return points;
+ }
+ }
+
render() {
+ console.log(this.state.newDetails)
return(
Sales Invoice No.
- {this.state.data?.transactionId}
+ {this.state.newDetails?.posTransactionId}
+
- Total Payment
- {`${'\u20B1'}${this.state.data?.totalPayment}`}
+ Subtotal
+ {this.state.newDetails?.formattedSubtotal}
+
+
+ Discount
+ {this.state.newDetails?.formattedTotalDiscounts}
Card Payment
- {`${'\u20B1'}${this.state.data?.cardPayment}`}
-
-
- Points
- {`${'\u20B1'}${0}`}
+ {this.state.newDetails?.formattedTotal}
Earned Points
- {`${'\u20B1'}${0}`}
+ {this.getPoints()}
+
+
+ Total Payment
+ {this.state.newDetails?.formattedTotal}
diff --git a/app/screens/payatpump/pumppoinstdetails.js b/app/screens/payatpump/pumppoinstdetails.js
index c8ed3293..6777db5a 100644
--- a/app/screens/payatpump/pumppoinstdetails.js
+++ b/app/screens/payatpump/pumppoinstdetails.js
@@ -17,7 +17,6 @@ import CustomHeader from '../../components/header.js';
import Theme from '../../components/theme.style.js';
import Assets from '../../components/assets.manager.js';
-
class PayatpumpPointsDetailsInput extends React.Component {
constructor(props) {
@@ -41,7 +40,6 @@ class PayatpumpPointsDetailsInput extends React.Component {
}
onAmountChange = (value) => {
- // console.log(Number(value).toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,'), this.state.selectedAmount)
this.setState({ displaySelectedAmount: value, selectedAmount: parseFloat(value) })
}
diff --git a/app/screens/payatpump/pumpstationtransactiondetails.js b/app/screens/payatpump/pumpstationtransactiondetails.js
index 77367a43..866604dd 100644
--- a/app/screens/payatpump/pumpstationtransactiondetails.js
+++ b/app/screens/payatpump/pumpstationtransactiondetails.js
@@ -19,6 +19,7 @@ import REQUEST_POST_PAY from '../../components/api/postpayapi';
import DB from '../../components/storage';
import Elements from '../../components/elements';
import CustomSafeArea from '../../components/safeArea.component';
+import { returnIcon } from '../../utils/card.js';
class PayatpumpStationTransactionDetails extends React.Component {
@@ -63,7 +64,6 @@ class PayatpumpStationTransactionDetails extends React.Component {
}
onSelectedPaymentCard = (payment_card) => {
- console.log(payment_card);
this.setState({ selectedPaymentCard: payment_card })
}
@@ -94,31 +94,22 @@ class PayatpumpStationTransactionDetails extends React.Component {
userPreference: {
receiptPreference: "doNotPrintReceipt", //printReceipt, doNotPrintReceipt
},
- loyaltyPassthroughInformation: {
- loyaltyInfo: []
- },
fraudContext: {}
}
let USER_PROFILE = await DB.profile();
- console.log(USER_PROFILE.data.auth_p97);
+
REQUEST_POST_PAY('postpay', 'post', {
token: USER_PROFILE.data.auth_p97,
language: 'en-US'
}, {}, params, async (res) => {
- console.log(res);
if(res.success && res.response != undefined && res.response.status == "success") {
- REQUEST_POST_PAY('getTransactionDetails/'+res.response.transaction_id, "get", {
+ REQUEST_POST_PAY('getTransactionStatusDetails', "get", {
token: USER_PROFILE.data.auth_p97,
language: 'en-US'
- }, {}, {}, res2 => {
+ }, {transactionID: res.response.transaction_id}, {}, res2 => {
if(res2.success && res2.response != undefined) {
- const data = {
- res: res,
- onSuccess: res2
- }
-
- onSuccess(data);
+ this.requestTransactionDetails(res, res2, onSuccess, onError)
} else {
onError(res2)
}
@@ -133,6 +124,27 @@ class PayatpumpStationTransactionDetails extends React.Component {
})
}
+ requestTransactionDetails = async (res, res2, onSuccess, onError) => {
+ let USER_PROFILE = await DB.profile();
+
+ REQUEST_POST_PAY("getTransactionDetails/" + res2.response.transactionId, "get", {
+ token: USER_PROFILE.data.auth_p97,
+ language: 'en-US'
+ }, {}, {}, res3 => {
+ if(res3.success && res3.response !== undefined) {
+ if(res3.response.appChannel !== "ThirdPartyMobile" || res3.response.totalDiscount === 0) {
+ setTimeout(() => {
+ this.requestTransactionDetails(res, res2, onSuccess, onError);
+ }, 2000);
+ } else {
+ onSuccess({ res: res, onSuccess: res2, newDetails: res3 })
+ }
+ }
+ }, err => {
+ onError(err);
+ })
+ }
+
submitPayment = () => {
this.setState({ showModal: false, loading: true })
@@ -141,7 +153,7 @@ class PayatpumpStationTransactionDetails extends React.Component {
if(onSuccess.res.success) {
let payment = { totalPayment: this.state.data[0]?.originalAmount.amount, cardPayment: this.state.data[0].originalAmount.amount, transactionId: onSuccess.res.response.transaction_id, storeName: this.state.storeName };
- this.props.navigation.navigate('PayatpumpPaymentSuccess', { transactionData: payment })
+ this.props.navigation.navigate('PayatpumpPaymentSuccess', { transactionData: payment, transactionDetails: onSuccess.onSuccess, newDetails: onSuccess.newDetails })
} else {
setTimeout(() => {
Alert.alert('Error', "Failed to initiate transaction. Try again.")
@@ -162,32 +174,31 @@ class PayatpumpStationTransactionDetails extends React.Component {
transparent={true}
visible={this.state.showModal}>
{}} style={styles.centeredView}>
-
+
+
{this.state.selectedPoints == null && this.state.selectedPaymentCard == null ?
<>
{'Please select payment method...'}
- this.setState({ showModal: false })} style={{ width: 80, height: 30, backgroundColor: Theme.colors.primary, alignItems: 'center', justifyContent: 'center', borderRadius: 5 }}>
+ this.setState({ showModal: false })} style={{ width: 80, height: 30, backgroundColor: Theme.colors.primary, alignItems: 'center', justifyContent: 'center' }}>
Ok
> :
- {
- this.state.data && this.state.data.length > 0 &&
- {`Are you sure you want to pay ${"\u20B1"}${Theme.formatter.CRNCY(this.state.data[0]?.originalAmount.amount || 0.0)}?`}
- }
-
+ {`You are about to pay \n ${"\u20B1"} ${Theme.formatter.CRNCY(this.state.data[0]?.originalAmount.amount || 0.0)}?`}
+ {`If your transaction is valid for\ndiscount, it will be reflected after final payment.`}
+
{
this.setState({ showModal: false })
}}>
- No
+ Cancel
this.submitPayment()}>
- Yes
+ Continue
@@ -252,10 +263,11 @@ class PayatpumpStationTransactionDetails extends React.Component {
return (
+
+
{
this.state.selectedPaymentCard ?
<>
-
this.props.navigation.navigate('PayatpumpPaymentList', { onSelectedPaymentCard: (payment_card) => this.onSelectedPaymentCard(payment_card), storeId: this.props.route?.params.storeId})}
@@ -266,7 +278,7 @@ class PayatpumpStationTransactionDetails extends React.Component {
>
:
-
+
this.props.navigation.navigate('PayatpumpPaymentList', { onSelectedPaymentCard: (payment_card) => this.onSelectedPaymentCard(payment_card), storeId: this.props.route?.params.storeId})}
>
@@ -335,12 +347,12 @@ class PayatpumpStationTransactionDetails extends React.Component {
-
+
Review the details before proceeding.
- this.setState({ showModal: true })} style={{ height: 50, backgroundColor: Theme.colors.primary, alignItems: 'center', justifyContent: 'center', borderRadius: 10, marginHorizontal: 16 }}>
+ this.setState({ showModal: true })} style={{ height: 50, backgroundColor: Theme.colors.primary, alignItems: 'center', justifyContent: 'center', borderRadius: 10, marginHorizontal: 16 }}>
Pay {"\u20B1"} {Theme.formatter.CRNCY(this.state.data[0]?.originalAmount.amount || 0.0)}
@@ -369,7 +381,6 @@ const styles = StyleSheet.create({
modalView: {
margin: 25,
backgroundColor: "white",
- borderRadius: 15,
padding: 20,
alignItems: "center",
shadowColor: "#000",
diff --git a/app/screens/payatpump/verificationWebview.js b/app/screens/payatpump/verificationWebview.js
index 77b8e68b..9d7374e3 100644
--- a/app/screens/payatpump/verificationWebview.js
+++ b/app/screens/payatpump/verificationWebview.js
@@ -45,7 +45,7 @@ class VerificationWebview extends React.Component {
if(this.state.onBack) return;
this.setState({ onBack: true });
- Alert.alert("Error", "Error adding card");
+ Alert.alert("Error", "Error in adding card.");
return this.props.navigation.goBack();
}
}
diff --git a/app/utils/card.js b/app/utils/card.js
new file mode 100644
index 00000000..3c015b40
--- /dev/null
+++ b/app/utils/card.js
@@ -0,0 +1,13 @@
+import Assets from '../components/assets.manager';
+
+export const returnIcon = (type) => {
+ if(type === "Visa") {
+ return Assets.icons.stpvisa;
+ } else if (type === "Mastercard") {
+ return Assets.icons.newMasterCard;
+ } else if (type === "JCB") {
+ return Assets.icons.stpjcb;
+ }
+
+ return Assets.icons.stpunlabeled
+}
\ No newline at end of file