mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 08:43:01 +08:00
feat(shop-checkout): add plugin (#3337)
* feat(plugin): ShopCheckout * Add typings for returned promises
This commit is contained in:
parent
d2d5a5a96c
commit
83196bc947
80
src/@ionic-native/plugins/shop-checkout/index.ts
Normal file
80
src/@ionic-native/plugins/shop-checkout/index.ts
Normal file
@ -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<void>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
registerAgent(options: any): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Open products view
|
||||
* @param options {any} Options
|
||||
* @return {Promise<void>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
openProducts(options: any): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Open trannsactions view
|
||||
* @param options {any} Options
|
||||
* @return {Promise<void>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
openTransactions(options: any): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return {Promise<void>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
logout(options: any): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Promise<boolean>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
isInitialized(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user