Skip to content

Commit 0888888

Browse files
committed
Dist - version 1.31.0
1 parent 712d0e1 commit 0888888

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

dist/voucherify.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,17 @@ window.Voucherify = (function (window, document, $) {
258258
}
259259

260260
queryString += "&" + Object.keys(customer).map(function (key) {
261+
if (key === "metadata") {
262+
if (typeof(customer.metadata) !== "object") {
263+
console.error("Customer's metadata must be an object - please use instead { property: 'value' }");
264+
return null;
265+
}
266+
267+
return Object.keys(customer.metadata).map(function (metadataKey) {
268+
return encodeURIComponent("customer[metadata][" + metadataKey + "]") + "=" + encodeURIComponent(customer.metadata[metadataKey]);
269+
}).join("&");
270+
}
271+
261272
return encodeURIComponent("customer[" + key + "]") + "=" + encodeURIComponent(customer[key]);
262273
}).join("&");
263274
}

0 commit comments

Comments
 (0)