Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/applepayjs

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/applepayjs - npm Package Compare versions

Comparing version 3.0.4 to 14.0.0

383

applepayjs/index.d.ts

@@ -1,2 +0,2 @@

// Type definitions for Apple Pay JS 3.0
// Type definitions for Apple Pay JS 14.0
// Project: https://developer.apple.com/reference/applepayjs

@@ -12,3 +12,3 @@ // Definitions by: Martin Costello <https://github.com/martincostello>

* The entry point for Apple Pay on the web.
* @param version - The version number of the ApplePay JS API you are using. The current API version number is 3.
* @param version - The version number of the ApplePay JS API you are using. The current API version number is 14.
* @param paymentRequest - An ApplePayPaymentRequest object that contains the information to be displayed on the Apple Pay payment sheet.

@@ -103,3 +103,6 @@ */

*/
completePaymentMethodSelection(newTotal: ApplePayJS.ApplePayLineItem, newLineItems: ApplePayJS.ApplePayLineItem[]): void;
completePaymentMethodSelection(
newTotal: ApplePayJS.ApplePayLineItem,
newLineItems: ApplePayJS.ApplePayLineItem[],
): void;

@@ -123,3 +126,4 @@ /**

newTotal: ApplePayJS.ApplePayLineItem,
newLineItems: ApplePayJS.ApplePayLineItem[]): void;
newLineItems: ApplePayJS.ApplePayLineItem[],
): void;

@@ -138,3 +142,7 @@ /**

*/
completeShippingMethodSelection(status: number, newTotal: ApplePayJS.ApplePayLineItem, newLineItems: ApplePayJS.ApplePayLineItem[]): void;
completeShippingMethodSelection(
status: number,
newTotal: ApplePayJS.ApplePayLineItem,
newLineItems: ApplePayJS.ApplePayLineItem[],
): void;

@@ -199,3 +207,7 @@ /**

*/
constructor(errorCode: ApplePayJS.ApplePayErrorCode, contactField?: ApplePayJS.ApplePayErrorContactField, message?: string);
constructor(
errorCode: ApplePayJS.ApplePayErrorCode,
contactField?: ApplePayJS.ApplePayErrorContactField,
message?: string,
);

@@ -222,8 +234,3 @@ /**

*/
type ApplePayContactField =
'email' |
'name' |
'phone' |
'postalAddress' |
'phoneticName';
type ApplePayContactField = 'email' | 'name' | 'phone' | 'postalAddress' | 'phoneticName';

@@ -257,3 +264,3 @@ /**

*/
'shippingContactInvalid' |
| 'shippingContactInvalid'

@@ -263,3 +270,3 @@ /**

*/
'billingContactInvalid' |
| 'billingContactInvalid'

@@ -269,3 +276,3 @@ /**

*/
'addressUnserviceable' |
| 'addressUnserviceable'

@@ -275,3 +282,3 @@ /**

*/
'unknown';
| 'unknown';

@@ -282,15 +289,15 @@ /**

type ApplePayErrorContactField =
'phoneNumber' |
'emailAddress' |
'name' |
'phoneticName' |
'postalAddress' |
'addressLines' |
'locality' |
'subLocality' |
'postalCode' |
'administrativeArea' |
'subAdministrativeArea' |
'country' |
'countryCode';
| 'phoneNumber'
| 'emailAddress'
| 'name'
| 'phoneticName'
| 'postalAddress'
| 'addressLines'
| 'locality'
| 'subLocality'
| 'postalCode'
| 'administrativeArea'
| 'subAdministrativeArea'
| 'country'
| 'countryCode';

@@ -315,5 +322,87 @@ /**

type?: ApplePayLineItemType | undefined;
/**
* The time that the payment occurs as part of a successful transaction.
*/
paymentTiming?: ApplePayPaymentTiming;
/**
* The [ISO 8601 formatted] date of the first payment.
*/
recurringPaymentStartDate?: string;
/**
* The amount of time — in calendar units, such as day, month, or year — that represents a fraction of the total payment interval.
*/
recurringPaymentIntervalUnit?: ApplePayRecurringPaymentDateUnit;
/**
* The number of interval units that make up the total payment interval.
*/
recurringPaymentIntervalCount?: number;
/**
* The [ISO 8601 formatted] date of the final payment.
*
*/
recurringPaymentEndDate?: string;
/**
* The [ISO 8601 formatted] date, in the future, of the payment.
*/
deferredPaymentDate?: string;
/**
* The balance an account reaches before the merchant applies the automatic reload amount.
*/
automaticReloadPaymentThresholdAmount?: string;
}
/**
* A type that indicates the time a payment occurs in a transaction.
*/
type ApplePayPaymentTiming =
/**
* A value that specifies that the payment occurs when the transaction is complete.
*/
| 'immediate'
/**
* A value that specifies that the payment occurs on a regular basis.
*/
| 'deferred'
/**
* A value that specifies that the payment occurs in the future.
*/
| 'recurring'
/**
* A value that specifies that the payment occurs automatically when the account falls below the automaticReloadPaymentThresholdAmount amount.
*/
| 'automaticReload';
/**
* A type that indicates calendrical units, such as year, month, day, and hour.
*/
type ApplePayRecurringPaymentDateUnit =
/**
* A value that specifies the year unit.
*/
| 'year'
/**
* A value that specifies the month unit.
*/
| 'month'
/**
* A value that specifies the day unit.
*/
| 'day'
/**
* A value that specifies the hour unit.
*/
| 'hour'
/**
* A value that specifies the minute unit.
*/
| 'minute';
/**
* A type that indicates whether a line item is final or pending.

@@ -325,3 +414,3 @@ */

