/*global cordova, module*/

module.exports = {
    /**
     * @param charge
     * @param successCallback ['success']
     * @param errorCallback ['fail'|'cancel'|'invalid']
     */
    createPayment: function (charge, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "PingppPlugin", "createPayment", [JSON.stringify(charge)]);
    }
};

@@ -1,12 +1,18 @@
 /*
-global
+*%0A * ping++,
  cor
@@ -23,16 +23,72 @@
 , module
+%0A * Author: Tong Chia%0A * License: Apache License 2.0%0A * 
 */%0A%0Amodu
@@ -123,16 +123,32 @@
 * @param
+ %7Bobject%7Cstring%7D
  charge%0A
@@ -160,16 +160,27 @@
 * @param
+ %7BFunction%7D
  success
@@ -213,16 +213,27 @@
 * @param
+ %7BFunction%7D
  errorCa
@@ -346,16 +346,126 @@
 back) %7B%0A
+        if (typeof charge === 'string') %7B JSON.parse(charge); %7D%0A        if (charge.object === 'charge') %7B%0A    
         
@@ -569,16 +569,100 @@
 rge)%5D);%0A
+        %7D else %7B%0A            return errorCallback('wrong charge object');%0A        %7D%0A
     %7D%0A%7D;

Update pingpp.js