瀏覽代碼

upload payment api

master
Alex Cheung 1 年之前
父節點
當前提交
383eddc640
共有 4 個檔案被更改,包括 22 行新增17 行删除
  1. +4
    -3
      src/pages/Payment/Card/index.js
  2. +7
    -8
      src/pages/Payment/FPS/FPS.js
  3. +6
    -3
      src/pages/Payment/index.js
  4. +5
    -3
      src/utils/ApiPathConst.js

+ 4
- 3
src/pages/Payment/Card/index.js 查看文件

@@ -7,10 +7,11 @@ import {
} from '@mui/material';
import * as React from "react";
import * as HttpUtils from "utils/HttpUtils";
import * as UrlUtils from "utils/ApiPathConst";
import { useNavigate } from "react-router-dom";

import { useLocation } from 'react-router-dom';
import {paymentPath} from "auth/utils";
// import {paymentPath} from "auth/utils";
// import {poll} from "utils/Utils";
import VisaIcon from "assets/images/icons/visacard.svg";
import MasterIcon from "assets/images/icons/mastercard.svg";
@@ -45,7 +46,7 @@ const Index = () => {
// const [fpsqrcodeurl, setFpsqrcodeurl] = React.useState("");
// const pasgPath = 'https://fps.payapps.hkicl.com.hk'; //PRD
// const pasgPath = 'https://sim.fps.payapps.hkicl.com.hk'; //Testing
const loadPaymentUrl = "/api/payment/web/";
// const loadPaymentUrl = "/api/payment/web/";
// const paymentStatusApi = "/api/payment/status/";
// const payloadUrl = "/api/payment/wallet/fps/enquiryfpspayload/";
// const receiverUrl = "/noti-api/payment/payment-notification";
@@ -74,7 +75,7 @@ const Index = () => {
localStorage.setItem("webtoken", paymentData.webtoken)

HttpUtils.post({
url: paymentPath+loadPaymentUrl+(paymentData.type=="PPS"?"pps":"creditcard"),
url: UrlUtils.LOAD_PAYMENT_URL+(paymentData.type=="PPS"?"pps":"creditcard"),
params:{
"transactionid": paymentData.transactionid,
//"apprefid:": paymentData.transactionid,


+ 7
- 8
src/pages/Payment/FPS/FPS.js 查看文件

@@ -11,7 +11,7 @@ import * as UrlUtils from "utils/ApiPathConst";
import { useNavigate } from "react-router-dom";
import FpsIcon from "assets/images/icons/fps.svg";
import { useLocation } from 'react-router-dom';
import {paymentPath} from "auth/utils";
// import {paymentPath} from "auth/utils";
import {currencyFormat} from "utils/FormatUtils";
// import {poll} from "utils/Utils";

@@ -54,8 +54,8 @@ const Index = () => {
const pasgPathPrd = 'https://fps.payapps.hkicl.com.hk'; //PRD
const pasgPath = 'https://sim.fps.payapps.hkicl.com.hk'; //Testing
const loadPaymentUrl = "/api/payment/wallet/fps";
const cancelPaymentUrl = "/api/payment/cancelpayment";
// const loadPaymentUrl = "/api/payment/wallet/fps";
// const cancelPaymentUrl = "/api/payment/cancelpayment";
// const paymentStatusApi = "/api/payment/status/";
// const payloadUrl = "/api/payment/wallet/fps/enquiryfpspayload/";
// const receiverUrl = "/noti-api/payment/payment-notification";
@@ -132,10 +132,10 @@ const Index = () => {


HttpUtils.post({
url: paymentPath+loadPaymentUrl,
url: UrlUtils.LOAD_PAYMENT_FPS_URL,
params:{
"transactionid": transactionid,
"webtoken": webtoken,
// "transactionid": transactionid,
// "webtoken": webtoken,
"paymentmethod":"04,BCFP,FPS",
"order": {
"totalamount":paymentData.amount,
@@ -190,7 +190,6 @@ const Index = () => {
setFpsqrcodeurl(openPASGUrl)
setFpsqrcodeurlPrd(openPASGUrlPrd)
setFpsqrcodeurlFps(openPASGUrlPrdFps)

}
});
@@ -247,7 +246,7 @@ const Index = () => {
const cancelPayment = ()=>{
if (Object.keys(paymentData).length>0){
HttpUtils.post({
url: paymentPath+cancelPaymentUrl,
url: UrlUtils.CANCEL_PAYMENT_URL,
params:{
"transactionid": paymentData.transactionid,
"webtoken": paymentData.webtoken,


+ 6
- 3
src/pages/Payment/index.js 查看文件

@@ -156,7 +156,8 @@ const Index = () => {
transNo: transactionData.transactionid,
payMethod: paymentMethod,
payAmount: totalAmount,
appIdList: location.state?.appIdList ?? []
appIdList: location.state?.appIdList ?? [],
webtoken: transactionData.webtoken
},
onSuccess: function (responData) {
localStorage.removeItem("paymentId");
@@ -171,7 +172,7 @@ const Index = () => {
});
}

//For testing
// For testing
// if (paymentMethod != "") {
// HttpUtils.post({
// url: UrlUtils.PAYMENT_CREATE,
@@ -179,7 +180,9 @@ const Index = () => {
// transNo: "test0002",
// payMethod: paymentMethod,
// payAmount: totalAmount,
// appIdList: location.state?.appIdList ?? []
// appIdList: location.state?.appIdList ?? [],
// webtoken: "test000234123412341234123412354212312412341234124123124124124123124123124124"

// },
// onSuccess: function (responData) {
// localStorage.removeItem("paymentId");


+ 5
- 3
src/utils/ApiPathConst.js 查看文件

@@ -157,9 +157,11 @@ export const PAYMENT_AVAILABLE_PAYMENT = apiPath+'/payment/api/availability';//P
export const PAYMENT_TRANSACTION_ID = apiPath+'/payment/api/transaction';//GET
// export const PAYMENT_STATUS_API = paymentPath+'/api/payment/status/';//POST
export const PAYMENT_STATUS_API = apiPath+'/payment/api/status/';//POST

export const LOAD_PAYMENT_URL = apiPath+ "/api/payment/wallet/fps";//POST
export const CANCEL_PAYMENT_URL = apiPath+ "/api/payment/cancelpayment";//POST
// export const LOAD_PAYMENT_URL = paymentPath+ "/api/payment/wallet/fps";//POST
export const LOAD_PAYMENT_FPS_URL = apiPath+ "/payment/api/wallet/fps";//POST
// export const CANCEL_PAYMENT_URL = paymentPath+ "/api/payment/cancelpayment";//POST
export const CANCEL_PAYMENT_URL = apiPath+ "/payment/api/cancelpayment";//POST
export const LOAD_PAYMENT_URL = apiPath+ "/payment/api/web/";//POST

export const DEMAND_NOTE_PREVIEW = apiPath+'/demandNote/preview';//GET
export const DEMAND_NOTE_CREATE = apiPath+'/demandNote/create';//POST


Loading…
取消
儲存