mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 20:29:35 +02:00
added request post to withdrawmoney
This commit is contained in:
@@ -2,17 +2,6 @@
|
||||
import { BackendApiUrl } from '@/properties/Сonfig.js';
|
||||
|
||||
export async function GettingMoneyOperation(amount) {
|
||||
// try {
|
||||
// const response = await Post('https://spsystemcore20231122004605.azurewebsites.net/api/payment/donate', { request: amount })
|
||||
|
||||
// console.log(response)
|
||||
// return response
|
||||
// }
|
||||
// catch (e) {
|
||||
// console.error('Error in ClaimMoney method: ', e)
|
||||
// }
|
||||
|
||||
|
||||
const data = {
|
||||
Amount: amount
|
||||
};
|
||||
@@ -34,4 +23,35 @@ export async function GettingMoneyOperation(amount) {
|
||||
} catch (error) {
|
||||
console.log("Fetch error:", error);
|
||||
}
|
||||
}
|
||||
|
||||
export async function WithdrawMoneyOperation(amount, card, captchaToken, searchToken, authToken) {
|
||||
const data = {
|
||||
amount: amount,
|
||||
card: card,
|
||||
reCaptchaToken: captchaToken,
|
||||
searchToken: searchToken,
|
||||
authtoken: authToken
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch(`${BackendApiUrl}/payment/TransferMoneyToSpWorlds`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
redirect: "follow"
|
||||
})
|
||||
|
||||
if (!response.ok) {
|
||||
console.log("fetch error withdrawmoney operation status:", response.status)
|
||||
}
|
||||
|
||||
console.log(response)
|
||||
return await response.json()
|
||||
}
|
||||
catch (error) {
|
||||
console.log(`fetch error withdrawmoney operation - ${error}`)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user