Closed flizana closed 5 years ago
Hi @flizana , I'am getting the same problem Did you figure it out ?
@israelgp24 Even though this page is displayed, the transaction is approved (by checking the authorization code). I think it must be a bug inside Webpay (Transbank). I'm still looking for the solution.
I had the same problem. It turns out that the form element didn't have method="post", so it was a GET request, not a POST request
Note: My "redirect" it just a form with a hidden token_ws element, submitted programmatically with js
@flizana , really ? do you get a transaction approved ?, i used inittransaction and i got a token and a url , but when i made gettransactionresult using that token i got a timeout error
@nanocatdemen when you say form you mean the webpay form ?
Note: My "redirect" it just a form with a hidden token_ws element, submitted programmatically with js
I know, my redirect is the same, a form with hidden token_ws
input element. @nanocatdemen did you solve this problem?
Using django. The "success" view
result = webpay.get_transaction_result(request.POST['token_ws'])
redirect_url = result['urlRedirection']
webpay.acknowledge_transaction(request.POST['token_ws'])
...
return render(request, 'payments/success.html', {'redirect_url': redirect_url, 'token_ws': request.POST['token_ws']})
Renders this html template
<form method="POST" action="{{ redirect_url }}" >
<input type="hidden" name="token_ws" value="{{ token_ws }}" />
</form>
<script>
setTimeout(function(){
document.getElementsByTagName('form')[0].submit();
}, 3000);
</script>
this issues should be resolved with documentation #3
I have successfully implemented WebpayPlus with the help of this repo. Although when I tell the server to redirect to the URL provided by Transbank (with
token_ws=blabla
as a query parameter) afterget_transaction_result
call, the following page is displayed:BTW, I am already calling
acknowledge_transaction
before telling the server to redirect. The odd thing is if I click on the link it leads me to my final URL.