mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
* Add ERROR_STATE flag * added prop options and func timeFormatter added property `options`, which can be found in [the code](15fc4b62f5/smoothie.js (L270)). Even though it's not mentioned in the docs, it useful to be able to access these options after chart is initialized when you want to change appearance in real tme. added function `timeFormatter`, which is mentioned in [right here, in the definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/smoothie/smoothie.d.ts#L127) and can be found in [the code](15fc4b62f5/smoothie.js (L795)) * Fix type errors * Added typings for css-modules-require-hook * Remove spaces * Added semver, added explicit ignore callback, unified array definition and removed one time interface * Overwriting method signature * Correct parameter type * Add MobilePhoneLocale * Add isMobilePhone tests * Type definitions for bit-array * Add emit for cluster * To use the definition inline * [logat.d.ts] Type definition for node module 'logat' (#11485) * Create logat.d.ts * Create logat-tests.ts * Update logat-tests.ts * Update logat-tests.ts * Update logat.d.ts * updated logat test * updated type definiton * [dateformat.d.ts] Add definitions for dateformat * Remove the ES6 module hack * Yayson definitions (#11484) * Add yayson Store typings * Add yayson Store tests * Improve yayson coverage * Specify version in yayson definition * Remove yayson generics and tidy * Changed namespace from angularTouchspin to angular.touchspin (#11414) * [perfect-scrollbar.d.ts] Add definitions for perfect-scrollbar (#11486) * Added types for klaw (#11492) * Added types for klaw * addressed pr comments and `tsfmt -r klaw/*.ts` * add typings for onselected and onunselected methods, refs #11493 (#11496) * Improve through2 declarations (#11499) * [through2] Fix typos * [through2] Change return types to stream.Transform `through2` creates `stream.Transform`-flavored streams, so switching the return types to `stream.Transform` gives us richer typing information than using `NodeJS.ReadWriteStream`, which is missing methods (e.g. `stream.Transform#push`) and the ability to use object mode. * [through2] Add through2.ctor method * [through2] Update header and docs * Add module declaration to crossfilter so that it can be explicitly imported (#11521) * Add typings for murmurhash3js * fix module import to be ES6 compliant * newline at EOF * [rethinkdb] Adds missing promise methods to Cursor and Connection * [rethinkdb] Applied TypeScript formatting to the file * [rethinkdb] Adds types to Cursor methods * webpack - HotModuleReplacementPlugin has opts arg * [openlayers] forEachFeatureAtPixel can return a value See doc http://openlayers.org/en/latest/apidoc/ol.Map.html#forEachFeatureAtPixel * Update react.d.ts Added myself as an author so I get notifications of PRs / updates from GitHub. * vue: fixed definition for activate() in ComponentOption * Fix error that came using typescript 2 This error come when try compile with typescript 2 kue.d.ts(13,3): error TS2440: Import declaration conflicts with local declaration of 'redis' * path can be string or a hash of options As per http://restify.com/#client-api it states: > Note that all further documentation refers to the "short-hand" > form of methods like get/put/del which take a string path. You > can also pass in an object to any of those methods with extra > params (notably headers): So the path can be either a string or a hash of options. * Add CognitoIdentity into aws-sdk * Font advanced config options added (for v2.0.6+) * Add missing slider parameters * Add backspaceToRemoveMessage prop * fixup! path can be string or a hash of options * add request.body (#11395) * add request.body * Update koa-bodyparser.d.ts According to the documentation of `koa-bodyparser`: ```javascript // the parsed body will store in this.request.body // if nothing was parsed, body will be an empty object {} ctx.body = ctx.request.body; ``` Therefore the `body` property will exit in the `request` object. Changing the `body` property from optional to required can also fix the conflict problem in Koa's declaration file: ```ts class Koa extend Request, Response {} ``` * Implement tilebelt definition (#11495) * Add import test (#11476) * [validator] Add new stuff which document not mentioned (#11498) * Add new stuff which document not mentioned * Add related test * http.ServerRequest => http.IncomingMessage (#11500) * [node] Add events for dgram (#11501) * Add events for dgram * Add tests for dgram * Correct dgram.RemoteInfo interface * Correct emit * Correct emit * [node] Add events for tls.Server and tls.TLSSocket (#11502) * Add events for tls.Server * Add tests for tls.Server * Add tests for TLSSocket * Add events for TLSSocket * [react-router] Update getComponents signatures (#11319) Update `getComponent(s)` all over the place. See #9530 for more info. * Updated jquery.dataTables for 1.10.7. (#11408) * Updated jquery.dataTables for 1.10.7. Version release notes: https://cdn.datatables.net/1.10.7/ * Added any() * Added i18n() Note: selector-modifier support currently exists with interface ObjectSelectorModifier. * Added strong variable typing in jquery.dataTables-tests.ts * For parameter 'def', replaced 'Object' data type with 'any' per TypeScript declaration file guidance. * [HAPI] Add `IStrictSessionHandler` (#11523) * Fix #11519 * Added FileResizeOptions for the changed resize function call * getEvent should not be set to void it should return a value (#11135) * getEvent should not be set to void it should return a value * Add type to getActionData for testing * pnotify Add type fpr notice styling and state * fix pnotify test * Remove Generics and replaces by return any * convert space tp tabs * Add barTintColor to NavigatorIOS (#11522) * GreenSock TweenMax TweenLite config Object typed refs #11265 (#11310) * refs #9944 * refs #11265 * refs #11265 * Call strategy with only mode or options (#11466) * Call strategy with only mode or options * Refactor `server.auth.strategy` * - add client.exists([params, [callback]]) (#11515) * Update to Electron 1.4.1 (#11481) * Correct fs.createWriteStream (#11560) * add declaration file for weapp (#11554) * add declaration file of weapp * rename "weapp" to "weapp-api" rename "weapp" to "weapp-api" to avoid naming conflicts * Added more methods to Turf (#11558) * Added more methods to Turf - circle - geojsonType - propReduce - coordAll - tesselate * Replace Object with GeoJSON * Implemented cheap-ruler definition * Remove GeoJSON dependency * Cheap-ruler fixes - Removed GeoJSON from tests - Added return-type to fromTile * Update JSDocs cheap-ruler Update based on comments https://github.com/mapbox/cheap-ruler/pull/20 - Removed `{@name}` - Changed {Object} to {CheapRuler} * [bluebird] document .suppressUnhandledRejections http://bluebirdjs.com/docs/api/suppressunhandledrejections.html * Add typings for shallowequal. * URIjs fix .joinPaths() the .joinPaths function is on URIStatic, not an instance of URI https://medialize.github.io/URI.js/docs.html#static-joinPaths * set document id property to be optional * Fixed type of onchallenge * feat(CKEditor): Add missing typings for `focusManager` * sequelize: fix return value type of Model.findOrXXX methods http://docs.sequelizejs.com/en/latest/api/model/#findorinitialize-promiseinstance-initialized * Added type Point for simplicity Comments from @vladima * add interface for mongoose document optional properties * optional constructor for RecurrenceRule * fix the framework type * add parameter support in initialize() * add callback parameter * Added promise() to the JQueryPromise<T> interface jQuery allows calling a promise() function on a Promise object. Updated the interface to reflect this. * optional authorize * add contains fn * Update ip-tests.ts * Added tests for the promise() method on jqXHR Ensures that the jqXHR object exposes a standard promise because it implements the JQueryPromise<T> interface. * angular-dynamic-local Add "storageKey" definition (#11566) Add "storageKey" definition cf : https://github.com/lgalfaso/angular-dynamic-locale/blob/master/src/tmhDynamicLocale.js#L197 * Added declare module for easier including. (#11562) * Adding recompose@0.20.2 typings (#11577) * Added typings for change-emitter@0.1.2 * Adding recompose@0.20.2 typings * Update typescript definition for selectize to 0.12.13 (#11570) * [react-router-redux] Update action payload type (#11559) The payload for React Redux Router action is a location object. For more information look at the source code [here](https://github.com/reactjs/react-router-redux/blob/master/src/sync.js#L95) * [openlayers] Rewrite for openlayers 3.18.2 (#11339) * Added missing config options for release v2.0.8 (#11595) * [graphql] Create graphql (#11598) * Complete graphql/language * Update graphql/error * Update graphql.d.ts * Create graphql-tests.ts * Update graphql/type * Update graphql/error and graphql/execution * Remove null type * Remove comma * ej typings v14.3.0.49 added (#11597) * ej typings v14.3.0.49 added * jquery dependent added * react-bootstrap-table: add ignoreSinglePage option (#11581) As shown in the [docs](http://allenfang.github.io/react-bootstrap-table/docs.html) ``` ignoreSinglePage : Bool Enable to ignore the pagination if only one page, default is false. ``` * There is no INST_EDGE_FALLING exported const but INT_EDGE_FALLING (#11603) Exporting correct `const` `INST_EDGE_FALLING` -> `INT_EDGE_FALLING` * Complete HighchartsBarStates interface. Add Color interface (#11505) - HighchartsBarStates interfaces didn't include `borderColor` and `color` properties, as documented in http://api.highcharts.com/highcharts/plotOptions.bar.states.hover - A Color interface was added, since the documentation refers many times to `Color` as a type. This colors can be either a string or a gradient, as stated in http://www.highcharts.com/docs/chart-design-and-style/colors. The introduction of this type should help alleviating the errors currently present where certain "color" properties are only allowed to be strings. * Add definition for swagger-jsdoc (#11298) * Add definition for swagger-jsdoc * Update files * Remove interface and use any instead for options, fix tests * Fix Usage example * Add definitions for: "bunyan-config", "express-mung", "node-vitalsigns" and "memwatch-next" (#11285) * Add definition for "bunnymq". * Add definition for "strftime". * Add definitions for: "bunyan-config", "express-mung" and "node-vitalsigns". * Add definitions for: "bunyan-config", "express-mung" and "node-vitalsigns". * Add definition for "memwatch-next". * Fix project URL address. * Rename "node-vitalsigns" to "vitalsigns". * Update definitions. * Use {} instead of "Object" type. Remove unnecessary namespace for "memwatch-next" definition. Rewrite "bunyan-config" definition. * Replace "Object" by "{}". * (helmet): change to namespace and export interfaces (#11585) * Replace reference to deprecated http.ClientResponse with newer http.IncomingMessage (#11596) * [cheerio] Adds missing load(CheerioElement) (#11520) * add id (#11619) * add id * remove readonly * add touch after * fix typo * change Topic property latch to boolean type (#11607) * Add AngularJS linky filter definition (#11507) * Support universal modules for SAT (#11632) * changed versionKey in Schema spec to string * better structure * Add argumentless Q() * add definitions for tz-format (#11565) * add definitions for tz-format * fix return type * Create typings for ngeohash (#11634) * [nprogress] Update configuration properties (#11627) Update a couple of nprogress configuration properties: * `ease` is renamed to `easing`. * `trickleRate` is removed. * `parent` is added. More info [here](https://github.com/rstacruz/nprogress/blob/master/nprogress.js#L19-L31) * Fix leaflet L.GeoJSON.addData et al (#11590) (#11591) * NotificationAlertOptions can have a subtitle (#11638) * Parse5 comment data (#11649) * Add test for data * Update parse5.d.ts * feat: add localforage-cordovasqlitedriver definition (#11650) * Fix export for "bunyan-config" and improve definitions (#11653) * Fix export for "bunyan-config". * Update definitions. Replace "Object" to "{}" type. Add "express" property in "VitalSigns" class. * Update ejs.d.ts (#11467) This typings give an error when templating HTML Error: Cannot invoke an expression whose type lacks a call signature. my code ```javascript var templateFunction = EJS.compile(SOMESTRTEMPLATE); myDomElement.innerHTML = templateFunction(someDataObject) // <= ERROR ``` * Added hyperscript module (#11661) * update parsimmon typings for parsimmon 0.9.2 (#11648) * update parsimmon typings for parsimmon 0.9.2 * add overloads for parsimmon#seq * code review * Fix babel-traverse buildCodeFrameError signature (#11654) The Error argument is not an error instance, instead it is a constructor function that returns an error instance. Additionally, the constructor function is optional, by default SyntaxError is used * Added type definition for riot library (#11664) * Added type definition for riot * Added type information for compile function, version, settings and template error handler * Updated namespace name Riot -> riot * Renamed riot-test.ts -> riot-tests.ts * Add definitions for pem (#11666) https://github.com/andris9/pem * Added hapi-decorators.d.ts (#11668) * Add missing each, and correct type of Date.now() (#11670) * Add definitions for spdy (#11672) https://github.com/indutny/node-spdy * Allow interface to be named (#11673) > error TS4023: Exported variable 'DevTools' has or is using name 'IDevTools' from external module "/Users/remojansen/CODE/forks/redux-bootstrap/node_modules/@types/redux-devtools/index" but cannot be named. * Add array methods to LoDashExplicitArrayWrapper to match LoDashImplicitArrayWrapper. (#11518) * add transducers-js types w/ tests (#11676) * Fix redeclare block-scoped Base64 (#11677) Issue found by https://github.com/dankogai/js-base64/issues/38#issuecomment-250999729 * added seed, randomTests and randomizeTests property (#11678) * Add toJSON method to signature (#11682) * Fix instance of cropperjs for library version > 0.8 (#11490) * Updated fbsdk definitions for authentication responses and api calls. (#11686) Fixes #11327 May help with #11007 * Create typings for jquery-alertable (#11642) * ADD: definition file for the moment-duration-format library (#11557) * Update d.ts file for Dialog API updates (#11526) * Add support for Highcharts modules: offline exporting and boost (#11030) * Create highcharts-modules-offline-exporting * Rename highcharts-modules-offline-exporting to highcharts-modules-offline-exporting.d.ts * Create highcharts-modules-boost.d.ts * Added cash-js.d.ts File (#10765) * Added cash-js.d.ts File * Fixed Link break issue * Renamed from cash-js to cash * Fixed the module name as suggested * Update headroom.d.ts (#11313) notBottom missing from definition * Added the definition for the npm package simple-url-cache (#11296) * Added the definition for the npm package simple-url-cache https://www.npmjs.com/package/simple-url-cache * - Some problems with shells.js missing the touch fucntion deifnition * More details on the touch parameters - nice screenshot btw * Updated the RowMethods interface (#11665) * Updated the RowMethods interface This Interface was missing the Definition of the id() method. Link to official documentation: https://datatables.net/reference/api/row().id() * Changed indentation from tabs to spaces * Added definition file for Defaults Js Library (#11451) * Added missing className property to CardProps (#10823) The className property for CardPros is missing, so using it like <Card className={this.myClass}>...</Card> is not possible. * Add missing perMessageDeflate server option (#11380) * Add missing class AgendaView (#11371) * Add missing class AgendaView * Move class to kendo.ui namespace * Change path to interface * Add static fn * Add static extend * Add static extend * Resolve conflicts * adds system faker methods (#11432) * added definitions for SharePoint file Search.ClientControls.js (#11652) * added definitions for SharePoint file Search.ClientControls.js (Srch namespace, heavily used in Search Display Templates) * --noImplicitAny compatibility fixes also small improvements * more fixes for --noImplicitAny * Adding union type for offset (#11689) * add type definitions for msgpack-lite package. (#11690) * Updating jasmine to version 2.5 (#11688) * Updating jasmine to version 2.5 * Fixing 2 small errors in the update of jasmine * withMock now takes a "() => void" * fixed the withMock syntax error * number added as type to seed function * add missing isEmpty function (#11698) * Added type definitions for terminal-menu (#11697) * Update THREE.js definitions to r81 (#11679) * Update THREE.js definitions to r81 * Update test_unit_maths.ts to r81 * Update version in header to r81 * UPDATE localForage type definitions (#11702) * Update Google Maps API type definition to 3.25 (#11626) * Update Google Maps Places Library definition - According to the Places Library documentation (https://goo.gl/EJFiuQ), certain fields are being removed - I have aligned the Places Library definitions with the API reference (https://goo.gl/kYoi9V) and added deprecation comments for the old properties as they are still accepted until February - I could not find an official deprecation attribute or similar for Typescript definitions so I just left a comment * Update the API version in the header * Apply API changes between version 3.20 and 3.25 - Used the Google Maps API release notes (https://goo.gl/nRUZGJ) as a reference * Fix inconsistant type definition * Override ol.layer.Vector#getSource() (#11703) Reference: http://openlayers.org/en/latest/apidoc/ol.layer.Vector.html * Replace number[] by [number, number] (#11704) * [lodash]: memoize.Cache expects construcor (#11707) https://lodash.com/docs/4.15.0#memoize * Added jquery.flagstrap.js definition suport (#11710) * apply declaration merging (#10900) * Update material-ui.d.ts (#11353) Expose ThemePalette interface. * Change ChartAxisXOptions (#11449) Change the type for minimum and maximum options in ChartAxisXOptions to support both number and Date. * Improve support for arrays of promises (#11685) * Alias IWhenable<T> = IPromise<T> | T * Allow all Q functions to work with either promises or raw values * Allow functions expecting arrays to take promises for arrays Q.race is deliberately excluded, as this does not support this type of argument. * scheduler options (#11543) * Added missing move function (#11563) * Added missing move function Added missing move function in typings so that the move function is recognised by the IDE and the compiler. * Minor derp here * Add missing Valdr typings for validation results and constraints (#11636) * Add missing Valdr types Add ValdrValidationConstraints and ValdrValidationResult typings * Refine Valdr-message typings Set a more refined type to messages instead of any * Expand Valdr typings tests Expand tests to include added typings for ValdrValidationResult and ValdrConstraints * Fix spacing Replace tabs by spaces * Rename vars in test Rename vars to make test clearer * Fix TS issues Added missing types * Remove undefined In TS by default null and undefined are subtypes of all other types * Fix wrong type Add missing namespace * Fix wrong version number Set version to only numbers * Fix wrong version number Keep version to only numbers * Use douple quotes * Remove invalid triple-slash references * Add tsconfig.json files and move main file to index.d.ts * Rename file to index.d.ts * Remove tscparams files * Remove unused file * Remove invalid references * Move hapi-decorator to use index.d.ts * Switch to use external modules * Correctely extend angular * Fix tsconfig.json * Remove unused references * HACK: Put back /// reference tag.
1738 lines
76 KiB
TypeScript
1738 lines
76 KiB
TypeScript
// Type definitions for Braintree-web v3.0.2
|
||
// Project: https://github.com/braintree/braintree-web
|
||
// Definitions by: Guy Shahine <https://github.com/chlela>
|
||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||
|
||
/**
|
||
* @module braintree-web/american-express
|
||
* @description This module is for use with Amex Express Checkout. To accept American Express cards, use Hosted Fields.
|
||
*/
|
||
declare namespace BraintreeWeb {
|
||
export interface AmericanExpress {
|
||
/**
|
||
* @static
|
||
* @function create
|
||
* @param {object} options Creation options:
|
||
* @param {Client} options.client A {@link Client} instance.
|
||
* @param {callback} callback The second argument, `data`, is the {@link AmericanExpress} instance.
|
||
* @returns {void}
|
||
*/
|
||
create: (options: { client: Client }, callback: callback) => void;
|
||
|
||
/**
|
||
* @description The current version of the SDK, i.e. `3.0.2`.
|
||
* @type {string}
|
||
*/
|
||
VERSION: string;
|
||
}
|
||
|
||
/**
|
||
* @class
|
||
* @param {object} options Options
|
||
* @description <strong>You cannot use this constructor directly. Use {@link module:braintree-web/american-express.create|braintree.american-express.create} instead.</strong>
|
||
* @classdesc This class allows you use a nonce to interact with American Express Checkout. To accept American Express cards, use Hosted Fields.
|
||
*/
|
||
export class AmericanExpress {
|
||
/**
|
||
* @class
|
||
* @param {object} options Options
|
||
* @description <strong>You cannot use this constructor directly. Use {@link module:braintree-web/american-express.create|braintree.american-express.create} instead.</strong>
|
||
* @classdesc This class allows you use a nonce to interact with American Express Checkout. To accept American Express cards, use Hosted Fields.
|
||
*/
|
||
constructor(options: any);
|
||
|
||
/**
|
||
* Gets the rewards balance associated with a Braintree nonce.
|
||
* @public
|
||
* @param {object} options Request options
|
||
* @param {string} options.nonce An existing Braintree nonce.
|
||
* @param {callback} callback The second argument, <code>data</code>, is the returned server data.
|
||
* @returns {void}
|
||
* @example
|
||
* var americanExpress = require('braintree-web/american-express');
|
||
*
|
||
* americanExpress.create({client: clientInstance}, function (createErr, americanExpressInstance) {
|
||
* var options = {nonce: existingBraintreeNonce};
|
||
* americanExpressInstance.getRewardsBalance(options, function (getErr, payload) {
|
||
* if (getErr || payload.error) {
|
||
* // Handle error
|
||
* return;
|
||
* }
|
||
*
|
||
* console.log('Rewards amount: ' + payload.rewardsAmount);
|
||
* });
|
||
* });
|
||
*/
|
||
public getRewardsBalance(options: { nonce: string }, callback: callback): void;
|
||
|
||
/**
|
||
* Gets the Express Checkout nonce profile given a nonce from American Express.
|
||
* @public
|
||
* @param {object} options Request options
|
||
* @param {string} options.nonce An existing nonce from American Express (note that this is <em>not</em> a nonce from Braintree).
|
||
* @param {callback} callback The second argument, <code>data</code>, is the returned server data.
|
||
* @returns {void}
|
||
* @example
|
||
* var americanExpress = require('braintree-web/american-express');
|
||
*
|
||
* americanExpress.create({client: clientInstance}, function (createErr, americanExpressInstance) {
|
||
* var options = {nonce: existingAmericanExpressNonce};
|
||
* americanExpressInstance.getExpressCheckoutProfile(options, function (getErr, payload) {
|
||
* if (getErr) {
|
||
* // Handle error
|
||
* return;
|
||
* }
|
||
*
|
||
* console.log('Number of cards: ' + payload.amexExpressCheckoutCards.length);
|
||
* });
|
||
* });
|
||
*/
|
||
public getExpressCheckoutProfile(options: { nonce: string }, callback: callback): void;
|
||
}
|
||
}
|
||
|
||
|
||
// more info https://developer.apple.com/reference/applepayjs/1916082-applepay_js_data_types/paymentrequest
|
||
|
||
// billingContact
|
||
// Billing contact information for the user.
|
||
// countryCode
|
||
//Required.The merchant<6E>s two- letter ISO 3166 country code.
|
||
// currencyCode
|
||
// Required.The three- letter ISO 4217 currency code for the payment.
|
||
// lineItems
|
||
//A set of line items that explain recurring payments and additional charges.
|
||
// merchantCapabilities
|
||
// Required.The payment capabilities supported by the merchant.The value must be one or more of supports3DS, supportsEMV, supportsCredit, or supportsDebit.
|
||
// requiredBillingContactFields
|
||
// The billing information that is required from the user.The value must be one or more of postalAddress, phone, email, or name.
|
||
// requiredShippingContactFields
|
||
// The shipping information that is required from the user.The value must be one or more of postalAddress, phone, email, or name.
|
||
// shippingContact
|
||
// Shipping contact information for the user.
|
||
// shippingMethods
|
||
//A set of available shipping methods.Totals for all shipping methods must be non- negative to pass validation.
|
||
// shippingType
|
||
// How the items are to be shipped.This property is optional.If specified, it must be one or more of shipping, delivery, storePickup, or servicePickup.The default value is shipping.
|
||
// supportedNetworks
|
||
// Required.The payment networks supported by the merchant.The value must be one or more of amex, discover, interac, masterCard, privateLabel, or visa.
|
||
// total
|
||
// Required.The total amount for the payment.The total must be greater than zero and have a label to pass validation.
|
||
interface ApplePayPaymentRequest {
|
||
total: {
|
||
label: string;
|
||
amount: string;
|
||
};
|
||
countryCode: string;
|
||
currencyCode: string;
|
||
supportedNetworks: string[];
|
||
merchantCapabilities: string[];
|
||
|
||
billingContact?: any;
|
||
shippingContact?: any;
|
||
shippingMethods?: any;
|
||
shippingType?: any;
|
||
requiredBillingContactFields?: any;
|
||
requiredShippingContactFields?: any;
|
||
}
|
||
|
||
declare enum ApplePayStatusCodes {
|
||
// The requested action succeeded.
|
||
STATUS_SUCCESS = 1,
|
||
// The requested action failed.
|
||
STATUS_FAILURE,
|
||
// The billing address is not valid.
|
||
STATUS_INVALID_BILLING_POSTAL_ADDRESS,
|
||
// The shipping address is not valid.
|
||
STATUS_INVALID_SHIPPING_POSTAL_ADDRESS,
|
||
// The shipping contact information is not valid.
|
||
STATUS_INVALID_SHIPPING_CONTACT,
|
||
// The required PIN information was not provided. Cards on the China Union Pay payment network may require a PIN to authenticate the transaction.
|
||
STATUS_PIN_REQUIRED,
|
||
// The PIN information is not valid.Cards on the China Union Pay network may require a PIN.
|
||
STATUS_PIN_INCORRECT,
|
||
// The maximum number of tries for a PIN has been reached and the user has been locked out. Cards on the China Union Pay network may require a PIN.
|
||
STATUS_PIN_LOCKOUT,
|
||
}
|
||
|
||
interface ApplePayPayload {
|
||
merchantIdentifier: string;
|
||
domainName: string;
|
||
displayName: string;
|
||
}
|
||
|
||
declare class ApplePaySession {
|
||
constructor(version: number, request: ApplePayPaymentRequest);
|
||
|
||
canMakePayments(): boolean;
|
||
|
||
canMakePaymentsWithActiveCard(merchantIdentifier: string): boolean;
|
||
|
||
completeMerchantValidation(merchantSession: any): void;
|
||
|
||
abort(): void;
|
||
|
||
begin(): void;
|
||
|
||
completePayment(status: ApplePayStatusCodes): void;
|
||
|
||
completePaymentMethodSelection(newTotal: any, newLineItems: any): void;
|
||
|
||
completeShippingContactSelection(status: ApplePayStatusCodes, newShippingMethods: any, newTotal: any, newLineItems: any): void;
|
||
|
||
completeShippingMethodSelection(status: ApplePayStatusCodes, newTotal: any, newLineItems: any): void;
|
||
|
||
supportsVersion(version: number): boolean;
|
||
|
||
oncancel: (event: any) => void;
|
||
|
||
onpaymentauthorized: (event: any) => void;
|
||
|
||
onpaymentmethodselected: (event: any) => void;
|
||
|
||
onshippingcontactselected: (event: any) => void;
|
||
|
||
onshippingmethodselected: (event: any) => void;
|
||
|
||
onvalidatemerchant: (event: any) => void;
|
||
}
|
||
|
||
/**
|
||
* @module braintree-web/apple-pay
|
||
* @description Accept Apple Pay on the Web. *This component is currently in beta and is subject to change.*
|
||
*/
|
||
declare namespace BraintreeWeb {
|
||
export interface ApplePay {
|
||
/**
|
||
* @static
|
||
* @function create
|
||
* @param {object} options Creation options:
|
||
* @param {Client} options.client A {@link Client} instance.
|
||
* @param {callback} callback The second argument, `data`, is the {@link ApplePay} instance.
|
||
* @returns {void}
|
||
*/
|
||
create: (options: { client: Client }, callback: callback) => void;
|
||
|
||
/**
|
||
* @description The current version of the SDK, i.e. `3.0.2`.
|
||
* @type {string}
|
||
*/
|
||
VERSION: string;
|
||
}
|
||
|
||
/**
|
||
* @class
|
||
* @param {object} options Options
|
||
* @description <strong>You cannot use this constructor directly. Use {@link module:braintree-web/apple-pay.create|braintree.apple-pay.create} instead.</strong>
|
||
* @classdesc This class represents an Apple Pay component. Instances of this class have methods for validating the merchant server and tokenizing payments.
|
||
*/
|
||
export class ApplePay {
|
||
/**
|
||
* @class
|
||
* @param {object} options Options
|
||
* @description <strong>You cannot use this constructor directly. Use {@link module:braintree-web/apple-pay.create|braintree.apple-pay.create} instead.</strong>
|
||
* @classdesc This class represents an Apple Pay component. Instances of this class have methods for validating the merchant server and tokenizing payments.
|
||
*/
|
||
constructor(options: any);
|
||
|
||
/**
|
||
* Merges a payment request with Braintree defaults
|
||
* The following properties are assigned to `paymentRequest` if not already defined
|
||
* - countryCode
|
||
* - currencyCode
|
||
* - merchantCapabilities
|
||
* - supportedNetworks
|
||
* @public
|
||
* @param {external:ApplePayPaymentRequest} paymentRequest The payment request details to apply on top of those from Braintree.
|
||
* @returns {external:ApplePayPaymentRequest} The decorated `paymentRequest`.
|
||
* @example
|
||
* var applePay = require('braintree-web/apple-pay');
|
||
*
|
||
* applePay.create({client: clientInstance}, function (createErr, applePayInstance) {
|
||
* // ...
|
||
* var paymentRequest = applePay.createPaymentRequest({
|
||
* total: {
|
||
* label: 'My Company',
|
||
* amount: '19.99'
|
||
* });
|
||
*
|
||
* console.log(paymentRequest);
|
||
* // { total: { }, countryCode: 'US', currencyCode: 'USD', merchantCapabilities: [ ], supportedNetworks: [ ] }
|
||
*
|
||
*/
|
||
public createPaymentRequest(paymentRequest: ApplePayPaymentRequest): ApplePayPaymentRequest
|
||
|
||
/**
|
||
* Validates the merchant website, as required by ApplePaySession before payment can be authorized.
|
||
* @public
|
||
* @param {object} options Options
|
||
* @param {string} options.validationURL The validationURL fram an ApplePayValidateMerchantEvent.
|
||
* @param {string} [options.displayName]
|
||
* - The canonical name for your store.
|
||
* - The system may display this name to the user.
|
||
* - Use a 128-character or less, UTF-8 string.
|
||
* - Do not localize the name.
|
||
* @param {string} [options.merchantIdentifier]
|
||
* Your Apple merchant identifier. This is the Apple Merchant ID created on the Apple Developer Portal.
|
||
* Defaults to the merchant identifier specified in the Braintree Control Panel.
|
||
* You can use this field to override the merchant identifier for this transaction.
|
||
* @param {callback} callback The second argument, <code>data</code>, is the Apple Pay merchant session object.
|
||
* Pass the merchant session to your Apple Pay session's completeMerchantValidation method.
|
||
* @returns {void}
|
||
* @example
|
||
* var applePay = require('braintree-web/apple-pay');
|
||
*
|
||
* applePay.create({client: clientInstance}, function (createErr, applePayInstance) {
|
||
* var session = new ApplePaySession(1, {
|
||
* // This should be the payment request object that
|
||
* // contains the information needed to display the payment sheet.
|
||
* });
|
||
*
|
||
* session.onvalidatemerchant = function (event) {
|
||
* applePay.performValidation({
|
||
* validationURL: event.validationURL
|
||
* }, function(err, validationData) {
|
||
* if (err) {
|
||
* console.error(err);
|
||
* session.abort();
|
||
* return;
|
||
* }
|
||
* session.completeMerchantValidation(validationData);
|
||
* });
|
||
* };
|
||
* });
|
||
*/
|
||
public performValidation(options: { validationURL: string, displayName?: string, merchantIdentifier?: string }, callback: callback): void;
|
||
|
||
/**
|
||
* Tokenizes an Apple Pay payment.
|
||
* @public
|
||
* @param {object} options Options
|
||
* @param {object} options.token The `payment.token` property of an {@link external:ApplePayPaymentAuthorizedEvent}
|
||
* @param {callback} callback The second argument, <code>data</code>, is the tokenized payload.
|
||
* @returns {void}
|
||
* @example
|
||
* var applePay = require('braintree-web/apple-pay');
|
||
*
|
||
* applePay.create({client: clientInstance}, function (createErr, applePayInstance) {
|
||
* var session = new ApplePaySession(1, { });
|
||
*
|
||
* session.onpaymentauthorized = function (event) {
|
||
* applePay.tokenize({
|
||
* token: event.payment.token
|
||
* }, function (err, tokenizedPayload) {
|
||
* if (err) {
|
||
* session.completePayment(ApplePaySession.STATUS_FAILURE);
|
||
* return;
|
||
* }
|
||
* session.completePayment(ApplePaySession.STATUS_SUCCESS);
|
||
*
|
||
* // Send the tokenizedPayload to your server.
|
||
* });
|
||
* };
|
||
* });
|
||
*/
|
||
public tokenize(options: { token: any }, callback: callback): void;
|
||
|
||
}
|
||
}
|
||
|
||
/** @module braintree-web/client */
|
||
declare namespace BraintreeWeb {
|
||
/**
|
||
* This object is returned by {@link Client#getConfiguration|getConfiguration}. This information is used extensively by other Braintree modules to properly configure themselves.
|
||
* @typedef {object} Client~configuration
|
||
* @property {object} client The braintree-web/client parameters.
|
||
* @property {string} client.authorization A tokenizationKey or clientToken.
|
||
* @property {object} gatewayConfiguration Gateway-supplied configuration.
|
||
* @property {object} analyticsMetadata Analytics-specific data.
|
||
* @property {string} analyticsMetadata.sessionId Uniquely identifies a browsing session.
|
||
* @property {string} analyticsMetadata.sdkVersion The braintree.js version.
|
||
* @property {string} analyticsMetadata.merchantAppId Identifies the merchant's web app.
|
||
*/
|
||
interface ClientAnalyticsMetadata {
|
||
sessionId: string;
|
||
sdkVersion: string;
|
||
merchantAppId: string;
|
||
}
|
||
|
||
interface Configuration {
|
||
client: Client;
|
||
gatewayConfiguration: any;
|
||
analyticsMetadata: ClientAnalyticsMetadata;
|
||
}
|
||
|
||
interface CreditCardInfo {
|
||
number: string;
|
||
cvv: string;
|
||
expirationDate: string;
|
||
billingAddress: {
|
||
postalCode?: string;
|
||
}
|
||
}
|
||
|
||
export interface Client {
|
||
authorization: string;
|
||
|
||
/**
|
||
* @function
|
||
* @description This function is the entry point for the <code>braintree.client</code> module. It is used for creating {@link Client} instances that service communication to Braintree servers.
|
||
* @param {object} options Object containing all {@link Client} options:
|
||
* @param {string} options.authorization A tokenizationKey or clientToken.
|
||
* @param {callback} callback The second argument, <code>data</code>, is the {@link Client} instance.
|
||
* @returns {void}
|
||
* @example
|
||
* var createClient = require('braintree-web/client').create;
|
||
*
|
||
* createClient({
|
||
* authorization: CLIENT_AUTHORIZATION
|
||
* }, function (createErr, clientInstance) {
|
||
* ...
|
||
* });
|
||
* @static
|
||
*/
|
||
create: (options: { authorization: string }, callback: callback) => void;
|
||
|
||
/**
|
||
* @description The current version of the SDK, i.e. `3.0.2`.
|
||
* @type {string}
|
||
*/
|
||
VERSION: string;
|
||
}
|
||
|
||
/**
|
||
* @class
|
||
* @param {Client~configuration} configuration Options
|
||
* @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/client.create|braintree.client.create} instead.</strong>
|
||
* @classdesc This class is required by many other Braintree components. It serves as the base API layer that communicates with our servers. It is also capable of being used to formulate direct calls to our servers, such as direct credit card tokenization. See {@link Client#request}.
|
||
*/
|
||
export class Client {
|
||
/**
|
||
* @class
|
||
* @param {Client~configuration} configuration Options
|
||
* @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/client.create|braintree.client.create} instead.</strong>
|
||
* @classdesc This class is required by many other Braintree components. It serves as the base API layer that communicates with our servers. It is also capable of being used to formulate direct calls to our servers, such as direct credit card tokenization. See {@link Client#request}.
|
||
*/
|
||
constructor(configuration: Configuration);
|
||
|
||
|
||
/**
|
||
* Returns a copy of the configuration values.
|
||
* @public
|
||
* @returns {Client~configuration} configuration
|
||
*/
|
||
public getConfiguration(): Configuration;
|
||
|
||
/**
|
||
* Used by other modules to formulate all network requests to the Braintree gateway. It is also capable of being used directly from your own form to tokenize credit card information. However, be sure to satisfy PCI compliance if you use direct card tokenization.
|
||
* @public
|
||
* @param {object} options Request options:
|
||
* @param {string} options.method HTTP method. i.e. "get" or "post"
|
||
* @param {string} options.endpoint Enpoint path. i.e. "payment_methods"
|
||
* @param {object} options.data Data to send with the request
|
||
* @param {string} [options.timeout=60000] Timeout limit
|
||
* @param {callback} callback The second argument, <code>data</code>, is the returned server data.
|
||
* @example
|
||
* <caption>Direct Credit Card Tokenization</caption>
|
||
* var createClient = require('braintree-web/client').create;
|
||
*
|
||
* createClient({
|
||
* authorization: CLIENT_AUTHORIZATION
|
||
* }, function (createErr, clientInstance) {
|
||
* var form = document.getElementById('my-form-id');
|
||
* var data = {
|
||
* creditCard: {
|
||
* number: form['cc-number'].value,
|
||
* cvv: form['cc-cvv'].value,
|
||
* expirationDate: form['cc-date'].value,
|
||
* billingAddress: {
|
||
* postalCode: form['cc-postal'].value
|
||
* }
|
||
* }
|
||
* };
|
||
*
|
||
* // Warning: For a merchant to be eligible for the easiest level of PCI compliance (SAQ A),
|
||
* // payment fields cannot be hosted on your checkout page.
|
||
* // For an alternative to the following, use Hosted Fields.
|
||
* clientInstance.request({
|
||
* endpoint: 'payment_methods/credit_cards',
|
||
* method: 'post',
|
||
* data: data
|
||
* }, function (requestErr, response) {
|
||
* if (requestErr) { throw new Error(requestErr); }
|
||
*
|
||
* console.log('Got nonce:', response.creditCards[0].nonce);
|
||
* });
|
||
* });
|
||
* @returns {void}
|
||
*/
|
||
public request(options: { method: string, endpoint: string, data: any, timeout?: number }, callback: callback): void;
|
||
|
||
}
|
||
}
|
||
|
||
/** @module braintree-web/data-collector */
|
||
declare namespace BraintreeWeb {
|
||
export interface DataCollector {
|
||
/**
|
||
* @static
|
||
* @function create
|
||
* @param {object} options Creation options:
|
||
* @param {Client} options.client A {@link Client} instance.
|
||
* @param {boolean} [options.kount] If true, Kount fraud data collection is enabled.
|
||
* @param {boolean} [options.paypal] If true, PayPal fraud data collection is enabled.
|
||
* @param {callback} callback The second argument, `data`, is the {@link DataCollector} instance.
|
||
* @returns {void}
|
||
*/
|
||
create: (options: { client: Client, kount: boolean, paypal: boolean }, callback: callback) => void;
|
||
|
||
/**
|
||
* @description The current version of the SDK, i.e. `3.0.2`.
|
||
* @type {string}
|
||
*/
|
||
VERSION: string;
|
||
}
|
||
|
||
/**
|
||
* @class
|
||
* @global
|
||
* @name DataCollector
|
||
* @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/data-collector.create|braintree-web.data-collector.create} instead.</strong>
|
||
* @classdesc This class is used for advanced fraud integration with PayPal and Kount. Instances of this class have {@link DataCollector#deviceData|deviceData} which is used to correlate user sessions with server transactions.
|
||
*/
|
||
export class DataCollector {
|
||
/**
|
||
* @class
|
||
* @global
|
||
* @name DataCollector
|
||
* @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/data-collector.create|braintree-web.data-collector.create} instead.</strong>
|
||
* @classdesc This class is used for advanced fraud integration with PayPal and Kount. Instances of this class have {@link DataCollector#deviceData|deviceData} which is used to correlate user sessions with server transactions.
|
||
*/
|
||
constructor();
|
||
|
||
/**
|
||
* @memberof DataCollector
|
||
* @name deviceData
|
||
* @type string
|
||
* @description JSON string to pass with server transactions.
|
||
* @instance
|
||
*/
|
||
deviceData: string;
|
||
|
||
/**
|
||
* @memberof DataCollector
|
||
* @name teardown
|
||
* @function
|
||
* @description Cleanly remove all event handlers and DOM nodes that were added.
|
||
* @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.
|
||
* @instance
|
||
* @returns {void}
|
||
*/
|
||
teardown(callback?: callback): void;
|
||
|
||
}
|
||
}
|
||
|
||
/** @module braintree-web/hosted-fields */
|
||
declare namespace BraintreeWeb {
|
||
/**
|
||
* Fields used in {@link module:braintree-web/hosted-fields~fieldOptions fields options}
|
||
* @typedef {object} field
|
||
* @property {string} selector A CSS selector to find the container where the hosted field will be inserted.
|
||
* @property {string} [placeholder] Will be used as the `placeholder` attribute of the input. If `placeholder` is not natively supported by the browser, it will be polyfilled.
|
||
* @property {boolean} [formatInput=true] - Enable or disable automatic formatting on this field. Note: Input formatting does not work properly on Android and iOS, so input formatting is automatically disabled on those browsers.
|
||
*/
|
||
interface HostedFieldsField {
|
||
selector: string;
|
||
placeholder?: string;
|
||
formatInput?: boolean;
|
||
}
|
||
|
||
/**
|
||
* An object that has {@link module:braintree-web/hosted-fields~field field objects} for each field. Used in {@link module:braintree-web/hosted-fields~create create}.
|
||
* @typedef {object} fieldOptions
|
||
* @property {field} [number] A field for card number.
|
||
* @property {field} [expirationDate] A field for expiration date in `MM/YYYY` format. This should not be used with the `expirationMonth` and `expirationYear` properties.
|
||
* @property {field} [expirationMonth] A field for expiration month in `MM` format. This should be used with the `expirationYear` property.
|
||
* @property {field} [expirationYear] A field for expiration year in `YYYY` format. This should be used with the `expirationMonth` property.
|
||
* @property {field} [cvv] A field for 3 or 4 digit CVV or CID.
|
||
* @property {field} [postalCode] A field for postal or region code.
|
||
*/
|
||
interface HostedFieldFieldOptions {
|
||
number: HostedFieldsField;
|
||
expirationDate?: HostedFieldsField;
|
||
expirationMonth?: HostedFieldsField;
|
||
expirationYear?: HostedFieldsField;
|
||
cvv: HostedFieldsField;
|
||
postalCode?: HostedFieldsField;
|
||
}
|
||
|
||
/**
|
||
* @typedef {object} HostedFields~hostedFieldsCard
|
||
* @description Information about the card type, sent in {@link HostedFields~stateObject|stateObjects}.
|
||
* @property {string} type The code-friendly representation of the card type. It will be one of the following strings:
|
||
* - `american-express`
|
||
* - `diners-club`
|
||
* - `discover`
|
||
* - `jcb`
|
||
* - `maestro`
|
||
* - `master-card`
|
||
* - `unionpay`
|
||
* - `visa`
|
||
* @property {string} niceType The pretty-printed card type. It will be one of the following strings:
|
||
* - `American Express`
|
||
* - `Diners Club`
|
||
* - `Discover`
|
||
* - `JCB`
|
||
* - `Maestro`
|
||
* - `MasterCard`
|
||
* - `UnionPay`
|
||
* - `Visa`
|
||
* @property {object} code
|
||
* This object contains data relevant to the security code requirements of the card brand.
|
||
* For example, on a Visa card there will be a <code>CVV</code> of 3 digits, whereas an
|
||
* American Express card requires a 4-digit <code>CID</code>.
|
||
* @property {string} code.name <code>"CVV"</code> <code>"CID"</code> <code>"CVC"</code>
|
||
* @property {number} code.size The expected length of the security code. Typically, this is 3 or 4.
|
||
*/
|
||
|
||
interface HostedFieldsCardCode {
|
||
name: string;
|
||
size: number;
|
||
}
|
||
|
||
interface HostedFieldsHostedFieldsCard {
|
||
type: string;
|
||
niceType: string;
|
||
code: HostedFieldsCardCode;
|
||
}
|
||
|
||
/**
|
||
* @typedef {object} HostedFields~hostedFieldsFieldData
|
||
* @description Data about Hosted Fields fields, sent in {@link HostedFields~stateObject|stateObjects}.
|
||
* @property {HTMLElement} container Reference to the container DOM element on your page associated with the current event.
|
||
* @property {boolean} isFocused Whether or not the input is currently focused.
|
||
* @property {boolean} isEmpty Whether or not the user has entered a value in the input.
|
||
* @property {boolean} isPotentiallyValid
|
||
* A determination based on the future validity of the input value.
|
||
* This is helpful when a user is entering a card number and types <code>"41"</code>.
|
||
* While that value is not valid for submission, it is still possible for
|
||
* it to become a fully qualified entry. However, if the user enters <code>"4x"</code>
|
||
* it is clear that the card number can never become valid and isPotentiallyValid will
|
||
* return false.
|
||
* @property {boolean} isValid Whether or not the value of the associated input is <i>fully</i> qualified for submission.
|
||
*/
|
||
interface HostedFieldsHostedFieldsFieldData {
|
||
container: HTMLElement;
|
||
isFocused: boolean;
|
||
isEmpty: boolean;
|
||
isPotentiallyValid: boolean;
|
||
isValid: boolean;
|
||
}
|
||
|
||
/**
|
||
* @typedef {object} HostedFields~stateObject
|
||
* @description The event payload sent from {@link HostedFields#on|on} or {@link HostedFields#getState|getState}.
|
||
* @property {HostedFields~hostedFieldsCard[]} cards
|
||
* This will return an array of potential {@link HostedFields~hostedFieldsCard|cards}. If the card type has been determined, the array will contain only one card.
|
||
* Internally, Hosted Fields uses <a href="https://github.com/braintree/credit-card-type">credit-card-type</a>,
|
||
* an open-source card detection library.
|
||
* @property {string} emittedBy
|
||
* The name of the field associated with an event. This will not be included if returned by {@link HostedFields#getState|getState}. It will be one of the following strings:<br>
|
||
* - `"number"`
|
||
* - `"cvv"`
|
||
* - `"expirationDate"`
|
||
* - `"expirationMonth"`
|
||
* - `"expirationYear"`
|
||
* - `"postalCode"`
|
||
* @property {object} fields
|
||
* @property {?HostedFields~hostedFieldsFieldData} fields.number {@link HostedFields~hostedFieldsFieldData|hostedFieldsFieldData} for the number field, if it is present.
|
||
* @property {?HostedFields~hostedFieldsFieldData} fields.cvv {@link HostedFields~hostedFieldsFieldData|hostedFieldsFieldData} for the CVV field, if it is present.
|
||
* @property {?HostedFields~hostedFieldsFieldData} fields.expirationDate {@link HostedFields~hostedFieldsFieldData|hostedFieldsFieldData} for the expiration date field, if it is present.
|
||
* @property {?HostedFields~hostedFieldsFieldData} fields.expirationMonth {@link HostedFields~hostedFieldsFieldData|hostedFieldsFieldData} for the expiration month field, if it is present.
|
||
* @property {?HostedFields~hostedFieldsFieldData} fields.expirationYear {@link HostedFields~hostedFieldsFieldData|hostedFieldsFieldData} for the expiration year field, if it is present.
|
||
* @property {?HostedFields~hostedFieldsFieldData} fields.postalCode {@link HostedFields~hostedFieldsFieldData|hostedFieldsFieldData} for the postal code field, if it is present.
|
||
*/
|
||
interface HostedFieldsFieldDataFields {
|
||
number: HostedFieldsHostedFieldsFieldData;
|
||
cvv: HostedFieldsHostedFieldsFieldData;
|
||
expirationDate: HostedFieldsHostedFieldsFieldData;
|
||
expirationMonth: HostedFieldsHostedFieldsFieldData;
|
||
expirationYear: HostedFieldsHostedFieldsFieldData;
|
||
postalCode: HostedFieldsHostedFieldsFieldData;
|
||
}
|
||
|
||
interface HostedFieldsStateObject {
|
||
cards: HostedFieldsHostedFieldsCard[];
|
||
emittedBy: string;
|
||
fields: HostedFieldsFieldDataFields;
|
||
}
|
||
|
||
/**
|
||
* @typedef {object} HostedFields~tokenizePayload
|
||
* @property {string} nonce The payment method nonce.
|
||
* @property {object} details Additional account details.
|
||
* @property {string} details.cardType Type of card, ex: Visa, MasterCard.
|
||
* @property {string} details.lastTwo Last two digits of card number.
|
||
* @property {string} description A human-readable description.
|
||
* @property {string} type The payment method type, always `CreditCard`.
|
||
*/
|
||
interface HostedFieldsAccountDetails {
|
||
cardType: string;
|
||
lastTwo: string;
|
||
}
|
||
|
||
interface HostedFieldsTokenizePayload {
|
||
nonce: string;
|
||
details: HostedFieldsAccountDetails;
|
||
type: string;
|
||
description: string;
|
||
}
|
||
|
||
export interface HostedFields {
|
||
/**
|
||
* @static
|
||
* @function create
|
||
* @param {object} options Creation options:
|
||
* @param {Client} options.client A {@link Client} instance.
|
||
* @param {fieldOptions} options.fields A {@link module:braintree-web/hosted-fields~fieldOptions set of options for each field}.
|
||
* @param {styleOptions} options.styles {@link module:braintree-web/hosted-fields~styleOptions Styles} applied to each field.
|
||
* @param {callback} callback The second argument, `data`, is the {@link HostedFields} instance.
|
||
* @returns {void}
|
||
* @example
|
||
* braintree.hostedFields.create({
|
||
* client: clientInstance,
|
||
* styles: {
|
||
* 'input': {
|
||
* 'font-size': '16pt',
|
||
* 'color': '#3A3A3A'
|
||
* },
|
||
* '.number': {
|
||
* 'font-family': 'monospace'
|
||
* },
|
||
* '.valid': {
|
||
* 'color': 'green'
|
||
* }
|
||
* },
|
||
* fields: {
|
||
* number: {
|
||
* selector: '#card-number'
|
||
* },
|
||
* cvv: {
|
||
* selector: '#cvv'
|
||
* },
|
||
* expirationDate: {
|
||
* selector: '#expiration-date'
|
||
* }
|
||
* }
|
||
* }, callback);
|
||
*/
|
||
create: (options: { client: Client, fields: HostedFieldFieldOptions, styles: any }, callback: callback) => void;
|
||
|
||
|
||
/**
|
||
* An object that represents CSS that will be applied in each hosted field. This object looks similar to CSS. Typically, these styles involve fonts (such as `font-family` or `color`).
|
||
*
|
||
* These are the CSS properties that Hosted Fields supports. Any other CSS should be specified on your page and outside of any Braintree configuration. Trying to set unsupported properties will fail and put a warning in the console.
|
||
*
|
||
* `color` `font-family` `font-size-adjust` `font-size` `font-stretch` `font-style` `font-variant-alternates` `font-variant-caps` `font-variant-east-asian` `font-variant-ligatures` `font-variant-numeric` `font-variant` `font-weight` `font` `line-height` `opacity` `outline` `text-shadow` `transition` `-moz-osx-font-smoothing` `-moz-tap-highlight-color` `-moz-transition` `-webkit-font-smoothing` `-webkit-tap-highlight-color` `-webkit-transition`
|
||
* @typedef {object} styleOptions
|
||
*/
|
||
styleOptions: any;
|
||
|
||
/**
|
||
* @description The current version of the SDK, i.e. `3.0.2`.
|
||
* @type {string}
|
||
*/
|
||
VERSION: string;
|
||
}
|
||
|
||
/**
|
||
* @class HostedFields
|
||
* @param {object} options The Hosted Fields {@link module:braintree-web/hosted-fields.create create} options.
|
||
* @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/hosted-fields.create|braintree-web.hosted-fields.create} instead.</strong>
|
||
* @classdesc This class represents a Hosted Fields component produced by {@link module:braintree-web/hosted-fields.create|braintree-web/hosted-fields.create}. Instances of this class have methods for interacting with the input fields within Hosted Fields' iframes.
|
||
*/
|
||
export class HostedFields {
|
||
/**
|
||
* @class HostedFields
|
||
* @param {object} options The Hosted Fields {@link module:braintree-web/hosted-fields.create create} options.
|
||
* @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/hosted-fields.create|braintree-web.hosted-fields.create} instead.</strong>
|
||
* @classdesc This class represents a Hosted Fields component produced by {@link module:braintree-web/hosted-fields.create|braintree-web/hosted-fields.create}. Instances of this class have methods for interacting with the input fields within Hosted Fields' iframes.
|
||
*/
|
||
constructor(options: any);
|
||
|
||
/**
|
||
* @name HostedFields#on
|
||
* @function
|
||
* @param {string} event The name of the event to which you are subscribing.
|
||
* @param {function} handler A callback to handle the event.
|
||
* @description Subscribes a handler function to a named event. `event` should be {@link HostedFields#event:blur|blur}, {@link HostedFields#event:focus|focus}, {@link HostedFields#event:empty|empty}, {@link HostedFields#event:notEmpty|notEmpty}, {@link HostedFields#event:cardTypeChange|cardTypeChange}, or {@link HostedFields#event:validityChange|validityChange}. Events will emit a {@link HostedFields~stateObject|stateObject}.
|
||
* @example
|
||
* <caption>Listening to a Hosted Field event, in this case 'focus'</caption>
|
||
* hostedFields.create({ ... }, function (createErr, hostedFieldsInstance) {
|
||
* hostedFieldsInstance.on('focus', function (event) {
|
||
* console.log(event.emittedBy, 'has been focused');
|
||
* });
|
||
* });
|
||
* @returns {void}
|
||
*/
|
||
on(event: string, handler: (() => any)): void;
|
||
|
||
/**
|
||
* Cleanly tear down anything set up by {@link module:braintree-web/hosted-fields.create|create}
|
||
* @public
|
||
* @param {callback} [callback] Callback executed on completion, containing an error if one occurred. No data is returned if teardown completes successfully.
|
||
* @example
|
||
* hostedFieldsInstance.teardown(function (teardownErr) {
|
||
* if (teardownErr) {
|
||
* console.error('Could not tear down Hosted Fields!');
|
||
* } else {
|
||
* console.info('Hosted Fields has been torn down!');
|
||
* }
|
||
* });
|
||
* @returns {void}
|
||
*/
|
||
public teardown(callback?: callback): void;
|
||
|
||
/**
|
||
* Tokenizes fields and returns a nonce payload.
|
||
* @public
|
||
* @param {object} [options] All tokenization options for the Hosted Fields component.
|
||
* @param {boolean} [options.vault=false] When true, will vault the tokenized card. Cards will only be vaulted when using a client created with a client token that includes a customer ID.
|
||
* @param {callback} callback The second argument, <code>data</code>, is a {@link HostedFields~tokenizePayload|tokenizePayload}
|
||
* @example <caption>Tokenize a card</caption>
|
||
* hostedFieldsInstance.tokenize(function (tokenizeErr, payload) {
|
||
* if (tokenizeErr) {
|
||
* switch (tokenizeErr.code) {
|
||
* case 'HOSTED_FIELDS_FIELDS_EMPTY':
|
||
* console.error('All fields are empty! Please fill out the form.');
|
||
* break;
|
||
* case 'HOSTED_FIELDS_FIELDS_INVALID':
|
||
* console.error('Some fields are invalid:', tokenizeErr.details.invalidFieldKeys);
|
||
* break;
|
||
* case 'HOSTED_FIELDS_FAILED_TOKENIZATION':
|
||
* console.error('Tokenization failed server side. Is the card valid?');
|
||
* break;
|
||
* case 'HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR':
|
||
* console.error('Network error occurred when tokenizing.');
|
||
* break;
|
||
* default:
|
||
* console.error('Something bad happened!', tokenizeErr);
|
||
* }
|
||
* } else {
|
||
* console.log('Got nonce:', payload.nonce);
|
||
* }
|
||
* });
|
||
* @example <caption>Tokenize and vault a card</caption>
|
||
* hostedFieldsInstance.tokenize({
|
||
* vault: true
|
||
* }, function (tokenizeErr, payload) {
|
||
* if (tokenizeErr) {
|
||
* console.error(tokenizeErr);
|
||
* } else {
|
||
* console.log('Got nonce:', payload.nonce);
|
||
* }
|
||
* });
|
||
* @returns {void}
|
||
*/
|
||
public tokenize(options?: { vault: boolean }, callback?: callback): void;
|
||
|
||
/**
|
||
* Add a class to a {@link module:braintree-web/hosted-fields~field field}. Useful for updating field styles when events occur elsewhere in your checkout.
|
||
* @public
|
||
* @param {string} field The field you wish to add a class to. Must be a valid {@link module:braintree-web/hosted-fields~fieldOptions fieldOption}.
|
||
* @param {string} classname The class to be added.
|
||
* @param {callback} [callback] Callback executed on completion, containing an error if one occurred. No data is returned if the class is added successfully.
|
||
*
|
||
* @example
|
||
* hostedFieldsInstance.addClass('number', 'custom-class', function (addClassErr) {
|
||
* if (addClassErr) {
|
||
* console.error(addClassErr);
|
||
* }
|
||
* });
|
||
* @returns {void}
|
||
*/
|
||
public addClass(field: string, classname: string, callback?: callback): void;
|
||
|
||
/**
|
||
* Removes a class to a {@link module:braintree-web/hosted-fields~field field}. Useful for updating field styles when events occur elsewhere in your checkout.
|
||
* @public
|
||
* @param {string} field The field you wish to remove a class from. Must be a valid {@link module:braintree-web/hosted-fields~fieldOptions fieldOption}.
|
||
* @param {string} classname The class to be removed.
|
||
* @param {callback} [callback] Callback executed on completion, containing an error if one occurred. No data is returned if the class is removed successfully.
|
||
*
|
||
* @example
|
||
* hostedFieldsInstance.addClass('number', 'custom-class', function (addClassErr) {
|
||
* if (addClassErr) {
|
||
* console.error(addClassErr);
|
||
* return;
|
||
* }
|
||
*
|
||
* // some time later...
|
||
* hostedFieldsInstance.removeClass('number', 'custom-class');
|
||
* });
|
||
* @returns {void}
|
||
*/
|
||
public removeClass(field: string, classname: string, callback?: callback): void;
|
||
|
||
/**
|
||
* Sets the placeholder of a {@link module:braintree-web/hosted-fields~field field}.
|
||
* @public
|
||
* @param {string} field The field whose placeholder you wish to change. Must be a valid {@link module:braintree-web/hosted-fields~fieldOptions fieldOption}.
|
||
* @param {string} placeholder Will be used as the `placeholder` attribute of the input.
|
||
* @param {callback} [callback] Callback executed on completion, containing an error if one occurred. No data is returned if the placeholder updated successfully.
|
||
*
|
||
* @example
|
||
* hostedFieldsInstance.setPlaceholder('number', '4111 1111 1111 1111', function (placeholderErr) {
|
||
* if (placeholderErr) {
|
||
* console.error(placeholderErr);
|
||
* }
|
||
* });
|
||
*
|
||
* @example <caption>Update CVV field on card type change</caption>
|
||
* hostedFieldsInstance.on('cardTypeChange', function (event) {
|
||
* // Update the placeholder value if there is only one possible card type
|
||
* if (event.cards.length === 1) {
|
||
* hostedFields.setPlaceholder('cvv', event.cards[0].code.name, function (placeholderErr) {
|
||
* if (placeholderErr) {
|
||
* // Handle errors, such as invalid field name
|
||
* console.error(placeholderErr);
|
||
* }
|
||
* });
|
||
* }
|
||
* });
|
||
* @returns {void}
|
||
*/
|
||
public setPlaceholder(field: string, placeholder: string, callback?: callback): void;
|
||
|
||
/**
|
||
* Clear the value of a {@link module:braintree-web/hosted-fields~field field}.
|
||
* @public
|
||
* @param {string} field The field whose placeholder you wish to clear. Must be a valid {@link module:braintree-web/hosted-fields~fieldOptions fieldOption}.
|
||
* @param {callback} [callback] Callback executed on completion, containing an error if one occurred. No data is returned if the field cleared successfully.
|
||
* @returns {void}
|
||
* @example
|
||
* hostedFieldsInstance.clear('number', function (clearErr) {
|
||
* if (clearErr) {
|
||
* console.error(clearErr);
|
||
* }
|
||
* });
|
||
*
|
||
* @example <caption>Clear several fields</caption>
|
||
* hostedFieldsInstance.clear('number');
|
||
* hostedFieldsInstance.clear('cvv');
|
||
* hostedFieldsInstance.clear('expirationDate');
|
||
*/
|
||
public clear(field: string, callback?: callback): void;
|
||
|
||
/**
|
||
* Returns an {@link HostedFields~stateObject|object} that includes the state of all fields and possible card types.
|
||
* @public
|
||
* @returns {object} {@link HostedFields~stateObject|stateObject}
|
||
* @example <caption>Check if all fields are valid</caption>
|
||
* var state = hostedFields.getState();
|
||
*
|
||
* var formValid = Object.keys(state.fields).every(function (key) {
|
||
* return state.fields[key].isValid;
|
||
* });
|
||
*/
|
||
public getState(): any;
|
||
}
|
||
}
|
||
|
||
/** @module braintree-web/paypal */
|
||
declare namespace BraintreeWeb {
|
||
/**
|
||
* @typedef {object} PayPal~tokenizeReturn
|
||
* @property {Function} close A handle to close the PayPal checkout flow.
|
||
*/
|
||
interface PayPalTokenizeReturn {
|
||
close: (() => any);
|
||
}
|
||
|
||
/**
|
||
* @typedef {object} PayPal~tokenizePayload
|
||
* @property {string} nonce The payment method nonce.
|
||
* @property {string} type The payment method type, always `PayPalAccount`.
|
||
* @property {object} details Additional PayPal account details.
|
||
* @property {string} details.email User's email address.
|
||
* @property {string} details.payerId User's payer ID, the unique identifier for each PayPal account.
|
||
* @property {string} details.firstName User's given name.
|
||
* @property {string} details.lastName User's surname.
|
||
* @property {?string} details.countryCode User's 2 character country code.
|
||
* @property {?string} details.phone User's phone number (e.g. 555-867-5309).
|
||
* @property {?object} details.shippingAddress User's shipping address details, only available if shipping address is enabled.
|
||
* @property {string} details.shippingAddress.recipientName Recipient of postage.
|
||
* @property {string} details.shippingAddress.line1 Street number and name.
|
||
* @property {string} details.shippingAddress.line2 Extended address.
|
||
* @property {string} details.shippingAddress.city City or locality.
|
||
* @property {string} details.shippingAddress.state State or region.
|
||
* @property {string} details.shippingAddress.postalCode Postal code.
|
||
* @property {string} details.shippingAddress.countryCode 2 character country code (e.g. US).
|
||
* @property {?object} details.billingAddress User's billing address details.
|
||
* You will also need to enable the PayPal Billing Address Request feature in your PayPal account.
|
||
* To enable this feature, [contact PayPal](https://developers.braintreepayments.com/support/guides/paypal/setup-guide#contacting-paypal-support).
|
||
* @property {string} details.billingAddress.line1 Street number and name.
|
||
* @property {string} details.billingAddress.line2 Extended address.
|
||
* @property {string} details.billingAddress.city City or locality.
|
||
* @property {string} details.billingAddress.state State or region.
|
||
* @property {string} details.billingAddress.postalCode Postal code.
|
||
* @property {string} details.billingAddress.countryCode 2 character country code (e.g. US).
|
||
*/
|
||
interface PayPalShippingAddress {
|
||
recipientName: string;
|
||
line1: string;
|
||
line2: string;
|
||
city: string;
|
||
state: string;
|
||
postalCode: string;
|
||
countryCode: string;
|
||
}
|
||
|
||
interface PayPalBillingAddress {
|
||
line1: string;
|
||
line2: string;
|
||
city: string;
|
||
state: string;
|
||
postalCode: string;
|
||
countryCode: string;
|
||
}
|
||
|
||
interface PayPalAccountDetails {
|
||
email: string;
|
||
payerId: string;
|
||
firstName: string;
|
||
lastName: string;
|
||
countryCode: string;
|
||
phone: string;
|
||
shippingAddress: PayPalShippingAddress;
|
||
billingAddress: PayPalBillingAddress;
|
||
}
|
||
|
||
interface PayPalTokenizePayload {
|
||
nonce: string;
|
||
type: string;
|
||
details: PayPalAccountDetails;
|
||
}
|
||
|
||
export interface PayPal {
|
||
/**
|
||
* @static
|
||
* @function create
|
||
* @param {object} options Creation options:
|
||
* @param {Client} options.client A {@link Client} instance.
|
||
* @param {callback} callback The second argument, `data`, is the {@link PayPal} instance.
|
||
* @example
|
||
* braintree.paypal.create(
|
||
* client: clientInstance
|
||
* }, function (createErr, paypalInstance) {
|
||
* if (createErr) {
|
||
* if (createErr.code === 'PAYPAL_BROWSER_NOT_SUPPORTED') {
|
||
* console.error('This browser is not supported.');
|
||
* } else {
|
||
* console.error('Error!', createErr);
|
||
* }
|
||
* }
|
||
* }
|
||
* @returns {void}
|
||
*/
|
||
create: (options: { client: Client }, callback: callback) => void;
|
||
|
||
/**
|
||
* @description The current version of the SDK, i.e. `3.0.2`.
|
||
* @type {string}
|
||
*/
|
||
VERSION: string;
|
||
}
|
||
|
||
/**
|
||
* @class
|
||
* @param {object} options see {@link module:braintree-web/paypal.create|paypal.create}
|
||
* @classdesc This class represents a PayPal component. Instances of this class have methods for launching auth dialogs and other programmatic interactions with the PayPal component.
|
||
*/
|
||
export class PayPal {
|
||
/**
|
||
* @class
|
||
* @param {object} options see {@link module:braintree-web/paypal.create|paypal.create}
|
||
* @classdesc This class represents a PayPal component. Instances of this class have methods for launching auth dialogs and other programmatic interactions with the PayPal component.
|
||
*/
|
||
constructor(options: any);
|
||
|
||
/**
|
||
* Launches the PayPal login flow and returns a nonce payload. Only one PayPal login flow should be active at a time. One way to achieve this is to disable your PayPal button while the flow is open.
|
||
* @public
|
||
* @param {object} options All tokenization options for the PayPal component.
|
||
* @param {string} options.flow Set to 'checkout' for one-time payment flow, or 'vault' for Vault flow. If 'vault' is used with a client token generated with a customer id, the PayPal account will be added to that customer as a saved payment method.
|
||
* @param {string} [options.intent=authorize]
|
||
* Checkout flows only.
|
||
* * `authorize` - Submits the transaction for authorization but not settlement.
|
||
* * `sale` - Payment will be immediately submitted for settlement upon creating a transaction.
|
||
* @param {boolean} [options.offerCredit=false] Offers the customer PayPal Credit if they qualify. Checkout flows only.
|
||
* @param {string} [options.useraction]
|
||
* Changes the call-to-action in the PayPal flow. By default the final button will show the localized
|
||
* word for "Continue" and implies that the final amount billed is not yet known.
|
||
*
|
||
* Setting this option to `commit` changes the button text to "Pay Now" and page text will convey to
|
||
* the user that billing will take place immediately.
|
||
* @param {string|number} [options.amount] The amount of the transaction. Required when using the Checkout flow.
|
||
* @param {string} [options.currency] The currency code of the amount, such as 'USD'. Required when using the Checkout flow.
|
||
* @param {string} [options.displayName] The merchant name displayed inside of the PayPal lightbox; defaults to the company name on your Braintree account
|
||
* @param {string} [options.locale=en_US] Use this option to change the language, links, and terminology used in the PayPal flow to suit the country and language of your customer.
|
||
* @param {boolean} [options.enableShippingAddress=false] Returns a shipping address object in {@link PayPal#tokenize}.
|
||
* @param {object} [options.shippingAddressOverride] Allows you to pass a shipping address you have already collected into the PayPal payment flow.
|
||
* @param {string} options.shippingAddressOverride.line1 Street address.
|
||
* @param {string} [options.shippingAddressOverride.line2] Street address (extended).
|
||
* @param {string} options.shippingAddressOverride.city City.
|
||
* @param {string} options.shippingAddressOverride.state State.
|
||
* @param {string} options.shippingAddressOverride.postalCode Postal code.
|
||
* @param {string} options.shippingAddressOverride.countryCode Country.
|
||
* @param {string} [options.shippingAddressOverride.phone] Phone number.
|
||
* @param {string} [options.shippingAddressOverride.recipientName] Recipient's name.
|
||
* @param {boolean} [options.shippingAddressEditable=true] Set to false to disable user editing of the shipping address.
|
||
* @param {string} [options.billingAgreementDescription] Use this option to set the description of the preapproved payment agreement visible to customers in their PayPal profile during Vault flows. Max 255 characters.
|
||
* @param {callback} callback The second argument, <code>data</code>, is a {@link PayPal~tokenizePayload|tokenizePayload}.
|
||
* @example
|
||
* button.addEventListener('click', function () {
|
||
* // Disable the button so that we don't attempt to open multiple popups.
|
||
* button.setAttribute('disabled', 'disabled');
|
||
*
|
||
* // Because PayPal tokenization opens a popup, this must be called
|
||
* // as a result of a user action, such as a button click.
|
||
* paypalInstance.tokenize({
|
||
* flow: 'vault' // Required
|
||
* // Any other tokenization options
|
||
* }, function (tokenizeErr, payload) {
|
||
* button.removeAttribute('disabled');
|
||
*
|
||
* if (tokenizeErr) {
|
||
* // Handle tokenization errors or premature flow closure
|
||
*
|
||
* switch (tokenizeErr.code) {
|
||
* case 'PAYPAL_POPUP_CLOSED':
|
||
* console.error('Customer closed PayPal popup.');
|
||
* break;
|
||
* case 'PAYPAL_ACCOUNT_TOKENIZATION_FAILED':
|
||
* console.error('PayPal tokenization failed. See details:', tokenizeErr.details);
|
||
* break;
|
||
* case 'PAYPAL_FLOW_FAILED':
|
||
* console.error('Unable to initialize PayPal flow. Are your options correct?', tokenizeErr.details);
|
||
* break;
|
||
* default:
|
||
* console.error('Error!', tokenizeErr);
|
||
* }
|
||
* } else {
|
||
* // Submit payload.nonce to your server
|
||
* }
|
||
* });
|
||
* });
|
||
* @returns {PayPal~tokenizeReturn} A handle to close the PayPal checkout frame.
|
||
*/
|
||
public tokenize(options: { flow: string, intent: string, offerCredit: boolean, useraction: string, amount: (string | number), currency: string, displayName: string, locale: string, enableShippingAddress: boolean, shippingAddressOverride: PayPalShippingAddress, shippingAddressEditable: boolean, billingAgreementDescription: string }, callback: callback): PayPalTokenizeReturn;
|
||
|
||
/**
|
||
* Cleanly tear down anything set up by {@link module:braintree-web/paypal.create|create}.
|
||
* @public
|
||
* @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.
|
||
* @returns {void}
|
||
*/
|
||
public teardown(callback?: () => void): void;
|
||
|
||
}
|
||
}
|
||
|
||
/** @module braintree-web/three-d-secure */
|
||
declare namespace BraintreeWeb {
|
||
/**
|
||
* @typedef {object} ThreeDSecure~verifyPayload
|
||
* @property {string} nonce The new payment method nonce produced by the 3D Secure lookup. The original nonce passed into {@link ThreeDSecure#verifyCard|verifyCard} was consumed. This new nonce should be used to transact on your server.
|
||
* @property {object} details Additional account details.
|
||
* @property {string} details.cardType Type of card, ex: Visa, MasterCard.
|
||
* @property {string} details.lastTwo Last two digits of card number.
|
||
* @property {string} description A human-readable description.
|
||
* @property {boolean} liabilityShiftPossible Indicates whether the card was eligible for 3D Secure.
|
||
* @property {boolean} liabilityShifted Indicates whether the liability for fraud has been shifted away from the merchant.
|
||
*/
|
||
interface ThreeDSecureAccountDetails {
|
||
cardType: string;
|
||
lastTwo: string;
|
||
}
|
||
|
||
interface ThreeDSecureVerifyPayload {
|
||
nonce: string;
|
||
details: ThreeDSecureAccountDetails;
|
||
description: string;
|
||
liabilityShiftPossible: boolean;
|
||
liabilityShifted: boolean;
|
||
}
|
||
|
||
export interface ThreeDSecure {
|
||
/**
|
||
* @static
|
||
* @function create
|
||
* @param {object} options Creation options:
|
||
* @param {Client} options.client A {@link Client} instance.
|
||
* @param {callback} callback The second argument, `data`, is the {@link ThreeDSecure} instance.
|
||
* @returns {void}
|
||
* @example
|
||
* braintree.threeDSecure.create({
|
||
* client: client
|
||
* }, callback);
|
||
*/
|
||
create: (options: { client: Client }, callback: callback) => void;
|
||
|
||
/**
|
||
* @description The current version of the SDK, i.e. `3.0.2`.
|
||
* @type {string}
|
||
*/
|
||
VERSION: string;
|
||
}
|
||
|
||
/**
|
||
* @class
|
||
* @param {object} options 3D Secure {@link module:braintree-web/three-d-secure.create create} options
|
||
* @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/three-d-secure.create|braintree.threeDSecure.create} instead.</strong>
|
||
* @classdesc This class represents a ThreeDSecure component produced by {@link module:braintree-web/three-d-secure.create|braintree.threeDSecure.create}. Instances of this class have a method for launching a 3D Secure authentication flow.
|
||
*/
|
||
export class ThreeDSecure {
|
||
/**
|
||
* @class
|
||
* @param {object} options 3D Secure {@link module:braintree-web/three-d-secure.create create} options
|
||
* @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/three-d-secure.create|braintree.threeDSecure.create} instead.</strong>
|
||
* @classdesc This class represents a ThreeDSecure component produced by {@link module:braintree-web/three-d-secure.create|braintree.threeDSecure.create}. Instances of this class have a method for launching a 3D Secure authentication flow.
|
||
*/
|
||
constructor(options: any);
|
||
|
||
|
||
/**
|
||
* @callback ThreeDSecure~addFrameCallback
|
||
* @param {?BraintreeError} [err] `null` or `undefined` if there was no error.
|
||
* @param {HTMLIFrameElement} iframe An iframe element containing the bank's authentication page that you must put on your page.
|
||
* @description The callback used for options.addFrame in {@link ThreeDSecure#verifyCard|verifyCard}.
|
||
* @returns {void}
|
||
*/
|
||
addFrameCallback: (err?: BraintreeError, iframe?: HTMLIFrameElement) => void;
|
||
|
||
/**
|
||
* @callback ThreeDSecure~removeFrameCallback
|
||
* @description The callback used for options.removeFrame in {@link ThreeDSecure#verifyCard|verifyCard}.
|
||
* @returns {void}
|
||
*/
|
||
removeFrameCallback: () => void;
|
||
|
||
/**
|
||
* Launch the 3D Secure login flow, returning a nonce payload.
|
||
* @public
|
||
* @param {object} options Options for card verification.
|
||
* @param {string} options.nonce A nonce referencing the card to be verified. For example, this can be a nonce that was returned by Hosted Fields.
|
||
* @param {number} options.amount The amount of the transaction in the current merchant account's currency. For example, if you are running a transaction of $123.45 US dollars, `amount` would be 123.45.
|
||
* @param {errback} options.addFrame This {@link ThreeDSecure~addFrameCallback|addFrameCallback} will be called when the bank frame needs to be added to your page.
|
||
* @param {callback} options.removeFrame This {@link ThreeDSecure~removeFrameCallback|removeFrameCallback} will be called when the bank frame needs to be removed from your page.
|
||
* @param {errback} callback The second argument, <code>data</code>, is a {@link ThreeDSecure~verifyPayload|verifyPayload}
|
||
* @returns {void}
|
||
* @example
|
||
* <caption>Verifying an existing nonce with 3DS</caption>
|
||
* var my3DSContainer;
|
||
*
|
||
* threeDSecure.verifyCard({
|
||
* nonce: existingNonce,
|
||
* amount: 123.45,
|
||
* addFrame: function (err, iframe) {
|
||
* // Set up your UI and add the iframe.
|
||
* my3DSContainer = document.createElement('div');
|
||
* my3DSContainer.appendChild(iframe);
|
||
* document.body.appendChild(my3DSContainer);
|
||
* },
|
||
* removeFrame: function () {
|
||
* // Remove UI that you added in addFrame.
|
||
* document.body.removeChild(my3DSContainer);
|
||
* }
|
||
* }, function (err, payload) {
|
||
* if (err) {
|
||
* console.error(err);
|
||
* return;
|
||
* }
|
||
*
|
||
* if (payload.liabilityShifted) {
|
||
* // Liablity has shifted
|
||
* submitNonceToServer(payload.nonce);
|
||
* } else if (payload.liabilityShiftPossible) {
|
||
* // Liablity may still be shifted
|
||
* // Decide if you want to submit the nonce
|
||
* } else {
|
||
* // Liablity has not shifted and will not shift
|
||
* // Decide if you want to submit the nonce
|
||
* }
|
||
* });
|
||
*/
|
||
public verifyCard(options: { nonce: string, amount: number, addFrame: (err?: BraintreeError, iframe?: HTMLIFrameElement) => void, removeFrame: () => void }, callback: callback): void;
|
||
|
||
/**
|
||
* Cancel the 3DS flow and return the verification payload if available.
|
||
* @public
|
||
* @param {errback} callback The second argument is a {@link ThreeDSecure~verifyPayload|verifyPayload}. If there is no verifyPayload (the initial lookup did not complete), an error will be returned.
|
||
* @returns {void}
|
||
* @example
|
||
* threeDSecure.cancelVerifyCard(function (err, verifyPayload) {
|
||
* if (err) {
|
||
* // Handle error
|
||
* console.log(err.message); // No verification payload available
|
||
* return;
|
||
* }
|
||
*
|
||
* verifyPayload.nonce; // The nonce returned from the 3ds lookup call
|
||
* verifyPayload.liabilityShifted; // boolean
|
||
* verifyPayload.liabilityShiftPossible; // boolean
|
||
* });
|
||
*/
|
||
public cancelVerifyCard(callback: callback): void;
|
||
|
||
/**
|
||
* Cleanly tear down anything set up by {@link module:braintree-web/three-d-secure.create|create}
|
||
* @public
|
||
* @param {errback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.
|
||
* @returns {void}
|
||
*/
|
||
public teardown(callback?: callback): void;
|
||
}
|
||
}
|
||
|
||
/**
|
||
* @module braintree-web/unionpay
|
||
* @description This module allows you to accept UnionPay payments. *It is currently in beta and is subject to change.*
|
||
*/
|
||
declare namespace BraintreeWeb {
|
||
/**
|
||
* @typedef {object} UnionPay~tokenizePayload
|
||
* @property {string} nonce The payment method nonce.
|
||
* @property {string} type Always <code>CreditCard</code>.
|
||
* @property {object} details Additional account details:
|
||
* @property {string} details.cardType Type of card, ex: Visa, MasterCard.
|
||
* @property {string} details.lastTwo Last two digits of card number.
|
||
* @property {string} description A human-readable description.
|
||
*/
|
||
interface UnionPayAccountDetails {
|
||
cardType: string;
|
||
lastTwo: string;
|
||
description: string;
|
||
}
|
||
|
||
interface UnionPayTokenizePayload {
|
||
nonce: string;
|
||
type: string;
|
||
details: UnionPayAccountDetails;
|
||
}
|
||
|
||
/**
|
||
* @typedef {object} UnionPay~enrollPayload
|
||
* @property {string} enrollmentId UnionPay enrollment ID. This value should be passed to `tokenize`.
|
||
* @property {boolean} smsCodeRequired UnionPay `smsCodeRequired` flag.
|
||
* </p><b>true</b> - the user will receive an SMS code that needs to be supplied for tokenization.
|
||
* </p><b>false</b> - the card can be immediately tokenized.
|
||
*/
|
||
interface UnionPayEnrollPayload {
|
||
enrollmentId: string;
|
||
smsCodeRequired: boolean;
|
||
}
|
||
|
||
/**
|
||
* @typedef {object} UnionPay~fetchCapabilitiesPayload
|
||
* @property {boolean} isUnionPay Determines if this card is a UnionPay card.
|
||
* @property {boolean} isDebit Determines if this card is a debit card. This property is only present if `isUnionPay` is `true`.
|
||
* @property {object} unionPay UnionPay specific properties. This property is only present if `isUnionPay` is `true`.
|
||
* @property {boolean} unionPay.supportsTwoStepAuthAndCapture Determines if the card allows for an authorization, but settling the transaction later.
|
||
* @property {boolean} unionPay.isSupported Determines if Braintree can process this UnionPay card. When false, Braintree cannot process this card and the user should use a different card.
|
||
*/
|
||
|
||
interface UnionPayProperties {
|
||
supportsTwoStepAuthAndCapture: boolean;
|
||
isSupported: boolean;
|
||
}
|
||
|
||
interface UnionPayFetchCapabilitiesPayload {
|
||
isUnionPay: boolean;
|
||
isDebit: boolean;
|
||
unionPay: UnionPayProperties;
|
||
}
|
||
|
||
export interface UnionPay {
|
||
/**
|
||
* @static
|
||
* @function create
|
||
* @param {object} options Creation options:
|
||
* @param {Client} options.client A {@link Client} instance.
|
||
* @param {callback} callback The second argument, `data`, is the {@link UnionPay} instance.
|
||
* @returns {void}
|
||
* @example
|
||
* braintree.unionpay.create({ client: clientInstance }, function (createErr, unionpayInstance) {
|
||
* if (createErr) {
|
||
* console.error(createErr);
|
||
* return;
|
||
* }
|
||
* // ...
|
||
* });
|
||
*/
|
||
create: (options: { client: Client }, callback: callback) => void;
|
||
|
||
/**
|
||
* @description The current version of the SDK, i.e. `3.0.2`.
|
||
* @type {string}
|
||
*/
|
||
VERSION: string;
|
||
}
|
||
|
||
/**
|
||
* @class
|
||
* @param {object} options See {@link module:braintree-web/unionpay.create|unionpay.create}.
|
||
* @description <strong>You cannot use this constructor directly. Use {@link module:braintree-web/unionpay.create|braintree-web.unionpay.create} instead.</strong>
|
||
* @classdesc This class represents a UnionPay component. Instances of this class have methods for {@link UnionPay#fetchCapabilities fetching capabilities} of UnionPay cards, {@link UnionPay#enroll enrolling} a UnionPay card, and {@link UnionPay#tokenize tokenizing} a UnionPay card.
|
||
*/
|
||
export class UnionPay {
|
||
/**
|
||
* @class
|
||
* @param {object} options See {@link module:braintree-web/unionpay.create|unionpay.create}.
|
||
* @description <strong>You cannot use this constructor directly. Use {@link module:braintree-web/unionpay.create|braintree-web.unionpay.create} instead.</strong>
|
||
* @classdesc This class represents a UnionPay component. Instances of this class have methods for {@link UnionPay#fetchCapabilities fetching capabilities} of UnionPay cards, {@link UnionPay#enroll enrolling} a UnionPay card, and {@link UnionPay#tokenize tokenizing} a UnionPay card.
|
||
*/
|
||
constructor(options: any);
|
||
|
||
/**
|
||
* Fetches the capabilities of a card, including whether or not the SMS enrollment process is required.
|
||
* @public
|
||
* @param {object} options UnionPay {@link UnionPay#fetchCapabilities fetchCapabilities} options
|
||
* @param {object} [options.card] The card from which to fetch capabilities. Note that this will only have one property, `number`. Required if you are not using the `hostedFields` option.
|
||
* @param {string} options.card.number Card number.
|
||
* @param {HostedFields} [options.hostedFields] The Hosted Fields instance used to collect card data. Required if you are not using the `card` option.
|
||
* @param {callback} callback The second argument, <code>data</code>, is a {@link UnionPay#fetchCapabilitiesPayload fetchCapabilitiesPayload}.
|
||
* @example <caption>With raw card data</caption>
|
||
* unionpayInstance.fetchCapabilities({
|
||
* card: {
|
||
* number: '4111111111111111'
|
||
* }
|
||
* }, function (fetchErr, cardCapabilities) {
|
||
* if (fetchErr) {
|
||
* console.error(fetchErr);
|
||
* return;
|
||
* }
|
||
*
|
||
* if (cardCapabilities.isUnionPay) {
|
||
* if (cardCapabilities.unionPay && !cardCapabilities.unionPay.isSupported) {
|
||
* // Braintree cannot process this UnionPay card.
|
||
* // Ask the user for a different card.
|
||
* return;
|
||
* }
|
||
*
|
||
* if (cardCapabilities.isDebit) {
|
||
* // CVV and expiration date are not required
|
||
* } else {
|
||
* // CVV and expiration date are required
|
||
* }
|
||
*
|
||
* // Show mobile phone number field for enrollment
|
||
* }
|
||
* });
|
||
* @example <caption>With Hosted Fields</caption>
|
||
* // Fetch capabilities on `blur` inside of the Hosted Fields `create` callback
|
||
* hostedFieldsInstance.on('blur', function (event) {
|
||
* // Only attempt to fetch capabilities when a valid card number has been entered
|
||
* if (event.emittedBy === 'number' && event.fields.number.isValid) {
|
||
* unionpayInstance.fetchCapabilities({
|
||
* hostedFields: hostedFieldsInstance
|
||
* }, function (fetchErr, cardCapabilities) {
|
||
* if (fetchErr) {
|
||
* console.error(fetchErr);
|
||
* return;
|
||
* }
|
||
*
|
||
* if (cardCapabilities.isUnionPay) {
|
||
* if (cardCapabilities.unionPay && !cardCapabilities.unionPay.isSupported) {
|
||
* // Braintree cannot process this UnionPay card.
|
||
* // Ask the user for a different card.
|
||
* return;
|
||
* }
|
||
* if (cardCapabilities.isDebit) {
|
||
* // CVV and expiration date are not required
|
||
* // Hide the containers with your `cvv` and `expirationDate` fields
|
||
* } else {
|
||
* // CVV and expiration date are required
|
||
* }
|
||
* } else {
|
||
* // Not a UnionPay card
|
||
* // When form is complete, tokenize using your Hosted Fields instance
|
||
* }
|
||
*
|
||
* // Show your own mobile country code and phone number inputs for enrollment
|
||
* });
|
||
* });
|
||
* });
|
||
* @returns {void}
|
||
*/
|
||
public fetchCapabilities(options: { card: any, hostedFields: HostedFields }, callback: callback): void;
|
||
|
||
/**
|
||
* Enrolls a UnionPay card. Use {@link UnionPay#fetchCapabilities|fetchCapabilities} to determine if the SMS enrollment process is required.
|
||
* @public
|
||
* @param {object} options UnionPay enrollment options:
|
||
* @param {object} [options.card] The card to enroll. Required if you are not using the `hostedFields` option.
|
||
* @param {string} options.card.number The card number.
|
||
* @param {string} [options.card.expirationDate] The card's expiration date. May be in the form `MM/YY` or `MM/YYYY`. When defined `expirationMonth` and `expirationYear` are ignored.
|
||
* @param {string} [options.card.expirationMonth] The card's expiration month. This should be used with the `expirationYear` parameter. When `expirationDate` is defined this parameter is ignored.
|
||
* @param {string} [options.card.expirationYear] The card's expiration year. This should be used with the `expirationMonth` parameter. When `expirationDate` is defined this parameter is ignored.
|
||
* @param {HostedFields} [options.hostedFields] The Hosted Fields instance used to collect card data. Required if you are not using the `card` option.
|
||
* @param {object} options.mobile The mobile information collected from the customer.
|
||
* @param {string} options.mobile.countryCode The country code of the customer's mobile phone number.
|
||
* @param {string} options.mobile.number The customer's mobile phone number.
|
||
* @param {callback} callback The second argument, <code>data</code>, is a {@link UnionPay~enrollPayload|enrollPayload}.
|
||
* @example <caption>With raw card data</caption>
|
||
* unionpayInstance.enroll({
|
||
* card: {
|
||
* number: '4111111111111111',
|
||
* expirationMonth: '12',
|
||
* expirationYear: '2038'
|
||
* },
|
||
* mobile: {
|
||
* countryCode: '62',
|
||
* number: '111111111111'
|
||
* }
|
||
* }, function (enrollErr, response) {
|
||
* if (enrollErr) {
|
||
* console.error(enrollErr);
|
||
* return;
|
||
* }
|
||
*
|
||
* if (response.smsCodeRequired) {
|
||
* // If smsCodeRequired, wait for SMS auth code from customer
|
||
* // Then use response.enrollmentId during {@link UnionPay#tokenize}
|
||
* } else {
|
||
* // SMS code is not required from the user.
|
||
* // {@link UnionPay#tokenize} can be called immediately
|
||
* });
|
||
* @example <caption>With Hosted Fields</caption>
|
||
* unionpayInstance.enroll({
|
||
* hostedFields: hostedFields,
|
||
* mobile: {
|
||
* countryCode: '62',
|
||
* number: '111111111111'
|
||
* }
|
||
* }, function (enrollErr, response) {
|
||
* if (enrollErr) {
|
||
* console.error(enrollErr);
|
||
* return;
|
||
* }
|
||
*
|
||
* if (response.smsCodeRequired) {
|
||
* // If smsCodeRequired, wait for SMS auth code from customer
|
||
* // Then use response.enrollmentId during {@link UnionPay#tokenize}
|
||
* } else {
|
||
* // SMS code is not required from the user.
|
||
* // {@link UnionPay#tokenize} can be called immediately
|
||
* }
|
||
* });
|
||
* @returns {void}
|
||
*/
|
||
public enroll(options: { card: any, hostedFields: HostedFields, mobile: any }, callback: callback): void;
|
||
|
||
/**
|
||
* Tokenizes a UnionPay card and returns a nonce payload.
|
||
* @public
|
||
* @param {object} options UnionPay tokenization options:
|
||
* @param {object} [options.card] The card to enroll. Required if you are not using the `hostedFields` option.
|
||
* @param {string} options.card.number The card number.
|
||
* @param {string} [options.card.expirationDate] The card's expiration date. May be in the form `MM/YY` or `MM/YYYY`. When defined `expirationMonth` and `expirationYear` are ignored.
|
||
* @param {string} [options.card.expirationMonth] The card's expiration month. This should be used with the `expirationYear` parameter. When `expirationDate` is defined this parameter is ignored.
|
||
* @param {string} [options.card.expirationYear] The card's expiration year. This should be used with the `expirationMonth` parameter. When `expirationDate` is defined this parameter is ignored.
|
||
* @param {string} [options.card.cvv] The card's security number.
|
||
* @param {HostedFields} [options.hostedFields] The Hosted Fields instance used to collect card data. Required if you are not using the `card` option.
|
||
* @param {string} options.enrollmentId The enrollment ID from {@link UnionPay#enroll}.
|
||
* @param {string} [options.smsCode] The SMS code received from the user if {@link UnionPay#enroll} payload have `smsCodeRequired`. if `smsCodeRequired` is false, smsCode should not be passed.
|
||
* @param {callback} callback The second argument, <code>data</code>, is a {@link UnionPay~tokenizePayload|tokenizePayload}.
|
||
* @example <caption>With raw card data</caption>
|
||
* unionpayInstance.tokenize({
|
||
* card: {
|
||
* number: '4111111111111111',
|
||
* expirationMonth: '12',
|
||
* expirationYear: '2038',
|
||
* cvv: '123'
|
||
* },
|
||
* enrollmentId: enrollResponse.enrollmentId, // Returned from enroll
|
||
* smsCode: '11111' // Received by customer's phone, if SMS enrollment was required. Otherwise it should be omitted
|
||
* }, function (tokenizeErr, response) {
|
||
* if (tokenizeErr) {
|
||
* console.error(tokenizeErr);
|
||
* return;
|
||
* }
|
||
*
|
||
* // Send response.nonce to your server
|
||
* });
|
||
* @example <caption>With Hosted Fields</caption>
|
||
* unionpayInstance.tokenize({
|
||
* hostedFields: hostedFieldsInstance,
|
||
* enrollmentId: enrollResponse.enrollmentId, // Returned from enroll
|
||
* smsCode: '11111' // Received by customer's phone, if SMS enrollment was required. Otherwise it should be omitted
|
||
* }, function (tokenizeErr, response) {
|
||
* if (tokenizeErr) {
|
||
* console.error(tokenizeErr);
|
||
* return;
|
||
* }
|
||
*
|
||
* // Send response.nonce to your server
|
||
* });
|
||
* @returns {void}
|
||
*/
|
||
public tokenize(options: { card: any, hostedFields: HostedFields, enrollmentId: string, smsCode: string }, callback: callback): void;
|
||
|
||
/**
|
||
* Cleanly tear down anything set up by {@link module:braintree-web/unionpay.create|create}. This only needs to be called when using UnionPay with Hosted Fields.
|
||
* @public
|
||
* @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.
|
||
* @example
|
||
* unionpayInstance.teardown(function (teardownErr) {
|
||
* if (teardownErr) {
|
||
* console.error('Could not tear down UnionPay.');
|
||
* } else {
|
||
* console.log('UnionPay has been torn down.');
|
||
* }
|
||
* });
|
||
* @returns {void}
|
||
*/
|
||
public teardown(callback?: callback): void;
|
||
|
||
}
|
||
}
|
||
|
||
declare namespace BraintreeError {
|
||
/**
|
||
* Enum for {@link BraintreeError} types.
|
||
* @name BraintreeError.types
|
||
* @enum
|
||
* @readonly
|
||
* @memberof BraintreeError
|
||
* @property {string} CUSTOMER An error caused by the customer.
|
||
* @property {string} MERCHANT An error that is actionable by the merchant.
|
||
* @property {string} NETWORK An error due to a network problem.
|
||
* @property {string} INTERNAL An error caused by Braintree code.
|
||
* @property {string} UNKNOWN An error where the origin is unknown.
|
||
*/
|
||
export enum Types {
|
||
CUSTOMER,
|
||
MERCHANT,
|
||
NETWORK,
|
||
INTERNAL,
|
||
UNKNOWN
|
||
}
|
||
}
|
||
|
||
/**
|
||
* @class
|
||
* @global
|
||
* @param {object} options Construction options
|
||
* @classdesc This class is used to report error conditions, frequently as the first parameter to callbacks throughout the Braintree SDK.
|
||
* @description <strong>You cannot use this constructor directly. Interact with instances of this class through {@link callback callbacks}.</strong>
|
||
*/
|
||
declare class BraintreeError {
|
||
/**
|
||
* @class
|
||
* @global
|
||
* @param {object} options Construction options
|
||
* @classdesc This class is used to report error conditions, frequently as the first parameter to callbacks throughout the Braintree SDK.
|
||
* @description <strong>You cannot use this constructor directly. Interact with instances of this class through {@link callback callbacks}.</strong>
|
||
*/
|
||
constructor(options: any);
|
||
|
||
/**
|
||
* @type {string}
|
||
* @description A code that corresponds to specific errors.
|
||
*/
|
||
code: string;
|
||
|
||
/**
|
||
* @type {string}
|
||
* @description A short description of the error.
|
||
*/
|
||
message: string;
|
||
|
||
/**
|
||
* @type {BraintreeError.types}
|
||
* @description The type of error.
|
||
*/
|
||
type: BraintreeError.Types;
|
||
|
||
/**
|
||
* @type {object=}
|
||
* @description Additional information about the error, such as an underlying network error response.
|
||
*/
|
||
details: any;
|
||
}
|
||
|
||
declare namespace BraintreeWeb {
|
||
/**
|
||
* @global
|
||
* @callback callback
|
||
* @param {?BraintreeError} [err] `null` or `undefined` if there was no error.
|
||
* @param {?any} [data] The successful result of the asynchronous function call (if data exists).
|
||
* @description The Node.js-style callback pattern used throughout the SDK.
|
||
* @returns {void}
|
||
*/
|
||
type callback = (err?: BraintreeError, data?: any) => void;
|
||
}
|
||
|
||
/**
|
||
* @module braintree-web
|
||
* @description This is the top-level module exported by the Braintree JavaScript SDK. In a browser environment, this will be the global <code>braintree</code> object. In a CommonJS environment (like Browserify or Webpack), it will be the default export of the <code>braintree-web</code> package. In AMD environments (like RequireJS), it can be `require`d like other modules.
|
||
* @example
|
||
* <caption>CommonJS</caption>
|
||
* var braintree = require('braintree-web');
|
||
*
|
||
* braintree.client.create(...);
|
||
* @example
|
||
* <caption>In the browser</caption>
|
||
* <script src="https://js.braintreegateway.com/web/3.0.2/js/client.min.js"></script>
|
||
* <script>
|
||
* window.braintree.client.create(...);
|
||
* </script>
|
||
* @example
|
||
* <caption>AMD</caption>
|
||
* // main.js
|
||
* require.config({
|
||
* paths: {
|
||
* braintreeClient: 'https://js.braintreegateway.com/web/3.0.2/js/client.min'
|
||
* }
|
||
* });
|
||
*
|
||
* require(['braintreeClient'], function (braintreeClient) {
|
||
* braintreeClient.create(...);
|
||
* });
|
||
*/
|
||
interface BraintreeStatic {
|
||
/** @type {module:braintree-web/client} */
|
||
client: BraintreeWeb.Client;
|
||
|
||
/** @type {module:braintree-web/paypal} */
|
||
paypal: BraintreeWeb.PayPal;
|
||
|
||
/** @type {module:braintree-web/hosted-fields} */
|
||
hostedFields: BraintreeWeb.HostedFields;
|
||
|
||
/** @type {module:braintree-web/three-d-secure} */
|
||
threeDSecure: BraintreeWeb.ThreeDSecure;
|
||
|
||
/** @type {module:braintree-web/data-collector} */
|
||
dataCollector: BraintreeWeb.DataCollector;
|
||
|
||
/** @type {module:braintree-web/american-express} */
|
||
americanExpress: BraintreeWeb.AmericanExpress;
|
||
|
||
/** @type {module:braintree-web/unionpay} */
|
||
unionpay: BraintreeWeb.UnionPay;
|
||
|
||
/** @type {module:braintree-web/apple-pay} */
|
||
applePay: BraintreeWeb.ApplePay;
|
||
|
||
/**
|
||
* @description The current version of the SDK, i.e. `3.0.2`.
|
||
* @type {string}
|
||
*/
|
||
VERSION: string;
|
||
}
|
||
|
||
declare var braintree: BraintreeStatic; |