mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 20:29:35 +02:00
change payment api call
This commit is contained in:
@@ -1,14 +1,39 @@
|
|||||||
import { Post } from '../rest/RestMethods.js';
|
// import { Post } from '../rest/RestMethods.js';
|
||||||
// import { BackendApiUrl } from '@/properties/Сonfig.js';
|
import { BackendApiUrl } from '@/properties/Сonfig.js';
|
||||||
|
|
||||||
export async function GettingMoneyOperation(amount) {
|
export async function GettingMoneyOperation(amount) {
|
||||||
try {
|
// try {
|
||||||
const response = await Post('https://spsystemcore20231122004605.azurewebsites.net/api/payment/donate', { request: amount })
|
// 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
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
const response = await fetch(`${BackendApiUrl}/api/payment/donate`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
body: JSON.stringify(data),
|
||||||
|
redirect: "follow"
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
console.log("Fetch error:", response.status);
|
||||||
|
}
|
||||||
console.log(response)
|
console.log(response)
|
||||||
return response
|
|
||||||
}
|
return await response.json();
|
||||||
catch (e) {
|
} catch (error) {
|
||||||
console.error('Error in ClaimMoney method: ', e)
|
console.log("Fetch error:", error);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -65,11 +65,11 @@ export default {
|
|||||||
console.log(newAmount)
|
console.log(newAmount)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
try {
|
try {
|
||||||
// GettingMoneyOperation(newAmount)
|
GettingMoneyOperation(newAmount)
|
||||||
// .then((response) => {
|
.then((response) => {
|
||||||
// console.log('Payments Modal Working!: ', response)
|
console.log('Payments Modal Working!: ', response)
|
||||||
// this.url = response.url
|
this.url = response.url
|
||||||
// })
|
})
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
console.error('Error in PaymentModal!', e)
|
console.error('Error in PaymentModal!', e)
|
||||||
|
|||||||
Reference in New Issue
Block a user