From 7fcd0e8d4ef371bf522467198cc22c81e7ab34e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20S=CC=8Cirka?= Date: Sun, 13 Sep 2015 09:37:31 +0200 Subject: [PATCH] Add backward compatibility for Paypal.pay(). --- index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.js b/index.js index c5da054..28f6c85 100644 --- a/index.js +++ b/index.js @@ -77,6 +77,12 @@ Paypal.prototype.detail = function(token, payer, callback) { Paypal.prototype.pay = function(invoiceNumber, amount, description, currency, requireAddress, callback) { + // Backward compatibility + if (typeof(requireAddress) === 'function') { + callback = requireAddress; + requireAddress = false; + } + var self = this; var params = self.params();