*/
'final' |
| 'final'

@@ -331,3 +420,3 @@ /**

*/
'pending';
| 'pending';

@@ -341,3 +430,3 @@ /**

*/
'supports3DS' |
| 'supports3DS'

@@ -347,3 +436,3 @@ /**

*/
'supportsEMV' |
| 'supportsEMV'

@@ -353,3 +442,3 @@ /**

*/
'supportsCredit' |
| 'supportsCredit'

@@ -359,3 +448,3 @@ /**

*/
'supportsDebit';
| 'supportsDebit';

@@ -515,7 +604,3 @@ /**

*/
type ApplePayPaymentMethodType =
'debit' |
'credit' |
'prepaid' |
'store';
type ApplePayPaymentMethodType = 'debit' | 'credit' | 'prepaid' | 'store';

@@ -534,2 +619,3 @@ /**

* Updated transaction details resulting from a change in payment method.
* See more: https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentmethodupdate
*/

@@ -546,2 +632,27 @@ interface ApplePayPaymentMethodUpdate {

newTotal: ApplePayLineItem;
/**
* An array of updated multitoken contexts for a multimerchant payment request.
*/
newMultiTokenContexts?: ApplePayPaymentTokenContext[];
/**
* An updated request for an automatic reload payment.
*/
newAutomaticReloadPaymentRequest?: ApplePayAutomaticReloadPaymentRequest;
/**
* An updated request for a recurring payment.
*/
newRecurringPaymentRequest?: ApplePayRecurringPaymentRequest;
/**
* A list of customized errors you provide that results from the user's change to the payment method.
*/
errors?: ApplePayError[];
/**
* The updated list of available shipping methods that results from the user's change to the payment method.
*/
newShippingMethods?: ApplePayShippingMethod[];
}

@@ -586,3 +697,3 @@

*/
'activated' |
| 'activated'

@@ -592,3 +703,3 @@ /**

*/
'requiresActivation' |
| 'requiresActivation'

@@ -598,3 +709,3 @@ /**

*/
'activating' |
| 'activating'

@@ -604,3 +715,3 @@ /**

*/
'suspended' |
| 'suspended'

@@ -610,3 +721,3 @@ /**

*/
'deactivated';
| 'deactivated';

