Skip to content

Commit a5eff78

Browse files
committed
some adjusts
1 parent b9b8911 commit a5eff78

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

components/ifthenpay/actions/create-payment-reference/create-payment-reference.mjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export default {
4444
type: "string",
4545
label: "Mobile Number",
4646
description: "Place the country code before the mobile number without any spaces (use '#'' to separate the country code from the mobile number - p.e. 351#912345678)",
47-
optional: true,
4847
hidden: true,
4948
},
5049
description: {
@@ -105,10 +104,14 @@ export default {
105104
async additionalProps(props) {
106105
const isMb = this.paymentMethod === "Multibanco";
107106

108-
props.mbKey.default = this.ifthenpay.$auth.mb_key;
107+
props.mbKey.default = isMb
108+
? this.ifthenpay.$auth.mb_key
109+
: null;
109110
props.mbKey.hidden = !isMb;
110111

111-
props.mbWayKey.default = this.ifthenpay.$auth.mbway_key;
112+
props.mbWayKey.default = !isMb
113+
? this.ifthenpay.$auth.mbway_key
114+
: null;
112115
props.mbWayKey.hidden = isMb;
113116
props.mobileNumber.hidden = isMb;
114117
props.url.hidden = isMb;

components/ifthenpay/ifthenpay.app.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ export default {
2323
value,
2424
})),
2525
context: {
26-
token: payments[0].paymentDate,
26+
token: payments.length
27+
? payments[0].paymentDate
28+
: null,
2729
},
2830
};
2931
},
@@ -69,10 +71,8 @@ export default {
6971
let path;
7072
if (paymentMethod === "Multibanco") {
7173
path = "/multibanco/reference/init";
72-
data.mbKey = this.$auth.mb_key;
7374
} else if (paymentMethod === "MB WAY") {
7475
path = "/spg/payment/mbway";
75-
data.mbWayKey = this.$auth.mbWayKey;
7676
}
7777

7878
return this._makeRequest({

0 commit comments

Comments
 (0)