From 221ea397340a7904e530accbeedc7b5cfbb62cff Mon Sep 17 00:00:00 2001 From: Nathalie Kuoch Date: Fri, 3 Nov 2023 13:04:24 +0100 Subject: [PATCH 1/2] Add methods to create and update admin issued virtual cards --- lib/API.jsx | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/lib/API.jsx b/lib/API.jsx index b1da50b8..3e70e560 100644 --- a/lib/API.jsx +++ b/lib/API.jsx @@ -824,6 +824,42 @@ export default function API(network, args) { requireParameters(['cardUserEmail', 'hasCustomLimit', 'domainName'], parameters, commandName); return performPOSTRequest(commandName, parameters); }, + + /** + * Create an admin issued virtual card + * + * @param {Object} parameters + * @param {string} parameters.cardName + * @param {string} parameters.assigneeEmail + * @param {number} parameters.cardLimit + * @param {string} parameters.cardLimitType + * + * @returns {APIDeferred} + */ + createAdminIssuedVirtualCard: function (parameters) { + const commandName = 'Card_CreateAdminIssuedVirtualCard'; + requireParameters(['cardName', 'assigneeEmail', 'cardLimit', 'cardLimitType'], parameters, commandName); + return performPOSTRequest(commandName, parameters); + }, + + /** + * Edit an admin issued virtual card + * + * @param {Object} parameters + * @param {string} parameters.domainName + * @param {number} parameters.cardID + * @param {string} parameters.cardName + * @param {string} parameters.assigneeEmail + * @param {number} parameters.cardLimit + * @param {string} parameters.cardLimitType + * + * @returns {APIDeferred} + */ + editAdminIssuedVirtualCard: function (parameters) { + const commandName = 'Card_EditAdminIssuedVirtualCard'; + requireParameters(['domainName', 'cardID', 'cardName', 'assigneeEmail', 'cardLimit', 'cardLimitType'], parameters, commandName); + return performPOSTRequest(commandName, parameters); + }, }, JSON_CODES: { From a1da79fbd142e6158717ee9d2f0616d91cb262e6 Mon Sep 17 00:00:00 2001 From: Nathalie Kuoch Date: Mon, 6 Nov 2023 16:01:12 +0100 Subject: [PATCH 2/2] Use cardTitle instead of cardName --- lib/API.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/API.jsx b/lib/API.jsx index 3e70e560..a4ec8904 100644 --- a/lib/API.jsx +++ b/lib/API.jsx @@ -829,7 +829,7 @@ export default function API(network, args) { * Create an admin issued virtual card * * @param {Object} parameters - * @param {string} parameters.cardName + * @param {string} parameters.cardTitle * @param {string} parameters.assigneeEmail * @param {number} parameters.cardLimit * @param {string} parameters.cardLimitType @@ -838,7 +838,7 @@ export default function API(network, args) { */ createAdminIssuedVirtualCard: function (parameters) { const commandName = 'Card_CreateAdminIssuedVirtualCard'; - requireParameters(['cardName', 'assigneeEmail', 'cardLimit', 'cardLimitType'], parameters, commandName); + requireParameters(['cardTitle', 'assigneeEmail', 'cardLimit', 'cardLimitType'], parameters, commandName); return performPOSTRequest(commandName, parameters); }, @@ -848,7 +848,7 @@ export default function API(network, args) { * @param {Object} parameters * @param {string} parameters.domainName * @param {number} parameters.cardID - * @param {string} parameters.cardName + * @param {string} parameters.cardTitle * @param {string} parameters.assigneeEmail * @param {number} parameters.cardLimit * @param {string} parameters.cardLimitType @@ -857,7 +857,7 @@ export default function API(network, args) { */ editAdminIssuedVirtualCard: function (parameters) { const commandName = 'Card_EditAdminIssuedVirtualCard'; - requireParameters(['domainName', 'cardID', 'cardName', 'assigneeEmail', 'cardLimit', 'cardLimitType'], parameters, commandName); + requireParameters(['domainName', 'cardID', 'cardTitle', 'assigneeEmail', 'cardLimit', 'cardLimitType'], parameters, commandName); return performPOSTRequest(commandName, parameters); }, },