summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2015-03-16 15:08:16 (EDT)
committer P. J. McDermott <pj@pehjota.net>2015-03-16 15:08:16 (EDT)
commite11cb0820f20d0c847961b47282fc98110b5fd86 (patch)
treeb68c93a6a2b6ac9e658901fae3c5c9cc2b7a6830
parent0af3d76e7dfba5fb6eb63ebc4d8baf79743973eb (diff)
downloadepirts.js-e11cb0820f20d0c847961b47282fc98110b5fd86.zip
epirts.js-e11cb0820f20d0c847961b47282fc98110b5fd86.tar.gz
epirts.js-e11cb0820f20d0c847961b47282fc98110b5fd86.tar.bz2
Epirts.card.createToken(): Fix callback signatures
-rw-r--r--README3
-rw-r--r--epirts.js4
2 files changed, 5 insertions, 2 deletions
diff --git a/README b/README
index fb18cf9..ea118ee 100644
--- a/README
+++ b/README
@@ -30,6 +30,9 @@ Methods
cvc: '123'
}, stripeResponseHandler);
+ The callback function will be given two arguments, a `status` code and a
+ `response` object.
+
* `Epirts.card.validateCardNumber(number)`
Checks that the card number appears valid and passes the Luhn check.
diff --git a/epirts.js b/epirts.js
index 4c5216e..0e5b22a 100644
--- a/epirts.js
+++ b/epirts.js
@@ -78,8 +78,8 @@ var Stripe = Epirts = (function() {
script.async = true;
func = 'sjsonp' + ++_cb_time;
- window[func] = function(result) {
- callback(result);
+ window[func] = function(response, status) {
+ callback(status, response);
script.parentNode.removeChild(script);
}