Răsfoiți Sursa

add 2C2P and PayPerUse configs

vbea 3 ani în urmă
părinte
comite
9441e3d812

+ 2 - 2
Strides-APP/android/app/version.properties

@@ -1,2 +1,2 @@
-#Fri Jan 13 11:47:01 CST 2023
-VERSION_CODE=72
+#Fri Jan 13 12:10:05 CST 2023
+VERSION_CODE=73

+ 1 - 1
Strides-APP/app.json

@@ -4,5 +4,5 @@
   "versionCode": 80,
   "versionName": "V1.0.1",
   "product": false,
-  "debug": false
+  "debug": true
 }

+ 6 - 5
Strides-APP/app/pages/payment/PaymentMethod.js

@@ -54,12 +54,13 @@ export default class PaymentMethod extends Component {
       connectorInfo: {}
     };
     this.rate = 0
-    this.ENABLE_2C2P = PaymentDefault.DEFAULT.payType == PAYTYPE.PAY_PER_USE;
+    this.ENABLE_2C2P = PaymentDefault.is2c2p;
+    this.FirstPayPerUse = PaymentDefault.DEFAULT.payType == PAYTYPE.PAY_PER_USE;
   }
 
   componentDidMount() {
     this.setState({
-      paymentOptions: this.ENABLE_2C2P ? this.state.paymentOptionsUse : this.state.paymentOptionsWallet
+      paymentOptions: this.FirstPayPerUse ? this.state.paymentOptionsUse : this.state.paymentOptionsWallet
     });
     const params = this.props.route.params;
     const info = params.info ?? {};
@@ -94,7 +95,7 @@ export default class PaymentMethod extends Component {
       title: info.title,
       value: info.value
     };
-    if (this.state.cIndex == 1) {
+    if (info.value == PAYTYPE.CREDIT_WALLET) {
       goBack();
     } else {
       const amount = this.state.amountList[this.state.selectIndex].amount;
@@ -133,7 +134,7 @@ export default class PaymentMethod extends Component {
       title: info.title,
       value: info.value
     };
-    if (this.state.cIndex == 1) {
+    if (info.value == PAYTYPE.CREDIT_WALLET) {
       goBack();
     } else {
       const amount = this.state.amountList[this.state.selectIndex].amount;
@@ -215,7 +216,7 @@ export default class PaymentMethod extends Component {
             })
           }
           </View>
-          { (this.state.cIndex == (this.ENABLE_2C2P ? 0 : 1)) &&
+          { (this.state.cIndex == (this.FirstPayPerUse ? 0 : 1)) &&
             <View style={[styles.optionView, ui.flex1]}>
               <WalletTitle>Pay Per Use</WalletTitle>
               <Text style={styles.subTitle}>Choose Amount:</Text>

+ 8 - 7
Strides-APP/app/pages/wallet/Payment.js

@@ -10,17 +10,18 @@ import { LowCreditDialog } from '../charge/InfoDialog';
 import { PageList } from '../Router';
 
 /**
- * DEFAULT
- * 控制是否启用2C2P
+ * @is2c2p 控制是否启用2C2P
+ * @DEFAULT 控制默认的支付方式
  */
 export const PaymentDefault = {
-  DEFAULT: {
+  is2c2p: false,
+  DEFAULT1: {
     payType: "CreditWallet",
     payName: "Credit Wallet",
     isWallet: true,
     isPayPerUse: false
   },
-  DEFAULT2: {
+  DEFAULT: {
     payType: "PayPerUse",
     payName: "Pay Per Use (SGQR)",
     isWallet: false,
@@ -129,10 +130,10 @@ const getBalance = (balance) => {
 }
 
 export const toTopupPage = () => {
-  if (PaymentDefault.DEFAULT.payType == PAYTYPE.CREDIT_WALLET) {
-    startPage(PageList.topup);
-  } else {
+  if (PaymentDefault.is2c2p) {
     startPage(PageList.topupV2);
+  } else {
+    startPage(PageList.topup);
   }
 }