mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 12:19:31 +02:00
added request post to withdrawmoney
This commit is contained in:
@@ -2,17 +2,6 @@
|
|||||||
import { BackendApiUrl } from '@/properties/Сonfig.js';
|
import { BackendApiUrl } from '@/properties/Сonfig.js';
|
||||||
|
|
||||||
export async function GettingMoneyOperation(amount) {
|
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 = {
|
const data = {
|
||||||
Amount: amount
|
Amount: amount
|
||||||
};
|
};
|
||||||
@@ -35,3 +24,34 @@ export async function GettingMoneyOperation(amount) {
|
|||||||
console.log("Fetch error:", 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}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -93,7 +93,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import "@/assets/css/ComponentsStyles/payments-modal.css";
|
import "@/assets/css/ComponentsStyles/payments-modal.css";
|
||||||
import PaymentsModalNumbers from "@/mocks/PaymentsModalNumbers";
|
import PaymentsModalNumbers from "@/mocks/PaymentsModalNumbers";
|
||||||
import { GettingMoneyOperation } from "@/assets/js/moneyoperation/Claimmoney";
|
import { GettingMoneyOperation, WithdrawMoneyOperation } from "@/assets/js/moneyoperation/Claimmoney";
|
||||||
|
import { GetCookie } from "@/assets/js/storage/CookieStorage";
|
||||||
import CaptchaComponent from "@/components/CaptchaComponent.vue";
|
import CaptchaComponent from "@/components/CaptchaComponent.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -101,10 +102,11 @@ export default {
|
|||||||
props: ["payments"],
|
props: ["payments"],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
amount: 0,
|
amount: 1,
|
||||||
amountWithdraw: 0,
|
amountWithdraw: 1,
|
||||||
card: 0,
|
amountSave: 1,
|
||||||
captchaToken: '',
|
card: '',
|
||||||
|
captchaToken: null,
|
||||||
clickedBtn: "",
|
clickedBtn: "",
|
||||||
url: "",
|
url: "",
|
||||||
offBtn: true,
|
offBtn: true,
|
||||||
@@ -131,7 +133,26 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
amountWithdraw(newAmount) {
|
amountWithdraw(newAmount) {
|
||||||
console.log(newAmount)
|
if (newAmount > 0) {
|
||||||
|
this.amountSave = newAmount
|
||||||
|
console.log(`save amount = ${this.amountSave}`)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
captchaToken(TokenClaim) {
|
||||||
|
if(TokenClaim !== '' && this.amountSave > 0) {
|
||||||
|
this.offBtn = true
|
||||||
|
setTimeout(() => {
|
||||||
|
try {
|
||||||
|
WithdrawMoneyOperation(this.amountSave, this.card.toString(), TokenClaim, GetCookie('SearchToken'), GetCookie('AUTHTOKEN')).then((response) => {
|
||||||
|
console.log(`work withdraw - ${response}`)
|
||||||
|
this.offBtn = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.error(`Error in wihdrawmoney operation - ${e}`)
|
||||||
|
}
|
||||||
|
}, 4000)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user