Hi
I have a shop app. In that app i have have a checkout form with a button that loads an iframe with payment options from server.
Somehow the page with the iframe triggers it twice and that makes the payment fail. Does anyone have a solution to this?
Simplified code:
<script id="cart.html" type="text/ng-template">
<button class="button button-block button-energized" ng-click="purchase()">Purchase</button>
</script>
.controller("ShoppingCartCtrl", function($scope, $http, $ionicNavBarDelegate, $q, $state, restaurant, user){
download_post($http, f_server + "/api/checkout", data)
.success(function(data, status, headers, config) {
var d = angular.fromJson(data);
if(d["success"]){
console.log("Purchase Success");
$state.go("purchase");
}
})
<script id="purchase.html" type="text/ng-template">
<ion-view title="Purchase" ng-controller="PurchaseCtrl">
<ion-nav-bar class="bar-royal">
<ion-nav-back-button class="button-icon ion-arrow-left-c">
</ion-nav-back-button>
</ion-nav-bar>
<ion-content overflow-scroll="true">
<div style="height: 100%; width: 100%;">
<iframe src="http://external.url/payment/start" style="width:100%; height: 100%;"></iframe>
</div>
</ion-content>
</ion-view>
</script>