Stripe not answering
Closed this issue · 14 comments
Hello, i've created a cordova project. I add the stripe plugin as you said ($ cordova plugin add https://github.com/Telerik-Verified-Plugins/Stripe --variable API_KEY=''my private api key").
Then i run the app, and in console put window.stripe and it return
Stripe
charges: Charges
customers: Customers
recipients: Recipients
transfers: Transfers
proto: Stripe
so i understand that the plugin is installed. then i write your example
stripe.customers.create({
description : "Jon Doe",
email : "jon@telerik.com"
}, function(result){
// Result contains error or customer object
});
but nothing return.
I tried with public and private api key, and i've tried other commands likes stripe.customers.list, stripe.charges.create, and nothing.
Any idea what is happening? I need to use this plugin.
Thanks
Hi,
Perhaps there is a technical error which you don't receive because there is no error handler defined in your code. Could you try running it again with an error handler like so:
// creating a customer: https://stripe.com/docs/api#create_customer
stripe.customers.create(
{
description : "John Doe",
email : "john@telerik.com"
},
function (response) {alert("Customer created:\n\n" + JSON.stringify(response))},
function(response) {alert(JSON.stringify(response))} // error handler
);
Hello, and thanks for the answer. I´ve run that code too, but no error
return.
Any other idea?
Thanks!!!
El Wed Jan 07 2015 at 16:25:30, Eddy Verbruggen (notifications@github.com)
escribió:
Hi,
Perhaps there is a technical error which you don't receive because there
is no error handler defined in your code. Could you try running it again
with an error handler like so:// creating a customer: https://stripe.com/docs/api#create_customer
stripe.customers.create(
{
description : "John Doe",
email : "john@telerik.com"
},
function (response) {alert("Customer created:\n\n" + JSON.stringify(response))},
function(response) {alert(JSON.stringify(response))} // error handler
);—
Reply to this email directly or view it on GitHub
#3 (comment)
.
Perhaps there's a more generic Javascript error?
Can you try adding a JS catch all function to see if that's the case?
Just add this in the head of your index.html:
window.onerror = function(a,b,c) {
alert(a + ", " + b + ", " + c);
}
really weird, but nothing at all, here is a printscreen
El Wed Jan 07 2015 at 16:32:02, Eddy Verbruggen (notifications@github.com)
escribió:
Perhaps there's a more generic Javascript error?
Can you try adding a JS catch all function to see if that's the case?
Just add this in the head of your index.html:window.onerror = function(a,b,c) {
alert(a + ", " + b + ", " + c);
}—
Reply to this email directly or view it on GitHub
#3 (comment)
.
Have you tried our demo app which you can try from the button at the top left here? Or if you don't have or want an AppBuilder account, you can find the sources here.
That should definitely work (just confirmed it). If not, there is something wrong with your account..
i´ve downloaded the demo version, but don´t know how to run it.
What should i do to run it?
El Wed Jan 07 2015 at 17:14:02, Eddy Verbruggen (notifications@github.com)
escribió:
Have you tried our demo app which you can try from the button at the top
left here http://plugins.telerik.com/plugin/stripe? Or if you don't
have or want an AppBuilder account, you can find the sources here
https://github.com/Telerik-Verified-Plugins/Stripe-DemoApp.That should definitely work (just confirmed it). If not, there is
something wrong with your account..—
Reply to this email directly or view it on GitHub
#3 (comment)
.
It's created for AppBuilder (the first link in my previous post), but you can start a new project with the Cordova CLI, add the plugin as you did before and copy the folders kendo, scripts and styles, as well as the index.html to your www directory.
perfect, i´ll try that. Thanks
El Wed Jan 07 2015 at 17:23:43, Eddy Verbruggen (notifications@github.com)
escribió:
It's created for AppBuilder (the first link in my previous post), but you
can start a new project with the Cordova CLI, add the plugin as you did
before and copy the folders
https://github.com/Telerik-Verified-Plugins/Stripe-DemoApp/tree/master/Stripe
kendo, scripts and styles, as well as the index.html to your www directory.—
Reply to this email directly or view it on GitHub
#3 (comment)
.
hello, again me, i'll try another ways, but, I've created a cordova
project, add ios platform, add the stripe plugin (with private key), then
copy all the demo project inside the www, and when i run the app in xcode,
white screen.
Console:
[Warning] Unexpected CSS token: ) (kendo.mobile.all.min.css, line 8, x2)
[Error] Deprecated attempt to access property 'userAgent' on a
non-Navigator object.
(función anónima) (kendo.mobile.min.js, line 8)
(función anónima) (kendo.mobile.min.js, line 9)
(función anónima) (kendo.mobile.min.js, line 15)
(función anónima) (kendo.mobile.min.js, line 8)
global code (kendo.mobile.min.js, line 8)
[Error] Deprecated attempt to access property 'standalone' on a
non-Navigator object.
(función anónima) (kendo.mobile.min.js, line 8)
(función anónima) (kendo.mobile.min.js, line 8)
(función anónima) (kendo.mobile.min.js, line 9)
(función anónima) (kendo.mobile.min.js, line 15)
(función anónima) (kendo.mobile.min.js, line 8)
global code (kendo.mobile.min.js, line 8)
[Error] Deprecated attempt to access property 'userAgent' on a
non-Navigator object.
(función anónima) (kendo.mobile.min.js, line 8)
(función anónima) (kendo.mobile.min.js, line 9)
(función anónima) (kendo.mobile.min.js, line 15)
(función anónima) (kendo.mobile.min.js, line 8)
global code (kendo.mobile.min.js, line 8)
[Error] Failed to load resource: The requested URL was not found on this
server. (jquery.min.map, line 0)
[Error] TypeError: undefined is not an object (evaluating
'navigator.splashscreen.hide')
(función anónima) (app.js, line 5)
fire (cordova.js, line 760)
(función anónima) (cordova.js, line 223)
have I missed a step?
El Wed Jan 07 2015 at 17:58:37, Braian Mellor (braianj@gmail.com)
escribió:
perfect, i´ll try that. Thanks
El Wed Jan 07 2015 at 17:23:43, Eddy Verbruggen (notifications@github.com)
escribió:It's created for AppBuilder (the first link in my previous post), but you
can start a new project with the Cordova CLI, add the plugin as you did
before and copy the folders
https://github.com/Telerik-Verified-Plugins/Stripe-DemoApp/tree/master/Stripe
kendo, scripts and styles, as well as the index.html to your www directory.—
Reply to this email directly or view it on GitHub
#3 (comment)
.
Hi,
Perhaps it's more convenient to take these steps instead:
cordova create stripetest
cordova platform add <platform>
cordova plugin add <stripe with key>
-- copy the content below over the www/index.html file
cordova prepare
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<html>
<head>
<meta charset="utf-8"/>
<meta name="format-detection" content="telephone=no"/>
<meta name="msapplication-tap-highlight" content="no"/>
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height"/>
<link rel="stylesheet" type="text/css" href="css/index.css"/>
<title>Hello World</title>
<script>
window.onerror = function(a,b,c) {
alert(a);
alert(c);
}
</script>
</head>
<body>
<div class="app">
<h1>Apache Cordova</h1>
<div id="deviceready" class="blink">
<p class="event listening">Connecting to Device</p>
<p class="event received">Device is Ready</p>
<button onclick="listCustomers()">List Customers</button><br/><br/>
<button onclick="deleteCustomer()">Delete Customer</button>
</div>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script>
function listCustomers() {
stripe.customers.list(
{
"limit" : 2
},
function (msg) {alert(JSON.stringify(msg))}
);
}
function deleteCustomer() {
stripe.customers.list(
{
"limit" : 1
},
function (response) {
if (response.data.length == 0) {
alert("Please create a customer first.");
} else {
// https://stripe.com/docs/api#delete_customer
alert("Removing customer with id: " + response.data[0].id)
stripe.customers.remove(response.data[0].id,
function(response) {
alert("Customer removed:\n\n" + JSON.stringify(response));
}
);
}
}
)
}
</script>
</body>
</html>
First of all, thanks for your fast answer.
now, i can see the html, but look at this
El Thu Jan 08 2015 at 13:06:07, Eddy Verbruggen (notifications@github.com)
escribió:
Hi,
Perhaps it's more convenient to take these steps instead:
cordova create stripetest
<title>Hello World</title> <script> window.onerror = function(a,b,c) { alert(a); alert(c); } </script>
cordova platform add
cordova plugin add
-- copy the content below over the www/index.html file
cordova prepare<script type="text/javascript" src="cordova.js"></script> <script type="text/javascript" src="js/index.js"></script><script> function listCustomers() { stripe.customers.list( { "limit" : 2 }, function (msg) {alert(JSON.stringify(msg))} ); } function deleteCustomer() { stripe.customers.list( { "limit" : 1 }, function (response) { if (response.data.length == 0) { alert("Please create a customer first."); } else { // https://stripe.com/docs/api#delete_customer alert("Removing customer with id: " + response.data[0].id) stripe.customers.remove(response.data[0].id, function(response) { alert("Customer removed:\n\n" + JSON.stringify(response)); } ); } } ) }</script>Apache Cordova
Connecting to Device
Device is Ready
List Customers
Delete Customer—
Reply to this email directly or view it on GitHub
#3 (comment)
.
Can you send me a PM (eddyverbruggen at gmail) or include the screenshot in a different way? It's not showing up here..
After lot of help by Eddy, he found the answer to my problem.
Sometimes after reinstalling several times the plugin, you need to go into xCode, to plugins/CDVStripe.m
At utilities at re right side, in "Target Membership", have to set the checkbox of the app, and that solve the problem.
Thanks again Eddy
👍