catch and throw proper stripe error message
This commit is contained in:
parent
afe223f410
commit
0c1fb3e118
|
@ -16,6 +16,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
return apiService.organizations.putPayment({ id: $state.params.orgId }, request).$promise;
|
return apiService.organizations.putPayment({ id: $state.params.orgId }, request).$promise;
|
||||||
|
}, function (err) {
|
||||||
|
throw err.message;
|
||||||
}).then(function (response) {
|
}).then(function (response) {
|
||||||
$scope.card = null;
|
$scope.card = null;
|
||||||
if (existingPaymentMethod) {
|
if (existingPaymentMethod) {
|
||||||
|
|
|
@ -86,6 +86,8 @@
|
||||||
else {
|
else {
|
||||||
return stripe.card.createToken(card).then(function (response) {
|
return stripe.card.createToken(card).then(function (response) {
|
||||||
return response.id;
|
return response.id;
|
||||||
|
}).catch(function (err) {
|
||||||
|
throw err.message;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
return apiService.organizations.post(paidRequest).$promise;
|
return apiService.organizations.post(paidRequest).$promise;
|
||||||
|
}, function (err) {
|
||||||
|
throw err.message;
|
||||||
}).then(finalizeCreate);
|
}).then(finalizeCreate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,6 +91,8 @@
|
||||||
else {
|
else {
|
||||||
return stripe.card.createToken(model.card).then(function (response) {
|
return stripe.card.createToken(model.card).then(function (response) {
|
||||||
return response.id;
|
return response.id;
|
||||||
|
}).catch(function (err) {
|
||||||
|
throw err.message;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue