Giter Site home page Giter Site logo

tolu360 / cordova-plugin-paystack Goto Github PK

View Code? Open in Web Editor NEW
33.0 7.0 16.0 1.75 MB

This plugin allows to add Paystack Payments to your application using Paystack Native Mobile SDKs for Android & iOS

License: Other

Java 14.07% JavaScript 2.00% Objective-C 83.93%
paystack-sdk paystack-ios cordova phonegap credit-card paystack-mobile-sdks

cordova-plugin-paystack's People

Contributors

tolu360 avatar yehiasalam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-paystack's Issues

Possible cause of "Invalid token"

Hi,

Token generated by this plugin is being returned as invalid when I try to charge the token.

{"data":{"status":false,"message":"Invalid Token"}

What could be the cause? I didn't find any explanation on Paystack docs.

Ionic app build fails with exception

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
   > Could not find com.android.support:appcompat-v7:24.2.0.
     Searched in the following locations:
         https://repo1.maven.org/maven2/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.pom
         https://repo1.maven.org/maven2/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.jar
         https://dl.bintray.com/paystack/maven/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.pom
         https://dl.bintray.com/paystack/maven/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.jar
         https://oss.sonatype.org/content/repositories/snapshots/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.pom
         https://oss.sonatype.org/content/repositories/snapshots/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.jar
         file:/C:/Users/Ikenna/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.pom
         file:/C:/Users/Ikenna/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.jar
         file:/C:/Users/Ikenna/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.pom
         file:/C:/Users/Ikenna/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.jar
     Required by:
         :android:unspecified > co.paystack.android:paystack:2.0.1
   > Could not find com.android.support:appcompat-v7:24.2.0.
     Searched in the following locations:
         https://repo1.maven.org/maven2/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.pom
         https://repo1.maven.org/maven2/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.jar
         https://dl.bintray.com/paystack/maven/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.pom
         https://dl.bintray.com/paystack/maven/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.jar
         https://oss.sonatype.org/content/repositories/snapshots/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.pom
         https://oss.sonatype.org/content/repositories/snapshots/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.jar
         file:/C:/Users/Ikenna/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.pom
         file:/C:/Users/Ikenna/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.jar
         file:/C:/Users/Ikenna/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.pom
         file:/C:/Users/Ikenna/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.jar
     Required by:
         :android:unspecified > co.paystack.android:paystack:2.0.1 > me.philio:pinentryview:1.0.6

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2 mins 31.524 secs
Error: Error code 1 for command: cmd with args: /s,/c,"C:\Users\Ikenna\Desktop\bsms\bmsApp\bms\platforms\android\gradlew cdvBuildDebug -b C:\Users\Ikenna\Desktop\bsms\bmsApp\bms\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"

Building an Ionic app fails with the above errors. I tried to follow some of the links that could not be found in my browser and some were returning 404s and The requested path was not found.

Examples:
https://repo1.maven.org/maven2/com/android/ exists but https://repo1.maven.org/maven2/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.pom returns a 404

https://dl.bintray.com/paystack/maven/co exists but https://dl.bintray.com/paystack/maven/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.pom returns The requested path was not found.

Failed to build with Ionic App

I followed the instructions in the readme, but when I try to install the app, I get this error

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
   > Could not resolve co.paystack.android:paystack:1.2.0.
     Required by:
         :android:unspecified
      > Could not GET 'https://repo1.maven.org/maven2/co/paystack/android/paystack/1.2.0/paystack-1.2.0.pom'.
         > repo1.maven.org
      > Could not GET 'https://dl.bintray.com/paystack/maven/co/paystack/android/paystack/1.2.0/paystack-1.2.0.pom'.
         > dl.bintray.com
      > Could not GET 'https://oss.sonatype.org/content/repositories/snapshots/co/paystack/android/paystack/1.2.0/paystack-1.2.0.pom'.
         > oss.sonatype.org

ionic v1: window.PaystackPlugin.chargeCard is not a function

Hi.

When i try to use the PlugIn, i get the error window.PaystackPlugin.chargeCard is not a function. When i do console.log(window.PaystackPlugin), it returns undefined. When i console.log(window), i dont see PaystackPlugin in the list.

Please help.

unable to install

Hello,

I tried to install through
cordova plugin add cordova-plugin-paystack
npm CLI,

It gives error
failed to fetch plugin github.com/dpa99c/cordova-custom-config.git via registry.
detailed error attached
errormessage

Phonegap build : No Public key found, please set the Public key

Hi,
Thanks for the wonderful work you've done with this Plugin.
I was getting a "No Public key found, please set the Public key" error response from my Android app built with Phonegap build using your plugin.
I also noticed that this type of error has been reported before.

I was able to solve the problem by using a "config-file" tag rather than a "custom-config-file" tag in the config. xml file.

ie I used this :

instead of this:

I thought this might help others.

Thanks.

Akintoye Emman Adegoke

Gettting [object Object] error

Hi,
i am new to cordova and its development. I am having an issue with window.PaystackPlugin.chargeCard, my app is throwing the error of charge failed:[object Object]

My Code:

/* my form object */
var orderObj = {
myemail: email,
amount: amt,
firstname: fname,
lastname: lname,
password: password
};

var posting = $.post( 'https://mysite.com/insert.php', orderObj );
posting.done(function(data) {
alert(data);
/* check result from the attempt */
payWithPaystack(data);
});

function payWithPaystack(data){
(
window.PaystackPlugin.chargeCard(
function(resp) {
// charge successful, grab transaction reference - do your thang!
console.log('charge successful: ', resp);
alert("charged:" + resp);
},
function(response) {
// Something went wrong, oops - perhaps an invalid card.
console.log('charge failed: ', resp);
alert("charge failed:" + resp)
},
{
cardNumber: '507850785078507812',
expiryMonth: '08',
expiryYear: '21',
cvc: '081',
email: '[email protected]',
amountInKobo: 90000,
});
alert(window.PaystackPlugin);
}

So the alert(window.PaystackPlugin); gives [object Object] error

Responding

This is not responding in my programme.

IOS Rejection based on UIWEBview - ITMS-90809: Deprecated API

IOS no longer supports this plugin based on the fact that the plugin still dwells in UIWebview instead of wkwebview.

If you are using this plugin apple will throw your app out in no time.

Existing applications in app store will no longer be served.

The rejection terms is:
ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs . See https://developer.apple.com/documentation/uikit/uiwebview for more information.

Well, they have already stopped accepting apps with UIWEbview and my app used this plugin and for that reason, it was rejected and existing app are already getting out of app store.

If your application uses wkwebview thats fine, but if you are using this plugin it will be rejected until this plugin is changes to use wkwebview.

Please help to get this work for me

Please, i have installed the plugin but stucked at the 'USAGE' aspect. Can you please help me out? I want to get the app to request for subscription fee before the app content could be seen. Better still, can i have your email?

I integrated your code in IONIC 4 mobile App but get error

Mr Tolu please assist me. I follow your steps on integrating paystack into ionic app.
But get error..."missing command error"...

I import InAppBrowser
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';

Then I included the same in app.module.ts provider

See the real code during the ChargeCard:

cardNumber: string='';
expiryMM:any='';
expiryYY:any='';
cvc:any='';

async ChargeCardAndSubmit(form:NgForm){

this.cardNumber = "4084084084084081";
this.expiryMM = 11;
this.expiryYY = 2018;
this.cvc = "408";
	
	const loading = await this.loader.create({spinner: "dots",message: "Processing Charge..."});
    await loading.present();
	
	await this.platform.ready().then(() => {
		if (this.platform.is('cordova')) {
			(<any>window).window.PaystackPlugin.chargeCard(
			  (resp)=>{
				loading.dismiss();
				console.log('charge successful: ', resp.reference);
				//this.api.postOrder(form).subscribe(res => {});
			  },(resp)=>{
				loading.dismiss();
				console.log('charge failed: '+this.cardNumber+", "+this.expiryMM+", "+this.expiryYY+", "+this.cvc+", "+resp);
			  },
			  {
				cardNumber: this.cardNumber, 
				expiryMonth: this.expiryMM, 
				expiryYear: this.expiryYY, 
				cvc: this.cvc,
				email: '[email protected]',
				amountInKobo: 150000
			});
		}else{
		this.api.ShowNotification("Payment plugins not supported on this device","danger");
		}
	});
}

fatal error: 'Paystack/Paystack.h' file not found

Am trying to use your plugin for ionic 2, but am getting this error when i try to build for ios
`
In file included from /Users/SpryPixels/Apps/realmv2/platforms/ios/ROG/Plugins/cordova-plugin-paystack/PaystackPlugin.m:3:
ROG/Plugins/cordova-plugin-paystack/PaystackPlugin.h:4:9: fatal error: 'Paystack/Paystack.h' file not found

import <Paystack/Paystack.h>

`

Card pin now compulsory

I was talking to a Paystack staff and they said pins are now compulsory. How does your plugin handle this?

Failed to fetch plugin

What am I missing?

Error: Failed to fetch plugin https://github.com/tolu360/cordova-plugin-paystack via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code 1
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b master https://github.com/tolu360/cordova-plugin-paystack.git /Users/iCozz/.npm/_cacache/tmp/git-clone-fefc557a
npm ERR! /Users/iCozz/.npm/_cacache/tmp/git-clone-fefc557a/.git: Permission denied
npm ERR!

I can git clone the repo but cannot cordova plugin add it. Other cordova adds are working.

HELP!!!

UPDATE

There was a dependency that was not automatically being resolved during the install. Had to invoke it explicitly before this worked.

Thanks

Publishable Key for Windows Platform

Hi.

So for setting publishable key for android, we use

<platform name="android"> ... <preference name="android-minSdkVersion" value="16" /> <config-file target="AndroidManifest.xml" parent="application"> <meta-data android:name="co.paystack.android.PublicKey" android:value="INSERT-PUBLIC-KEY-HERE"/> </config-file> </platform>

While that for iOS

<platform name="ios"> ... <preference name="publicKey" value="INSERT-PUBLIC-KEY-HERE" /> </platform>

How would be do it for Windows Platform?

Thanks

Build Failed while Building for IOS

Hi, i am experiencing an error while trying to run ionic application on device.
The app works on Android Device and IOS emulator but show this errors while trying to run on a real ios device

`
Ld /Users/mac/Library/Developer/Xcode/DerivedData/dataluk_health-
gvvuybmobfghkcelqspquthdffdj/Build/Products/Debug-iphoneos/dataluk\ health.app/dataluk\health
normal armv7

cd /Users/mac/Desktop/Dataluk2/platforms/ios

export IPHONEOS_DEPLOYMENT_TARGET=9.0

export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk -L/Users/mac/Library/Developer/Xcode/DerivedData/dataluk_health-gvvuybmobfghkcelqspquthdffdj/Build/Products/Debug-iphoneos -F/Users/mac/Library/Developer/Xcode/DerivedData/dataluk_health-gvvuybmobfghkcelqspquthdffdj/Build/Products/Debug-iphoneos -Fdataluk\ health/Plugins/cordova-plugin-paystack -filelist /Users/mac/Library/Developer/Xcode/DerivedData/dataluk_health-gvvuybmobfghkcelqspquthdffdj/Build/Intermediates.noindex/dataluk\ health.build/Debug-iphoneos/dataluk\ health.build/Objects-normal/armv7/dataluk\ health.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=9.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/mac/Library/Developer/Xcode/DerivedData/dataluk_health-gvvuybmobfghkcelqspquthdffdj/Build/Intermediates.noindex/dataluk\ health.build/Debug-iphoneos/dataluk\ health.build/Objects-normal/armv7/dataluk\ health_lto.o -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -ObjC /Users/mac/Library/Developer/Xcode/DerivedData/dataluk_health-gvvuybmobfghkcelqspquthdffdj/Build/Products/Debug-iphoneos/libCordova.a -lz -framework MessageUI -framework CoreLocation -weak_framework WebKit -framework SystemConfiguration -weak_framework AudioToolbox -weak_framework AVFoundation -weak-lsqlite3 -framework CoreTelephony -framework Paystack -Xlinker -dependency_info -Xlinker /Users/mac/Library/Developer/Xcode/DerivedData/dataluk_health-gvvuybmobfghkcelqspquthdffdj/Build/Intermediates.noindex/dataluk\ health.build/Debug-iphoneos/dataluk\ health.build/Objects-normal/armv7/dataluk\ health_dependency_info.dat -o /Users/mac/Library/Developer/Xcode/DerivedData/dataluk_health-gvvuybmobfghkcelqspquthdffdj/Build/Products/Debug-iphoneos/dataluk\ health.app/dataluk\ health



 ld: warning: ignoring file dataluk health/Plugins/cordova-plugin- 
 paystack/Paystack.framework/Paystack, file was built for x86_64 which is not the architecture being 
  linked (armv7): dataluk health/Plugins/cordova-plugin-paystack/Paystack.framework/Paystack

  Undefined symbols for architecture armv7:

  "_OBJC_CLASS_$_PSTCKTransactionParams", referenced from:

  objc-class-ref in PaystackPlugin.o

  "_OBJC_CLASS_$_PSTCKAPIClient", referenced from:

  objc-class-ref in PaystackPlugin.o

"_OBJC_CLASS_$_PSTCKCardParams", referenced from:

  objc-class-ref in PaystackPlugin.o

 "_OBJC_CLASS_$_PSTCKCardValidator", referenced from:

  objc-class-ref in PaystackPlugin.o

   "_OBJC_CLASS_$_Paystack", referenced from:

  objc-class-ref in PaystackPlugin.o

  (maybe you meant: _OBJC_CLASS_$_PaystackPlugin)

  ld: symbol(s) not found for architecture armv7

  clang: error: linker command failed with exit code 1 (use -v to see invocation)

`

iOS Build fails

When building the Ionic App in Xcode it throws an error:
Lexical or Preprocessor Issue
PayStack/PayStack.h file not found PaystackPlugin.h

Archiving iOS app for distribution fails

Hello Tolu,

Well done for this plugin . The plugin worked well on simulators but when I tried to build my product for production on iOS it gives me this error.

ld: warning: ignoring file Stash.ng/Plugins/cordova-plugin-paystack/Paystack.framework/Paystack, file was built for x86_64 which is not the architecture being linked (armv7): Stash.ng/Plugins/cordova-plugin-paystack/Paystack.framework/Paystack
Undefined symbols for architecture armv7:
"OBJC_CLASS$_PSTCKTransactionParams", referenced from:
objc-class-ref in PaystackPlugin.o
"OBJC_CLASS$_PSTCKAPIClient", referenced from:
objc-class-ref in PaystackPlugin.o
"OBJC_CLASS$_PSTCKCardParams", referenced from:
objc-class-ref in PaystackPlugin.o
"OBJC_CLASS$_PSTCKCardValidator", referenced from:
objc-class-ref in PaystackPlugin.o
"OBJC_CLASS$_Paystack", referenced from:
objc-class-ref in PaystackPlugin.o
(maybe you meant: OBJC_CLASS$_PaystackPlugin)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Kindly help look into this.

Thanks

Missing Command Error

Hello Tolu, after installing the paystack plugin via phonegap CLI, i get a "Missing Command Error" Statement. Help!!!

Build not successful after installing of plugin

hello please i get this error message when i tried to build my app after the installation of the plugin

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:processDebugResources'.

Failed to execute aapt

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1m 23s
(node:11492) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Error with PublishableKey

This is my config.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget xmlns:android="http://schemas.android.com/apk/res/android" id="ng.push.userapp" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

  <name>MyApp</name>
  <description>
      Info
  </description>
  <author email="" href="">

  </author>
  <content src="index.html"/>
  <access origin="*"/>
  <preference name="webviewbounce" value="false"/>
  <preference name="UIWebViewBounce" value="false"/>
  <preference name="DisallowOverscroll" value="true"/>
  <preference name="android-minSdkVersion" value="16"/>
  <preference name="BackupWebStorage" value="none"/>
  <preference name="SplashScreen" value="screen"/>
  <preference name="SplashScreenDelay" value="5000"/>
  <preference name="ShowSplashScreenSpinner" value="false" />
  <config-file target="AndroidManifest.xml" parent="application">
    <meta-data android:name="co.paystack.android.PublishableKey" android:value="my key"/>
  </config-file>
  <preference name="publishableKey" value="my key" />
  <feature name="StatusBar">
    <param name="ios-package" value="CDVStatusBar" onload="true"/>
  </feature>
</widget>

I am getting this error when I tried to use paystack

05-19 14:20:14.010: E/PaystackPlugin(3195): No Publishable key found, please set the Publishable key.
05-19 14:20:14.010: W/CordovaPlugin(3195): Attempted to send a second callback for ID: PaystackPlugin1003071714
05-19 14:20:14.010: W/CordovaPlugin(3195): Result was: "Invalid action"

My Code

//NEW CARD
    $scope.cardDetails = {}
    $scope.newCard = function(){
      window.PaystackPlugin.getToken(
        function(resp) {
          // A valid one-timme-use token is obtained, do your thang!
          console.log('Paystack success: ', JSON.stringify(resp));
          //$scope.listCards()
        },
        function(resp) {
          // Something went wrong, oops - perhaps an invalid card.
          console.log('Paystack failure: ', JSON.stringify(resp));
        },
        $scope.cardDetails.number,
        $scope.cardDetails.month.getMonth(),
        $scope.cardDetails.month.getFullYear(),
        $scope.cardDetails.cvv);
    }

Build is failing with latest paystack adroid library

The latest Paystack library seems to be targeting Android API 24, which is affecting ionic build which targets API 22

C:\Users\Damilare\PUSH\mobileapp\platforms\android\build\intermediates\res\debug\values-v23\values.xml:6: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'. FAILED

BUILD FAILED

Total time: 59.763 secs


C:\Users\Damilare\PUSH\mobileapp\platforms\android\build\intermediates\res\debug\values-v23\values.xml:36: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
        C:\Android\android-sdk\build-tools\24.0.3\aapt.exe package -f --no-crunch -I C:\Android\android-sdk\platforms\android-22\android.jar -M C:\Users\Damilare\PUSH\mobileapp\platforms\android\build\intermediates\manifests\full\debug\AndroidManifest.xml -S C:\Users\Damilare\PUSH\mobileapp\platforms\android\build\intermediates\res\debug -A C:\Users\Damilare\PUSH\mobileapp\platforms\android\build\intermediates\assets\debug -m -J C:\Users\Damilare\PUSH\mobileapp\platforms\android\build\generated\source\r\debug -F C:\Users\Damilare\PUSH\mobileapp\platforms\android\build\intermediates\res\resources-debug.ap_ --debug-mode --custom-package ng.push.userapp -0 apk --output-text-symbols C:\Users\Damilare\PUSH\mobileapp\platforms\android\build\intermediates\symbols\debug
Error Code:
        1
Output:
        C:\Users\Damilare\PUSH\mobileapp\platforms\android\build\intermediates\res\debug\values-v23\values.xml:6: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.

        C:\Users\Damilare\PUSH\mobileapp\platforms\android\build\intermediates\res\debug\values-v23\values.xml:36: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.



* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

C:\Users\Damilare\PUSH\mobileapp\platforms\android\cordova\node_modules\q\q.js:126
                    throw e;
                    ^
Error code 1 for command: cmd with args: /s /c "C:\Users\Damilare\PUSH\mobileapp\platforms\android\gradlew cdvBuildDebug -b C:\Users\Damilare\PUSH\mobileapp\platforms\android\build.gradle -Dorg.gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
    at ChildProcess.whenDone (C:\Users\Damilare\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:139:23)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:818:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

Error Building Application With Plugin

Hi. I have this issue when building with your plugin:

MSBUILD : cordova-build error : FAILURE: Build failed with an exception.
1>  FAILURE: Build failed with an exception.
1>
1>MSBUILD : cordova-build error : * What went wrong:
1>  * What went wrong:
1>MSBUILD : cordova-build error : A problem occurred configuring root project 'android'.
1>  A problem occurred configuring root project 'android'.
1>MSBUILD : cordova-build error : > Could not resolve all dependencies for configuration ':_debugCompile'.
1>  > Could not resolve all dependencies for configuration ':_debugCompile'.
1>MSBUILD : cordova-build error :  > Could not find co.paystack.android:paystack:2.1.2.
1>     > Could not find co.paystack.android:paystack:2.1.2.
1>MSBUILD : cordova-build error :  Searched in the following locations:
1>       Searched in the following locations:
1>MSBUILD : cordova-build error :  https://repo1.maven.org/maven2/co/paystack/android/paystack/2.1.2/paystack-2.1.2.pom
1>           https://repo1.maven.org/maven2/co/paystack/android/paystack/2.1.2/paystack-2.1.2.pom
1>MSBUILD : cordova-build error :  https://repo1.maven.org/maven2/co/paystack/android/paystack/2.1.2/paystack-2.1.2.jar
1>           https://repo1.maven.org/maven2/co/paystack/android/paystack/2.1.2/paystack-2.1.2.jar
1>MSBUILD : cordova-build error :  file:/C:/Program Files (x86)/Android/android-sdk/extras/android/m2repository/co/paystack/android/paystack/2.1.2/paystack-2.1.2.pom
1>           file:/C:/Program Files (x86)/Android/android-sdk/extras/android/m2repository/co/paystack/android/paystack/2.1.2/paystack-2.1.2.pom
1>
1>  BUILD FAILED
1>
1>  Total time: 5.498 secs
1>MSBUILD : cordova-build error :  file:/C:/Program Files (x86)/Android/android-sdk/extras/android/m2repository/co/paystack/android/paystack/2.1.2/paystack-2.1.2.jar
1>           file:/C:/Program Files (x86)/Android/android-sdk/extras/android/m2repository/co/paystack/android/paystack/2.1.2/paystack-2.1.2.jar
1>MSBUILD : cordova-build error :  file:/C:/Program Files (x86)/Android/android-sdk/extras/google/m2repository/co/paystack/android/paystack/2.1.2/paystack-2.1.2.pom
1>           file:/C:/Program Files (x86)/Android/android-sdk/extras/google/m2repository/co/paystack/android/paystack/2.1.2/paystack-2.1.2.pom
1>MSBUILD : cordova-build error :  file:/C:/Program Files (x86)/Android/android-sdk/extras/google/m2repository/co/paystack/android/paystack/2.1.2/paystack-2.1.2.jar
1>           file:/C:/Program Files (x86)/Android/android-sdk/extras/google/m2repository/co/paystack/android/paystack/2.1.2/paystack-2.1.2.jar
1>MSBUILD : cordova-build error :  Required by:
1>       Required by:
1>MSBUILD : cordova-build error :  :android:unspecified
1>           :android:unspecified
1>

Any help would be deeply appreciated.

NB: Issue started yesterday. #MissionCritical

Update dependency

The dependency cordova-custom-config version 5.0.2 used in this project failed in latest cordova (version 8 and 9 for me). Please update this plugin to use cordova-custom-config version >= 5.1.0

Typescript Error Property 'PaystackPlugin' does not exist on type 'Window'.

I followed the instruction in your article in an attempt to implement paystack payment integration with my app, but I got the following error message, what do you think could be wrong

Typescript Error
Property 'PaystackPlugin' does not exist on type 'Window'.
C:/Projects/WorkMan/src/pages/paystack/paystack.ts
  
window.PaystackPlugin.chargeCard(
      function(resp) {

thank you in advance

Gettting Cannot read property 'chargeCard' of undefined

Hi i am new to cordova and its development, i am making use of jquery mobile for the UI of the app, so the app is pure cordova not phonegap, i am having an issue with chargeCard function, my app is throwing the error of undefined, even when i test it on my device it doesn't run

Below is:

  1. my config.xml
  2. my custom.js file where i run all my js code

config.xml

<?xml version='1.0' encoding='utf-8'?>
<widget version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>mmmmm</name>
<description>
********************
</description>
<content src="_index.html" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<preference name="android-minSdkVersion" value="16" />
<custom-config-file parent="application" target="AndroidManifest.xml">
<meta-data android:name="co.paystack.android.PublicKey" android:value="pk_test_71bbb7d732c9366fba109" />
</custom-config-file>
</platform>
<preference name="Orientation" value="portrait" />
<preference name="SetFullscreen" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="Fullscreen" value="false" />
<preference name="HideKeyboardFormAccessoryBar" value="true" />
<preference name="KeepRunning" value="true" />
<preference name="LoadUrlTimeoutValue" value="10000" />
<preference name="InAppBrowserStorageEnabled" value="true" />
<preference name="ErrorUrl" value="myErrorPage.html" />
<preference name="ShowTitle" value="true" />
<preference name="LogLevel" value="VERBOSE" />
<preference name="AndroidLaunchMode" value="singleTop" />
<preference name="DefaultVolumeStream" value="call" />
<preference name="OverrideUserAgent" value="Mozilla/5.0 My Browser" />
<preference name="AppendUserAgent" value="My Browser" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="1000" />
<plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
<platform name="android">
<preference name="android-minSdkVersion" value="16" />
<custom-config-file parent="application" target="AndroidManifest.xml">
<meta-data android:name="co.paystack.android.PublicKey" android:value="pk_test_71bbb7d732c9366fba109" />
</custom-config-file>
</platform>
<feature name="PaystackPlugin">
<param name="android-package" value="com.arttitude360.cordova.PaystackPlugin" />
</feature>
<plugin name="cordova-plugin-paystack" spec="^3.2.0" />
<engine name="android" spec="^7.1.4" />
</widget>

custom.js

$(window).on('load',function(){
$('.loader-main').addClass('loader-inactive');
});

$(document).ready(function(){
'use strict'

function init_template(){
$("#paymentform").submit(function(e){
e.preventDefault();
// Now safe to use device APIs
console.log(window.PaystackPlugin)
window.PaystackPlugin.chargeCard(
function(resp) {
// charge successful, grab transaction reference - do your thang!
console.log('charge successful: ', resp);
alert("charged:"+resp)
},
function(resp) {
// Something went wrong, oops - perhaps an invalid card.
console.log('charge failed: ', resp);
alert("not charged"+resp)
},
{
cardNumber: '4123450131001381',
expiryMonth: '10',
expiryYear: '17',
cvc: '883',
email: '[email protected]',
amountInKobo: 150000,
subAccount: 'ACCT_pz61jjjsslnx1d9',
});
})
}
}

i would appreciate your rapid response to my newly raised issue, thank you very much in advance.

Update Plugin

Hi,
Nice work on this plugin. I am currently making use of this it in a project. However, the paystack guys says the plugin needs to be updated for it to work properly.

Please a lot depends on it.

Kindly look into this and help bring it up to date. Would not mind helping out if possible.

code not compatable with ionic4/5

Please I have an issue integrating the Paystack code in ionic 4/5, I believe this is due to the latest updates in ionic 4/ 5, and most of the syntax has really changed. Please I will grateful if the payment integration code can be updated to ionic4/5 thanks.

No Public key found, please set the Public key

Please help me, i'm getting the response "No Public key found, please set the Public key" from cordova-plugin-paystack...i'm using a test mode Public key. I'll appreciate any idea of how to make it work successfully.

Thanks.

OTP not sent to email

After implementing this plugin and charging a card, otp gets sent to only phone number provided to charge card function, can the otp be sent to the users email because users may not get otp on their phone due to several reasons.

BUILD FAILED on ":processDebugManifest"

I have successfully installed the plugin but it always fail on build with the attached image.
I have tried adding 'tools:replace="android:value"' to element at AndroidManifest.xml as suggested but it comes with another error that its not bound.

What could be the issue here?

paystack_error

Feature request for payment instrument tokenizing

There isn't any functionality to add a card without the user having to make a payment. This is extremely useful where the user already has a card used in making a previous payment, but would like to change it before making another payment.

Essentially, what I am asking is a means to tokenize a card from the plugin using the provided Paystack endpoint available here. This would be a good replacement for PaystackPlugin.getToken() which has been removed. Attempting to collect user card details then using the endpoint from a server or mobile app is a security risk, and sensitive information can be given away.

Paystack not building for android platform

I am trying to implement paystack to an android app, But there seems to be an issue with the plugin, Everytime I build the plugin make the build to fail for android

Installing "cordova-plugin-paystack" for android
Failed to install 'cordova-plugin-paystack': Error
at C:\Users\Admin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\fetch.js:205:33
at rejected (C:\Users\Admin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:864:24)
at C:\Users\Admin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:890:30
at Promise.when (C:\Users\Admin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:1142:31)
at Promise.promise.promiseDispatch (C:\Users\Admin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:808:41)
at C:\Users\Admin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:624:44
at runSingle (C:\Users\Admin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:137:13)
at flush (C:\Users\Admin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:125:13)
at combinedTickCallback (internal/process/next_tick.js:73:7)
at process.tickCallback (internal/process/next_tick.js:104:9)
Error: Failed to fetch plugin https://github.com/dpa99c/cordova-custom-config.git via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: cmd: Command failed with exit code 1 Error output:
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:205:12)
npm WARN addRemoteGit at emitTwo (events.js:106:13)
npm WARN addRemoteGit at ChildProcess.emit (events.js:194:7)
npm WARN addRemoteGit at maybeClose (internal/child_process.js:899:16)
npm WARN addRemoteGit at Socket. (internal/child_process.js:342:11)
npm WARN addRemoteGit at emitOne (events.js:96:13)
npm WARN addRemoteGit at Socket.emit (events.js:191:7)
npm WARN addRemoteGit at Pipe.handle.close [as onclose] (net.js:509:12)
npm WARN addRemoteGit git+https://github.com/dpa99c/cordova-custom-config.git resetting remote C:\Users\Admin\AppData\Roaming\npm-cache_git-remotes\git-https-github-com-dpa99c-cordova-custom-config-git-4785388d because of error: { Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:205:12)
npm WARN addRemoteGit at emitTwo (events.js:106:13)
npm WARN addRemoteGit at ChildProcess.emit (events.js:194:7)
npm WARN addRemoteGit at maybeClose (internal/child_process.js:899:16)
npm WARN addRemoteGit at Socket. (internal/child_process.js:342:11)
npm WARN addRemoteGit at emitOne (events.js:96:13)
npm WARN addRemoteGit at Socket.emit (events.js:191:7)
npm WARN addRemoteGit at Pipe.handle.close [as _onclose] (net.js:509:12)
npm WARN addRemoteGit killed: false,
npm WARN addRemoteGit code: 1,
npm WARN addRemoteGit signal: null,
npm WARN addRemoteGit cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
npm ERR! git clone C:\Users\Admin\AppData\Roaming\npm-cache_git-remotes\git-https-github-com-dpa99c-cordova-custom-config-git-4785388d C:\Users\Admin\AppData\Local\Temp\npm-9688-a6fff09d\git-cache-a438f990\b4d017dc5ff057dcb828e9e4ea8e1dcd9dfd261b: Cloning into 'C:\Users\Admin\AppData\Local\Temp\npm-9688-a6fff09d\git-cache-a438f990\b4d017dc5ff057dcb828e9e4ea8e1dcd9dfd261b'...
npm ERR! git clone C:\Users\Admin\AppData\Roaming\npm-cache_git-remotes\git-https-github-com-dpa99c-cordova-custom-config-git-4785388d C:\Users\Admin\AppData\Local\Temp\npm-9688-a6fff09d\git-cache-a438f990\b4d017dc5ff057dcb828e9e4ea8e1dcd9dfd261b: error: cannot spawn sh: No such file or directory
npm ERR! git clone C:\Users\Admin\AppData\Roaming\npm-cache_git-remotes\git-https-github-com-dpa99c-cordova-custom-config-git-4785388d C:\Users\Admin\AppData\Local\Temp\npm-9688-a6fff09d\git-cache-a438f990\b4d017dc5ff057dcb828e9e4ea8e1dcd9dfd261b: fatal: unable to fork
npm ERR! git clone C:\Users\Admin\AppData\Roaming\npm-cache_git-remotes\git-https-github-com-dpa99c-cordova-custom-config-git-4785388d C:\Users\Admin\AppData\Local\Temp\npm-9688-a6fff09d\git-cache-a438f990\b4d017dc5ff057dcb828e9e4ea8e1dcd9dfd261b:
npm ERR! Windows_NT 10.0.16299
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "https://github.com/dpa99c/cordova-custom-config.git" "--save"
npm ERR! node v7.8.0
npm ERR! npm v4.2.0
npm ERR! code 128

npm ERR! Command failed: git -c core.longpaths=true clone C:\Users\Admin\AppData\Roaming\npm-cache_git-remotes\git-https-github-com-dpa99c-cordova-custom-config-git-4785388d C:\Users\Admin\AppData\Local\Temp\npm-9688-a6fff09d\git-cache-a438f990\b4d017dc5ff057dcb828e9e4ea8e1dcd9dfd261b
npm ERR! Cloning into 'C:\Users\Admin\AppData\Local\Temp\npm-9688-a6fff09d\git-cache-a438f990\b4d017dc5ff057dcb828e9e4ea8e1dcd9dfd261b'...
npm ERR! error: cannot spawn sh: No such file or directory
npm ERR! fatal: unable to fork
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Admin\AppData\Roaming\npm-cache_logs\2018-04-09T08_26_48_942Z-debug.log
[ERROR] Exception:

Please out..

Paystack Plugin Usage

Please, i have installed the plugin but stucked at the 'USAGE' aspect. Can you please help me out? I want to get the app to request for subscription fee before the app content could be seen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.