Why is the customer not being charged?
<p>I am trying to charge a customer using stripe, cloud code, and swift. I can successfully create a customer with all the metadata, but it fails when I charge the card. I get these errors. 
<a href="https://i.stack.imgur.com/tBWkU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tBWkU.png" alt="enter image description here"></a></p>

<p>cloud code</p>

<pre><code>var Stripe = require('stripe');
Stripe.initialize('sk_test_xxx');





Parse.Cloud.define("createCustomer", function(request, response) {
Stripe.Customers.create({
card:     request.params.coin,
account_balance: 25*100,
metadata: {
name: request.params.name,
customer: request.params.customer, // e.g PFUser object ID
}

}, {
success: function(customer) {
response.success(customer.id);
},
error: function(error) {
 response.error("Error:" +error);
}
})
    });


Parse.Cloud.define("createCharge", function(request, response) {
           Stripe.Charges.create({
amount: 100 * 25, 
currency: "usd",
card: request.params.coin,
customer: request.params.customerId
},{
success: function(httpResponse) {
response.success("Purchase made!");
},
error: function(httpResponse) {
    response.error(httpResponse)
    response.error("Uh oh, something went wrong");
    }
});

});
</code></pre>

<p>ios code: </p>

<pre><code>                PFCloud.callFunctionInBackground("createCustomer", withParameters: ["coin" : coin, "name": name, "customer": customer], block: { (success: AnyObject?, error: NSError?) -&gt; Void in
                    if error != nil {
                        print("create customer not working")
                        print(error)
                    }




                })

                var customerId = customer!

                PFCloud.callFunctionInBackground("createCharge", withParameters: ["customerId" : customerId], block: { (success: AnyObject?, error: NSError?) -&gt; Void in
                    if error != nil {
                        print("not working")
                    }
                })
</code></pre>