Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions src/components/payments.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,11 @@ export async function completeKevinAuthentication({
return response;
}

export async function createKevinTransaction({secretKey, orderId, bankId}) {
export async function createKevinTransaction({
secretKey,
orderId,
paymentMethodId,
}) {
const response = await server.loadJson(
`${Config.apiUrl}${Endpoints.PROJECT.PAYMENTS.TRANSACTIONS.CREATE_KEVIN(
orderId
Expand All @@ -212,7 +216,27 @@ export async function createKevinTransaction({secretKey, orderId, bankId}) {
'Content-Type': 'application/json',
},
body: JSON.stringify({
bankId,
paymentMethodId,
}),
}
);

return response;
}

export async function checkKevinPaymentStatus({secretKey, paymentId}) {
const response = await server.loadJson(
`${Config.apiUrl}${Endpoints.PROJECT.PAYMENTS.TRANSACTIONS.CHECK_KEVIN_STATUS}`,
{
method: 'POST',
headers: {
'X-CM-ProjectId': Config.projectId,
Authorization: `Bearer ${secretKey || Config.secretKey}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
paymentId,
}),
}
);
Expand Down
1 change: 1 addition & 0 deletions src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export const CONFIG = {
`/v2/payments/orders/${orderId}/paysera/pay`,
CREATE_STRIPE: (orderId) => `/v2/payments/orders/${orderId}/stripe/pay`,
CREATE_KEVIN: (orderId) => `/v2/payments/orders/${orderId}/kevin/pay`,
CHECK_KEVIN_STATUS: '/v2/payments/orders/kevin/payment/status',
},
DISCOUNTS: {
CREATE_DISCOUNT: '/v2/payments/discounts',
Expand Down