0👍
First, you should prevent default submitting a form and then add another Axios call inside a function.
<form v-on:submit.prevent>
and checkout
should look like this,
Checkout: function(){
var vm = this;
axios.get('./api/pasargad').then(response => {
vm.InvoiceNumber = response.data.InvoiceNumber;
vm.InvoiceDate = response.data.InvoiceDate;
vm.Amount = response.data.Amount;
vm.TerminalCode = response.data.TerminalCode;
vm.MerchantCode = response.data.MerchantCode;
vm.RedirectAddress = response.data.RedirectAddress;
vm.TimeStamp = response.data.TimeStamp;
vm.Action = response.data.Action;
vm.Sign = response.data.Sign;
}.bind(vm));
});
axios.post('https://pep.shaparak.ir/gateway.aspx',vm)
},
Source:stackexchange.com