Skip to content

Commit c467c44

Browse files
committed
Add function that returns token fro api
1 parent 7c0b0db commit c467c44

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// function that returns token from api
2+
/* eslint-disable consistent-return */
3+
function getPaymentTokenFromAPI(success) {
4+
if (success) {
5+
return new Promise((resolve) => {
6+
resolve({ data: 'Successful response from the API' });
7+
});
8+
}
9+
// Implicitly returns undefined for false
10+
}
11+
12+
module.exports = getPaymentTokenFromAPI;

0 commit comments

Comments
 (0)