Skip to content

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

Description

@gfavour

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: 'chargeIOS@master.dev',
				amountInKobo: 150000
			});
		}else{
		this.api.ShowNotification("Payment plugins not supported on this device","danger");
		}
	});
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions