I am reading from the Stripe documentation that I can charge an user with the following curl request:
Definition
POST https://api.stripe.com/v1/charges
Request
curl https://api.stripe.com/v1/charges \
-u sk_test_PjPAEVD1LXfUuA6XylJPnQX4: \
-d amount=400 \
-d currency=eur \
-d source=tok_16ffrPHW84OuTX9VFTYguruR \
-d description="Charge for test@example.com"
In an Angular setting, I presume that I have to use $http. However, how do you pass on the parameters?
I tried the following
$http.post('https://api.stripe.com/v1/charges', result)
.success(function(data, status, headers, config) {
alert("success", data);
})
.error(function(data, status, headers, config) {
alert("error", data);
});
but received the error:
XMLHttpRequest cannot load https://api.stripe.com/v1/charges. No 'Access-Control-Allow-Origin' header is present on the requested resource.