After Intializing Backendless, and setting up the webhook on Stripes end (I tested the webhook, it functions fine)
whenever I run this piece of code
async submit(ev) {
ev.preventDefault();
let { token } = await this.props.stripe.createToken({ name: “Name” });
console.log(“TOKEN”, token);
let chargeData = {
token: token.id,
amount: 2
};
Backendless.CustomServices.invoke("Stripe", "charge", [chargeData])
.then(function(result) {
var channel = Backendless.Messaging.subscribe("stripe/" + result.id);
channel.addMessageListener(this.onMessage);
})
.catch(function(error) {
console.log("Error", error);
});
}
onMessage = message => {
console.log("Message received: ");
};
I keep getting the following Error:
POST: https://api.backendless.com/APP ID/JS KEY/services/Stripe/charge 400 (Bad Request)
Here is the Printed Message:
Error: Service invocation failed: ExceptionClass:“RuntimeException” {Msg:"com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of java.util.HashMap
out of START_ARRAY token
(I removed the Keys for obvious reasons)
I followed this documentation exactly, here’s proof of the Stripe test webhooks working
Any help would be greatly appreciated