Skip to content

Commit

Permalink
Merge pull request #595 from Expensify/nat-virtualcards
Browse files Browse the repository at this point in the history
Add methods to create and update admin issued virtual cards
  • Loading branch information
MariaHCD authored Nov 7, 2023
2 parents 886f90c + a1da79f commit 0e96a8f
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions lib/API.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.cardTitle
* @param {string} parameters.assigneeEmail
* @param {number} parameters.cardLimit
* @param {string} parameters.cardLimitType
*
* @returns {APIDeferred}
*/
createAdminIssuedVirtualCard: function (parameters) {
const commandName = 'Card_CreateAdminIssuedVirtualCard';
requireParameters(['cardTitle', '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.cardTitle
* @param {string} parameters.assigneeEmail
* @param {number} parameters.cardLimit
* @param {string} parameters.cardLimitType
*
* @returns {APIDeferred}
*/
editAdminIssuedVirtualCard: function (parameters) {
const commandName = 'Card_EditAdminIssuedVirtualCard';
requireParameters(['domainName', 'cardID', 'cardTitle', 'assigneeEmail', 'cardLimit', 'cardLimitType'], parameters, commandName);
return performPOSTRequest(commandName, parameters);
},
},

JSON_CODES: {
Expand Down

0 comments on commit 0e96a8f

Please sign in to comment.