Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Stripe Card Token no longer works.

Hello Jon,

Please check your code carefully.
Open browser console when test your project, there are errors.
Also check mapping in service StripePayment_CardTokenService

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Stripe Card Token no longer works.

Hello Benoit,

You have format 4242 4242 4242 4242, should be like 4242424242424242
Also please check mapping https://api.appery.io/rest/1/proxy/tu...
You have NaN in amount

Jon Haider
Posts: 0
Joined: Thu Oct 16, 2014 2:53 pm

Stripe Card Token no longer works.

Alena,

What code? Without writing any code, if you just create a new app, add the Stripe plugin, add the test key, and test the "StripePayment_CardTokenService" in the service view, it returns an error. There is no code...

Then, if you go to The Stripe dashboard, look at the log, and you will see that the request doesn't contain a JSON object like it used to. It looks all messed up like in my first post.

Mapping has nothing to do with it, as you can test the "StripePayment_CardTokenService" service without creating any mapping. It's been three days, and now we won't hear back from appery again until tomorrow since responses are only made once a day on this topic, delaying resolution yet further, when your plugin no longer works.

Even if you create a new app, and test your plugin straight out of the box, I will post snapshots in a minute...

Benoit
Posts: 0
Joined: Fri Dec 19, 2014 3:26 pm

Stripe Card Token no longer works.

Hello Alena,

The amount is not needed to get the Token number. In test, we need only the card number and even with 4242424242424242 it does not work.

As Jon is saying, the issue is coming from somewhere else. I have tried to use your new procedure for Stripe API and I have changed the proxy to match with the new recommandations. Nothing is working.

Thanks for your quick support,
Best regards,

Benoit

Jon Haider
Posts: 0
Joined: Thu Oct 16, 2014 2:53 pm

Stripe Card Token no longer works.

Here are a few snapshots:
Image

Image

Straight out of the box, no code. This is a new dummy app I created for the sole purpose of testing your Stripe plugin, and it doesn't work.

From Stripe Dashboard:
Image

Jon Haider
Posts: 0
Joined: Thu Oct 16, 2014 2:53 pm

Stripe Card Token no longer works.

The issue is clear: Stripe's token api (https://api.stripe.com/v1/tokens) is interpreting the open brackets "[" and close brackets "]" in card[number], card[exp_month], card[exp_year], and card[cvc] as "%5B" and "%5D" respectively. Previously (3 weeks ago) it knew that this meant a JSON object named "card" with objects called number, exp_month, exp_year, and cvc (as shown in the original post).

Benoit
Posts: 0
Joined: Fri Dec 19, 2014 3:26 pm

Stripe Card Token no longer works.

Hello Alena,

I will show you three logs from stripe to show you what changed :

  • 1st one is the one you succeeded for your test :

    Image

    -2nd one is the one I have failed with Stripe API :

    Image

  • 3rd one is a past log when it was working :

    Image

Benoit
Posts: 0
Joined: Fri Dec 19, 2014 3:26 pm

Stripe Card Token no longer works.

Do you know how to solve it ? This is what I have noticed from stripe logs.

Jon Haider
Posts: 0
Joined: Thu Oct 16, 2014 2:53 pm

Stripe Card Token no longer works.

I've also tried to figure this out using the Appery server code. Here's what I've created (which I thought should work fine):

pre

var card = {
"number":"4242424242424242",
"exp_month":04,
"exp_year":2017,
"cvc":"123"
}

var secretKey = "sk_test_XXXXXXXXXXXXXXXXXXXXX";
var url = "https://api.stripe.com/v1/tokens";
var postData = {
"parameters": {
"card":card
},
"headers": {
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Bearer " + secretKey
}
};
console.log(url);
var XHRResponse = XHR2.send("POST", url, postData);
response.success((XHRResponse.body), "json");
/pre

But it's returning this error:

Script createCardToken: Error: Failed to create URI: https://api.stripe.com/v1/tokens?card={ 'number' : '4242424242424242' , 'exp_month' : 4 , 'exp_year' : 2017 , 'cvc' : '123'} ( @ 38 : 18 ) - throw e

Jon Haider
Posts: 0
Joined: Thu Oct 16, 2014 2:53 pm

Stripe Card Token no longer works.

Stripe is saying we should NOT be using the bracket notation in our rest call. So instead of card[number], card[exp_month], card[exp_year], and card[cvc]. They're suggesting to use a hash instead.

This issue is extremely problematic. Without a Stripe token plugin, apps from Appery cannot process stripe payment (unless they already have the customer number). Otherwise, what other methods are there to reach the Stripe's api?

XHR2 method doesn't work either (as indicated above)...

is there a way to use Stripe.js with appery? Maybe using Stripe.js as a library in the server code...?

Return to “Issues”