front-hub/src/api/wallet.ts

32 lines
910 B
TypeScript
Raw Normal View History

2023-07-07 13:53:08 +00:00
import { makeRequest } from "@frontend/kitui";
import { SendPaymentRequest, SendPaymentResponse } from "@root/model/wallet";
const apiUrl = process.env.NODE_ENV === "production" ? "/customer" : "https://hub.pena.digital/customer";
const testPaymentBody: SendPaymentRequest = {
type: "bankCard",
amount: 15020,
currency: "RUB",
bankCard: {
number: "RUB",
expiryYear: "2021",
expiryMonth: "05",
csc: "05",
cardholder: "IVAN IVANOV",
},
phoneNumber: "79000000000",
login: "login_test",
returnUrl: "https://hub.pena.digital/wallet",
};
export function sendPayment(body: SendPaymentRequest = testPaymentBody) {
return makeRequest<SendPaymentRequest, SendPaymentResponse>({
url: apiUrl + "/wallet",
contentType: true,
method: "POST",
useToken: true,
withCredentials: false,
body
});
}