소스 검색

improve payment method

vbea 2 년 전
부모
커밋
ebf81cc4ed

+ 1 - 1
Strides-APP/app.json

@@ -29,6 +29,6 @@
   "company": "Strides YTL Pte. Ltd.",
   "v3": {
     "summary": true,
-    "paymentMethod": true
+    "paymentMethod": false
   }
 }

+ 2 - 2
Strides-APP/app/api/apiCharge.js

@@ -50,8 +50,8 @@ export default {
   getConnectorDetail: (params) => {
     return get(prefix + 'getConnectorUsageDetail', params);
   },
-  getPaymentTypeOptions: () => {
-    return get(prefix + "payment-methods")
+  getPaymentTypeOptions: (params) => {
+    return get(prefix + "payment-methods", params)
   },
   setDefaultPaymentType: (data) => {
     return post(prefix + "default-payment-methods", data)

+ 3 - 1
Strides-APP/app/pages/chargeV2/PaymentListV2.js

@@ -41,7 +41,9 @@ export default class PaymentListV2 extends Component {
   }
 
   getPaymentOptions() {
-    apiCharge.getPaymentTypeOptions().then(res => {
+    apiCharge.getPaymentTypeOptions({
+      chargeBoxId: this.props.chargeBoxId
+    }).then(res => {
       if (res.data) {
         this.setState({
           options: res.data

+ 1 - 0
Strides-APP/app/pages/chargingV2/ChargingPage.js

@@ -449,6 +449,7 @@ export default class ChargingPage extends Component {
           : ( this.state.isAuthentic
             ? <StepAuth
                 status={this.state.connectorInfo?.status}
+                chargeBoxId={this.state.stationInfo.chargeBoxId}
                 currentPayment={this.state.currentPayment}
                 onStartCharge={() => this.onStartCharge()}
                 onPaymentMethodChanged={(type) => this.onPaymentMethodChanged(type)}

+ 2 - 0
Strides-APP/app/pages/chargingV2/StepAuth.js

@@ -14,6 +14,7 @@ export default StepAuth = ({
   status="",
   currentPayment,
   onStartCharge,
+  chargeBoxId,
   onPaymentMethodChanged
 }) => {
   const [loadingEmps, setEmps] = useState("");
@@ -76,6 +77,7 @@ export default StepAuth = ({
         ? <PaymentListV2
             isSelect={isAuthentic}
             payType={currentPayment}
+            chargeBoxId={chargeBoxId}
             onMethodChange={onPaymentMethodChanged}/>
         : <PaymentList
             isSelect={isAuthentic}

+ 1 - 0
Strides-APP/app/pages/chargingV2/StepStart.js

@@ -81,6 +81,7 @@ export default StepStart = ({
       { app.v3.paymentMethod
       ? <PaymentListV2
           payType={currentPayment}
+          chargeBoxId={connectorInfo.chargeBoxId}
           onMethodChange={onPaymentMethodChanged}/>
       : <PaymentList
           payType={currentPayment}