mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 08:32:52 +08:00
docs(apple-pay): typos
This commit is contained in:
parent
2e07a7c04e
commit
c26735f366
@ -1,17 +1,32 @@
|
|||||||
import {Injectable} from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {Observable} from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import {
|
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||||
Plugin,
|
|
||||||
Cordova,
|
|
||||||
IonicNativePlugin
|
|
||||||
} from '@ionic-native/core';
|
|
||||||
|
|
||||||
export type IMakePayments = 'This device can make payments and has a supported card' | 'This device cannot make payments.' | 'This device can make payments but has no supported cards';
|
export type IMakePayments =
|
||||||
|
| 'This device can make payments and has a supported card'
|
||||||
|
| 'This device cannot make payments.'
|
||||||
|
| 'This device can make payments but has no supported cards';
|
||||||
export type IShippingType = 'shipping' | 'delivery' | 'store' | 'service';
|
export type IShippingType = 'shipping' | 'delivery' | 'store' | 'service';
|
||||||
export type IBillingRequirement = 'none' | 'all' | 'postcode' | 'name' | 'email' | 'phone';
|
export type IBillingRequirement =
|
||||||
export type ITransactionStatus = 'success' | 'failure' | 'invalid-billing-address' | 'invalid-shipping-address' | 'invalid-shipping-contact' | 'require-pin' | 'incorrect-pin' | 'locked-pin';
|
| 'none'
|
||||||
|
| 'all'
|
||||||
|
| 'postcode'
|
||||||
|
| 'name'
|
||||||
|
| 'email'
|
||||||
|
| 'phone';
|
||||||
|
export type ITransactionStatus =
|
||||||
|
| 'success'
|
||||||
|
| 'failure'
|
||||||
|
| 'invalid-billing-address'
|
||||||
|
| 'invalid-shipping-address'
|
||||||
|
| 'invalid-shipping-contact'
|
||||||
|
| 'require-pin'
|
||||||
|
| 'incorrect-pin'
|
||||||
|
| 'locked-pin';
|
||||||
export type ICompleteTransaction = 'Payment status applied.';
|
export type ICompleteTransaction = 'Payment status applied.';
|
||||||
export type IUpdateItemsAndShippingStatus = 'Updated List Info' | 'Did you make a payment request?';
|
export type IUpdateItemsAndShippingStatus =
|
||||||
|
| 'Updated List Info'
|
||||||
|
| 'Did you make a payment request?';
|
||||||
|
|
||||||
export interface IPaymentResponse {
|
export interface IPaymentResponse {
|
||||||
billingNameFirst?: string;
|
billingNameFirst?: string;
|
||||||
@ -50,7 +65,7 @@ export interface IOrderItem {
|
|||||||
label: string;
|
label: string;
|
||||||
amount: number;
|
amount: number;
|
||||||
}
|
}
|
||||||
export interface IShippingMethod {
|
export interface IShippingMethod {
|
||||||
identifier: string;
|
identifier: string;
|
||||||
label: string;
|
label: string;
|
||||||
detail: string;
|
detail: string;
|
||||||
@ -135,11 +150,10 @@ export interface ISelectedShippingContact {
|
|||||||
plugin: 'cordova-plugin-applepay',
|
plugin: 'cordova-plugin-applepay',
|
||||||
pluginRef: 'ApplePay',
|
pluginRef: 'ApplePay',
|
||||||
repo: 'https://github.com/samkelleher/cordova-plugin-applepay',
|
repo: 'https://github.com/samkelleher/cordova-plugin-applepay',
|
||||||
platforms: ['iOS'],
|
platforms: ['iOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ApplePay extends IonicNativePlugin {
|
export class ApplePay extends IonicNativePlugin {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detects if the current device supports Apple Pay and has any capable cards registered.
|
* Detects if the current device supports Apple Pay and has any capable cards registered.
|
||||||
* @return {Promise<IMakePayments>} Returns a promise
|
* @return {Promise<IMakePayments>} Returns a promise
|
||||||
@ -174,7 +188,9 @@ export class ApplePay extends IonicNativePlugin {
|
|||||||
observable: true,
|
observable: true,
|
||||||
clearFunction: 'stopListeningForShippingContactSelection'
|
clearFunction: 'stopListeningForShippingContactSelection'
|
||||||
})
|
})
|
||||||
startListeningForShippingContactSelection(): Observable<ISelectedShippingContact> {
|
startListeningForShippingContactSelection(): Observable<
|
||||||
|
ISelectedShippingContact
|
||||||
|
> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,9 +212,9 @@ export class ApplePay extends IonicNativePlugin {
|
|||||||
* any shipping contact selection event or else the user will not be able
|
* any shipping contact selection event or else the user will not be able
|
||||||
* to complete a transaction on the pay sheet. Do not call without
|
* to complete a transaction on the pay sheet. Do not call without
|
||||||
* subscribing to shipping contact selection events first
|
* subscribing to shipping contact selection events first
|
||||||
* @returns {Promise}
|
|
||||||
*
|
*
|
||||||
* @param {Object} including `items` and `shippingMethods` properties.
|
* @param {IOrderItemsAndShippingMethods} list `items` and `shippingMethods` properties.
|
||||||
|
* @returns {Promise<IUpdateItemsAndShippingStatus>}
|
||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
* this.applePay.startListeningForShippingContactSelection().pluck('shippingAddressState').subscribe(shippingAddressState => {
|
* this.applePay.startListeningForShippingContactSelection().pluck('shippingAddressState').subscribe(shippingAddressState => {
|
||||||
@ -228,15 +244,17 @@ export class ApplePay extends IonicNativePlugin {
|
|||||||
@Cordova({
|
@Cordova({
|
||||||
otherPromise: true
|
otherPromise: true
|
||||||
})
|
})
|
||||||
updateItemsAndShippingMethods(list: IOrderItemsAndShippingMethods): Promise<IUpdateItemsAndShippingStatus> {
|
updateItemsAndShippingMethods(
|
||||||
|
list: IOrderItemsAndShippingMethods
|
||||||
|
): Promise<IUpdateItemsAndShippingStatus> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Request a payment with Apple Pay
|
* Request a payment with Apple Pay
|
||||||
* @return {Promise<IPaymentResponse>} Returns a promise that resolves when something happens
|
|
||||||
*
|
*
|
||||||
* @param order {IOrder}
|
* @param {IOrder} order
|
||||||
|
* @return {Promise<IPaymentResponse>} Returns a promise that resolves when something happens
|
||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
* try {
|
* try {
|
||||||
@ -311,17 +329,19 @@ export class ApplePay extends IonicNativePlugin {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Once the makePaymentRequest has been resolved successfully, the device will be waiting for a completion event.
|
* Once the makePaymentRequest has been resolved successfully, the device will be waiting for a completion event.
|
||||||
* This means, that the application must proceed with the token authorisation and return a success, failure,
|
* This means, that the application must proceed with the token authorization and return a success, failure,
|
||||||
* or other validation error. Once this has been passed back, the Apple Pay sheet will be dismissed via an animation.
|
* or other validation error. Once this has been passed back, the Apple Pay sheet will be dismissed via an animation.
|
||||||
* @return {Promise<ICompleteTransaction>} Returns a promise that resolves after confirmation of payment authorization completion
|
|
||||||
*
|
*
|
||||||
* @param complete {ITransactionStatus}
|
* @param {ITransactionStatus} complete
|
||||||
|
* @return {Promise<ICompleteTransaction>} Returns a promise that resolves after confirmation of payment authorization completion
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
otherPromise: true
|
otherPromise: true
|
||||||
})
|
})
|
||||||
completeLastTransaction(complete: ITransactionStatus): Promise<ICompleteTransaction> {
|
completeLastTransaction(
|
||||||
|
complete: ITransactionStatus
|
||||||
|
): Promise<ICompleteTransaction> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user