Skip to content

Commit 818ea18

Browse files
author
meow12
authored
feat(payments): kevin auth token without callback (#83)
receive kevin auth token without callback
1 parent b63cf69 commit 818ea18

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/components/payments.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,31 @@ export async function startKevinAuthentication({secretKey, accountId, bankId}) {
173173
return response;
174174
}
175175

176+
export async function completeKevinAuthentication({
177+
secretKey,
178+
requestId,
179+
authorizationCode,
180+
}) {
181+
const response = await server.loadJson(
182+
`${Config.apiUrl}${Endpoints.PROJECT.PAYMENTS.AUTHENTICATION.AUTHENTICATE_KEVIN_TOKEN}`,
183+
{
184+
method: 'POST',
185+
headers: {
186+
'X-CM-ProjectId': Config.projectId,
187+
Authorization: `Bearer ${secretKey || Config.secretKey}`,
188+
Accept: 'application/json',
189+
'Content-Type': 'application/json',
190+
},
191+
body: JSON.stringify({
192+
requestId,
193+
authorizationCode,
194+
}),
195+
}
196+
);
197+
198+
return response;
199+
}
200+
176201
export async function createKevinTransaction({secretKey, orderId, bankId}) {
177202
const response = await server.loadJson(
178203
`${Config.apiUrl}${Endpoints.PROJECT.PAYMENTS.TRANSACTIONS.CREATE_KEVIN(

src/routes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ export const CONFIG = {
154154
},
155155
AUTHENTICATION: {
156156
AUTHENTICATE_KEVIN: '/v2/payments/auth/kevin',
157+
AUTHENTICATE_KEVIN_TOKEN: '/v2/payments/auth/kevin/token',
157158
},
158159
TRANSACTIONS: {
159160
CREATE_PAYSERA: (orderId) =>

0 commit comments

Comments
 (0)