@@ -687,5 +798,134 @@ /**

applicationData?: string | undefined;
/**
* This property is optional. Use it to indicate that the payment request is for a recurring payment.
* Apple Pay issues an Apple Pay Merchant Token if the user’s payment network supports merchant-specific payment tokens.
* Otherwise, Apple Pay issues a device token for the payment request.
*
* Important
* You can’t use this property with multiTokenContexts or automaticReloadPaymentRequest properties.
* Simultaneous use of these properties results in an error and cancels the payment request.
*/
recurringPaymentRequest?: ApplePayRecurringPaymentRequest;
/**
* A property that requests an automatic reload payment, such as a store card top-up.
*/
automaticReloadPaymentRequest?: ApplePayAutomaticReloadPaymentRequest;
/**
* An array of payment token contexts that requests multiple payment tokens to support a multimerchant payment.
*/
multiTokenContexts?: ApplePayPaymentTokenContext[];
}
/**
* A dictionary that represents a request to set up a recurring payment, typically a subscription.
*
* Important
* You must include the recurringPaymentRequest property in the ApplePayPaymentRequest object to specify a request for a recurring payment.
* Use an ApplePayRecurringPaymentRequest object to provide the user with payment details and a way to manage payment methods for a recurring payment.
* You can optionally display a billing agreement and set up merchant token life-cycle notifications for the request.
*/
interface ApplePayRecurringPaymentRequest {
/**
* A description of the recurring payment that Apple Pay displays to the user in the payment sheet.
*/
paymentDescription: string;
/**
* A localized billing agreement that the payment sheet displays to the user before the user authorizes the payment.
*/
billingAgreement?: string;
/**
* The regular billing cycle for the recurring payment, including start and end dates, an interval, and an interval count.
*/
regularBilling: ApplePayLineItem;
/**
* The trial billing cycle for the recurring payment.
*/
trialBilling?: ApplePayLineItem;
/**
* A URL to a web page where the user can update or delete the payment method for the recurring payment.
*/
managementURL: string;
/**
* A URL you provide for receiving life-cycle notifications from the Apple Pay servers about the Apple Pay merchant token for the recurring payment.
*/
tokenNotificationURL?: string;
}
/**
* Use an ApplePayAutomaticReloadPaymentRequest object to provide the user with payment details and a way to manage payment methods for an automatic reload payment.
* You can optionally display a billing agreement and set up merchant token life-cycle notifications for the request.
* For more information about the merchant token life-cycle notifications, see Apple Pay Merchant Token Management API.
*
* Apple Pay issues an Apple Pay Merchant Token if the user’s payment network supports merchant-specific payment tokens.
* Otherwise, Apple Pay issues a device token for the payment request.
*/
interface ApplePayAutomaticReloadPaymentRequest {
/**
* A description of the automatic reload payment that Apple Pay displays in the payment sheet.
*/
paymentDescription: string;
/**
* A line item that contains the reload amount and balance threshold for the automatic reload payment.
*/
automaticReloadBilling: ApplePayLineItem;
/**
* A localized billing agreement that the payment sheet displays to the user before the user authorizes the payment.
*/
billingAgreement?: string;
/**
* A URL to a web page where the user can update or delete the payment method for the automatic reload payment.
*/
managementURL: string;
/**
* A URL you provide to receive life-cycle notifications from the Apple Pay servers about the Apple Pay merchant token for the recurring payment.
*/
tokenNotificationURL?: string;
}
/**
* Use ApplePayPaymentTokenContext to authorize a payment amount for each payment token in a multimerchant payment request.
* To enable multiple merchants for a transaction, use one ApplePayPaymentTokenContext object for each merchant.
*
* You can optionally associate each payment token with the merchant’s top-level domain.
*/
interface ApplePayPaymentTokenContext {
/**
* The Apply Pay merchant identifier.
*/
merchantIdentifier: string;
/**
* An external identifier for the merchant.
*/
externalIdentifier: string;
/**
* The merchant’s display name that the Apple Pay server associates with the payment token.
*/
merchantName: string;
/**
* The merchant’s top-level domain that the Apple Pay server associates with the payment token.
*/
merchantDomain?: string;
/**
* The amount to authorize for the payment token context.
*/
amount: string;
}
/**
* An object that contains the user's payment credentials.

@@ -768,5 +1008,52 @@ */

identifier: string;
/**
* A dictionary that specifies the start and end dates for a range of time.
*/
dateComponentsRange?: ApplePayDateComponentsRange;
}
/**
* A dictionary that specifies the start and end dates for a range of time.
*/
interface ApplePayDateComponentsRange {
/**
* The start date and time of the range.
*/
startDateComponents: ApplePayDateComponents;
/**
* The end date and time of the range.
*/
endDateComponents: ApplePayDateComponents;
}
/**
* When specifying a range using date components, provide all elements of the ApplePayDateComponents down to the level of granularity that you want to expose.
* For example, if you specify a range of days, be sure to include values for both months and years in addition to days in the ApplePayDateComponents.
*
* Apple Pay on the Web uses the Gregorian calendar when processing dates.
*/
interface ApplePayDateComponents {
/**
* A number that represents a day.
*/
days: number;
/**
* A number between 1 and 12 that represents a month.
*/
months: number;
/**
* A number that represents a year.
*/
years: number;
/**
* A number that represents an hour.
*/
hours: number;
}
/**
* The ApplePayShippingMethodSelectedEvent class defines the attribute contained by the ApplePaySession.onshippingmethodselected callback function.

@@ -799,7 +1086,3 @@ */

*/
type ApplePayShippingType =
'shipping' |
'delivery' |
'storePickup' |
'servicePickup';
type ApplePayShippingType = 'shipping' | 'delivery' | 'storePickup' | 'servicePickup';

@@ -806,0 +1089,0 @@ /**

6

applepayjs/package.json
{
"name": "@types/applepayjs",
"version": "3.0.4",
"version": "14.0.0",
"description": "TypeScript definitions for Apple Pay JS",

@@ -23,4 +23,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/applepayjs",

"dependencies": {},
"typesPublisherContentHash": "6f0c2bf8476b92301b2bff2afd6b9cc60de4badba4b8291c952e8d68d2dfe2d4",
"typeScriptVersion": "3.8"
"typesPublisherContentHash": "8267507a85eb37726b3faf4a718be666145f5ba39f1a9be50f3323d939fa673b",
"typeScriptVersion": "4.3"
}

@@ -11,3 +11,3 @@ # Installation

### Additional Details
* Last updated: Tue, 01 Mar 2022 05:01:42 GMT
* Last updated: Wed, 05 Apr 2023 16:33:22 GMT
* Dependencies: none

@@ -14,0 +14,0 @@ * Global values: `ApplePayError`, `ApplePayJS`, `ApplePaySession`

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc