Sean Kelley
Posts: 0
Joined: Thu Oct 11, 2012 2:25 pm

Stripe Plugin Problem

Hi
​I am trying to use the stripe plugin. I have followed the tutorial and I have made a successful service response with Bearer prefixed to test key.
http://docs.appery.io/tutorials/makin...

When I attempt to run the app I get this error:
It looks like you're making a cross-origin request from a web page or browser extension. You'll need to use Bearer authentication instead of basic authentication (which we're deprecating). Basically, you need to set the header "Authorization" to "Bearer ".

I then edit the JS on Authentication request field of
StripePayment_CardTokenService and I change this to read:
//return "Basic " + result;
return "Bearer " + result;

I ​then ​get the error that my key is invalid:
Invalid API Key provided: *******************************************=

I am guessing the problem is with StripePayment_Encoder
When I alert the 'result' in the above script it also adds equals sign at end (=). Is that the problem?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Stripe Plugin Problem

Does the service have the proxy on?

Sean Kelley
Posts: 0
Joined: Thu Oct 11, 2012 2:25 pm

Stripe Plugin Problem

yes

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Stripe Plugin Problem

Check in Dev. Toosl Network tab, to see the actual request being sent. Make sure everything looks good there.

Sean Kelley
Posts: 0
Joined: Thu Oct 11, 2012 2:25 pm

Stripe Plugin Problem

Not sure if this is what you mean but it says:
tunnel
/app/rest 401 Unauthorized

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Stripe Plugin Problem

This most likely means the service is not authenticating correctly. Check the header section in Network tab to make sure all the parameters are there, formatted correct, etc.

Sean Kelley
Posts: 0
Joined: Thu Oct 11, 2012 2:25 pm

Stripe Plugin Problem

Does this look ok? Only thing I would expect would be Authorization which looks curious with the = sign at the end.
Th credit card info all looks ok

Accept:application/json, text/javascript, /; q=0.01
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
appery-key:XXXXXXXXXXXX
appery-proxy-url:https://api.stripe.com/v1/tokens
appery-rest:2XXXXXX
Authorization:Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=
Connection:keep-alive
Content-Length:96
Content-Type:application/x-www-form-urlencoded
Cookie:left this out
DNT:1
Host:appery.io
Origin:http://appery.io
Referer:http://appery.io/app/view/myappid/Str...
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Stripe Plugin Problem

I'm not that familiar with Stripe API but it looks right. Does it need any other request parameters? Do you get the error message above as JSON response or somewhere?

Sean Kelley
Posts: 0
Joined: Thu Oct 11, 2012 2:25 pm

Stripe Plugin Problem

the error is presented in the cc input form in between the credit card info and charge specifics. Looks like JSON response. Found this also:
{
"error": {
"type": "invalid_request_error",
"message": "Invalid API Key provided: *******************************************="
}
}
under Network-Response

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Stripe Plugin Problem

Looks like something is not right with the key you are passing. I didn't see the key above...are you passing it?

Return to “Issues”