<commit_before>// Type definitions for cordova-plugin-braintree 0.5.1
// Project: https://github.com/taracque/cordova-plugin-braintree
// Definitions by: <NAME> <https://github.com/Justin-Credible>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

declare module BraintreePlugin {

    interface BraintreePluginStatic {

        /**
         * Used to initialize the Braintree client.
         * 
         * The client must be initialized before other methods can be used.
         * 
         * @param token The client token or tokenization key to use with the Braintree client.
         * @param successCallback The success callback for this asynchronous function.
         * @param failureCallback The failure callback for this asynchronous function; receives an error string.
         */
        initialize(token: string, successCallback?: () => void, failureCallback?: (error: string) => void): void;

        /**
         * Shows Braintree's drop-in payment UI.
         * 
         * @param successCallback The success callback for this asynchronous function; receives a result object.
         * @param failureCallback The failure callback for this asynchronous function; receives an error string.
         */
        setupApplePay(options?: ApplePayOptions, successCallback?: () => void, failureCallback?: (error: string) => void): void;

        /**
         * Shows Braintree's drop-in payment UI.
         * 
         * @param successCallback The success callback for this asynchronous function; receives a result object.
         * @param failureCallback The failure callback for this asynchronous function; receives an error string.
         */
        presentDropInPaymentUI(options?: PaymentUIOptions, successCallback?: (result: PaymentUIResult) => void, failureCallback?: (error: string) => void): void;
    }

    /**
     * Options for the setupApplePay method.
     */
    interface ApplePayOptions {
        /**
         * Apple Merchant ID can be obtained from Apple.
         */
        merchantId: string;
        
        /**
         * 3 letter currency code ISO 4217
         */
        currencyCode: string;
        
        /**
         * 2 letter country code ISO 3166-1
         */
        countryCode: string;
    }

    /**
     * Options for the presentDropInPaymentUI method.
     */
    interface PaymentUIOptions {

        /**
         * Text to show on the cancel button.
         * Defaults to "Cancel".
         */
        cancelText?: string;

        /**
         * Text to show on the title of the drop-in UI.
         * Defaults to empty string.
         */
        title?: string;

        /**
         * Text to show on the call to action button in the drop-in UI.
         * Defaults to "Select Payment Method".
         */
        ctaText?: string;

        /**
         * The amount of the transaction to show in the drop-in UI on the
         * summary row as well as the call to action button.
         * Defaults to empty string.
         */
        amount?: string;

        /**
         * The description of the transaction to show in the drop-in UI on the
         * summary row.
         * Defaults to empty string.
         */
        primaryDescription?: string;

        /**
         * The description of the transaction to show in the drop-in UI on the
         * summary row.
         * Defaults to empty string.
         */
        secondaryDescription?: string;
    }

    /**
     * Successful callback result for the presentDropInPaymentUI method.<commit_msg>Removed unused fields<commit_after>// Type definitions for cordova-plugin-braintree 0.5.1
// Project: https://github.com/taracque/cordova-plugin-braintree
// Definitions by: <NAME> <https://github.com/Justin-Credible>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

declare module BraintreePlugin {

    interface BraintreePluginStatic {

        /**
         * Used to initialize the Braintree client.
         * 
         * The client must be initialized before other methods can be used.
         * 
         * @param token The client token or tokenization key to use with the Braintree client.
         * @param successCallback The success callback for this asynchronous function.
         * @param failureCallback The failure callback for this asynchronous function; receives an error string.
         */
        initialize(token: string, successCallback?: () => void, failureCallback?: (error: string) => void): void;

        /**
         * Shows Braintree's drop-in payment UI.
         * 
         * @param successCallback The success callback for this asynchronous function; receives a result object.
         * @param failureCallback The failure callback for this asynchronous function; receives an error string.
         */
        setupApplePay(options?: ApplePayOptions, successCallback?: () => void, failureCallback?: (error: string) => void): void;

        /**
         * Shows Braintree's drop-in payment UI.
         * 
         * @param successCallback The success callback for this asynchronous function; receives a result object.
         * @param failureCallback The failure callback for this asynchronous function; receives an error string.
         */
        presentDropInPaymentUI(options?: PaymentUIOptions, successCallback?: (result: PaymentUIResult) => void, failureCallback?: (error: string) => void): void;
    }

    /**
     * Options for the setupApplePay method.
     */
    interface ApplePayOptions {
        /**
         * Apple Merchant ID can be obtained from Apple.
         */
        merchantId: string;
        
        /**
         * 3 letter currency code ISO 4217
         */
        currencyCode: string;
        
        /**
         * 2 letter country code ISO 3166-1
         */
        countryCode: string;
    }

    /**
     * Options for the presentDropInPaymentUI method.
     */
    interface PaymentUIOptions {

        /**
         * The amount of the transaction to show in the drop-in UI on the
         * summary row as well as the call to action button.
         * Defaults to empty string.
         */
        amount?: string;

        /**
         * The description of the transaction to show in the drop-in UI on the
         * summary row.
         * Defaults to empty string.
         */
        primaryDescription?: string;
    }

    /**
     * Successful callback result for the presentDropInPaymentUI method.
{'fraction_non_alphanumeric': 0.0839030453697949, 'fraction_numerical': 0.00435052827843381, 'mean_word_length': 2.052157420578473, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1197786', 'n_tokens_mistral': 1615, 'n_tokens_neox': 1540, 'n_words': 590}