Skip to content

Commit

Permalink
fix(alipay): adjust pay function properties (#3197)
Browse files Browse the repository at this point in the history
* fix bug 'Success is not a function #158'
terikon/cordova-plugin-photo-library#158

* alipay: add optional success, error callback
for pay()  method
  • Loading branch information
jing-zhou authored and danielsogl committed Oct 18, 2019
1 parent 7033a18 commit fb5d47b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/@ionic-native/plugins/alipay/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
* constructor(private alipay: Alipay) {
*
* //alipayOrder is a string that has been generated and signed by the server side.
* this.alipay.pay(alipayOrder)
* this.alipay.pay(alipayOrder, success, error)
* .then(result => {
* console.log(result); // Success
* })
Expand Down Expand Up @@ -44,7 +44,7 @@ export class Alipay extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with the success return, or rejects with an error.
*/
@Cordova()
pay(order: string): Promise<any> {
pay(order: string, success?: (res?: any) => void, error?: (err?: any) => void): Promise<any> {
return;
}
}
2 changes: 1 addition & 1 deletion src/@ionic-native/plugins/photo-library/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class PhotoLibrary extends IonicNativePlugin {
@Cordova({
observable: true
})
getLibrary(options?: GetLibraryOptions): Observable<LibraryItem[]> {
getLibrary(success?: (res?: any) => void, error?: (err?: any) => void, options?: GetLibraryOptions): Observable<LibraryItem[]> {
return;
}

Expand Down

0 comments on commit fb5d47b

Please sign in to comment.