Need help upgrading to Ionic Framework 4.0? Get assistance with our Enterprise Migration Services EXPLORE NOW

Alipay

Improve this doc

This plugin facilitates the usage of Alipay 支付宝 in an Ionic apps with the integrated AlipaySDK dated on 20180601.

Requires Cordova plugin: cordova-plugin-gubnoi-alipay. For more info, please see https://github.com/jing-zhou/cordova-plugin-alipay .

Repo: https://github.com/jing-zhou/cordova-plugin-alipay

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add cordova-plugin-gubnoi-alipay --variable APP_ID=your_app_id
    $ npm install --save @ionic-native/alipay@4
    
  2. Add this plugin to your app's module

Supported platforms

Usage

import { Alipay } from '@ionic-native/alipay';

constructor(private alipay: Alipay) {

//alipayOrder is a string that has been generated and signed by the server side.
this.alipay.pay(alipayOrder)
   .then(result => {
      console.log(result); // Success
   })
   .catch(error => {
      console.log(error); // Failed
   });

}

Instance Members

pay(order)

Open Alipay to perform App pay

Param Type Details
order string

alipay order string

Returns: Promise<any> Returns a Promise that resolves with the success return, or rejects with an error.

API

Native

General