From 83196bc947f18f1c3ffd7f7b6ad4431e05516527 Mon Sep 17 00:00:00 2001 From: Onyemaechi Okafor Date: Wed, 15 Apr 2020 20:33:06 +0100 Subject: [PATCH] feat(shop-checkout): add plugin (#3337) * feat(plugin): ShopCheckout * Add typings for returned promises --- .../plugins/shop-checkout/index.ts | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 src/@ionic-native/plugins/shop-checkout/index.ts diff --git a/src/@ionic-native/plugins/shop-checkout/index.ts b/src/@ionic-native/plugins/shop-checkout/index.ts new file mode 100644 index 000000000..bff260dd9 --- /dev/null +++ b/src/@ionic-native/plugins/shop-checkout/index.ts @@ -0,0 +1,80 @@ +import { Injectable } from '@angular/core'; +import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; + +/** + * @name ShopCheckout + * @description + * This is a plugin that allows your Ionic app to use ShopChecout for Android. + * Follow the offical documentation to setup this plugin correctly: https://developer.shoptopup.com/docs/shoptopup-for-cordovaphonegap + * + * @usage + * ```typescript + * import { ShopCheckout } from '@ionic-native/shop-checkout/ngx'; + * + * + * constructor(private shopCheckout: ShopCheckout) { } + * + * ... + * + * this.shopCheckout.registerAgent(); + * ... + * this.shopCheckout.openProducts(); + * + * ``` + */ +@Plugin({ + pluginName: 'ShopCheckout', + plugin: 'cordova-plugin-shop-checkout', + pluginRef: 'shopCheckout', + repo: 'https://github.com/tradedepot/cordova-shop-checkout', + platforms: ['Android'] +}) +@Injectable() +export class ShopCheckout extends IonicNativePlugin { + /** + * Register an agent + * @param options {any} Options + * @return {Promise} Returns a promise + */ + @Cordova() + registerAgent(options: any): Promise { + return; + } + + /** + * Open products view + * @param options {any} Options + * @return {Promise} Returns a promise + */ + @Cordova() + openProducts(options: any): Promise { + return; + } + + /** + * Open trannsactions view + * @param options {any} Options + * @return {Promise} Returns a promise + */ + @Cordova() + openTransactions(options: any): Promise { + return; + } + + + /** + * @return {Promise} Returns a promise + */ + @Cordova() + logout(options: any): Promise { + return; + } + + /** + * @return {Promise} Returns a promise + */ + @Cordova() + isInitialized(): Promise { + return; + } +}