I am trying to execute an angular function before the user is directed to the payment provider. The form for the payment provider appears as follows:
<form action="UrlToPaymentProvider" method="POST">
<input type="hidden" name="formKeys />
<input type="submit" />
</form>
Here is the AngularJS controller file:
$scope.memberRedirectedToPaymentProvider = function () {
console.log("Member is redirected");
$http.post("/my url", {
orderKey: $scope.model.Order.Key,
});
}
Although my console log displays the value, the post request does not seem to work. Upon debugging, I discovered that the post request works if I remove
action="UrlToPaymentProvider" method="POST"
from the form element.