strapi-plugin-payone-provider 5.8.30 → 5.8.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -92,11 +92,20 @@ const ALLOWED_SORT_FIELDS = [
|
|
|
92
92
|
"updatedAt",
|
|
93
93
|
];
|
|
94
94
|
|
|
95
|
+
// PayOne wallet (`clearingtype: wlt`) codes per payment method. Google Pay is
|
|
96
|
+
// `GGP` and Apple Pay `APL` — the values the plugin itself writes in
|
|
97
|
+
// `paymentMethodParams.js`; the extra aliases cover legacy rows.
|
|
98
|
+
const WALLET_CODES = {
|
|
99
|
+
paypal: ["PPE"],
|
|
100
|
+
google_pay: ["GGP", "GPY", "GOOGLEPAY"],
|
|
101
|
+
apple_pay: ["APL", "APPLEPAY"],
|
|
102
|
+
};
|
|
103
|
+
|
|
95
104
|
const PAYMENT_METHOD_MATCHERS = {
|
|
96
105
|
credit_card: (rr) => rr.clearingtype === "cc",
|
|
97
|
-
paypal: (rr) => rr.clearingtype === "wlt" && rr.wallettype
|
|
98
|
-
google_pay: (rr) => rr.clearingtype === "wlt" &&
|
|
99
|
-
apple_pay: (rr) => rr.clearingtype === "wlt" &&
|
|
106
|
+
paypal: (rr) => rr.clearingtype === "wlt" && WALLET_CODES.paypal.includes(rr.wallettype),
|
|
107
|
+
google_pay: (rr) => rr.clearingtype === "wlt" && WALLET_CODES.google_pay.includes(rr.wallettype),
|
|
108
|
+
apple_pay: (rr) => rr.clearingtype === "wlt" && WALLET_CODES.apple_pay.includes(rr.wallettype),
|
|
100
109
|
sofort: (rr) => rr.clearingtype === "sb",
|
|
101
110
|
sepa: (rr) => rr.clearingtype === "elv",
|
|
102
111
|
};
|
|
@@ -106,9 +115,10 @@ const matchesPaymentMethod = (row, method) => {
|
|
|
106
115
|
const matcher = PAYMENT_METHOD_MATCHERS[method];
|
|
107
116
|
if (!matcher) return true;
|
|
108
117
|
const rr = parseJsonField(row.raw_request);
|
|
118
|
+
const wallettype = rr.wallettype || rr["add_paydata[paymentmethod]"] || "";
|
|
109
119
|
return matcher({
|
|
110
120
|
clearingtype: String(rr.clearingtype || "").toLowerCase(),
|
|
111
|
-
wallettype: String(
|
|
121
|
+
wallettype: String(wallettype).toUpperCase(),
|
|
112
122
|
});
|
|
113
123
|
};
|
|
114
124
|
|