@paydock/client-sdk
Version:
Paydock client sdk
138 lines • 9.72 kB
TypeScript
export { WalletButtons, IWalletOnClickEvent, IWalletPaymentSuccessfulEvent, IWalletUnavailableEvent, IWalletUpdateData, IWalletUpdateEvent, IEventData } from "./wallet-buttons";
/**
* Interface of data from events.
* @interface IEventData
*
* @param {string} event
* @param {void | IWalletPaymentSuccessful | IWalletUpdate | IWalletUnavailable | IWalletOnClick | any} data
**/
/**
* Interface of data from a successful payment result.
* @interface IWalletPaymentSuccessful
*
* @param {string} id
* @param {number} amount
* @param {string} currency
* @param {string} status
* @param {string} [payer_name]
* @param {string} [payer_email]
* @param {string} [payer_phone]
**/
/**
* Interface of data from an update event.
* @interface IWalletUpdate
*
* @param {string} [wallet_response_code]
* @param {string} [wallet_session_id]
* @param {object} [payment_source]
* @param {string} [payment_source.wallet_payment_method_id]
* @param {string} [payment_source.card_number_last4]
* @param {string} [payment_source.card_scheme]
* @param {object} [wallet_loyalty_account]
* @param {string} [wallet_loyalty_account.id]
* @param {string} [wallet_loyalty_account.barcode]
* @param {object} [shipping]
* @param {string} [shipping.address_line1]
* @param {string} [shipping.address_line2]
* @param {string} [shipping.address_postcode]
* @param {string} [shipping.address_city]
* @param {string} [shipping.address_state]
* @param {string} [shipping.address_country]
* @param {string} [shipping.address_company]
* @param {string} [shipping.post_office_box_number]
* @param {string} [shipping.wallet_address_id]
* @param {string} [shipping.wallet_address_name]
* @param {string} [shipping.wallet_address_created_timestamp]
* @param {string} [shipping.wallet_address_updated_timestamp]
**/
/**
* Interface of data from a wallet onClick event.
* @interface IWalletOnClick
*
* @param attachResult - Method to be called that attaches a result to the wallet onClick operation.
* When handler is synchronous, this method is optionally called with a boolean flag indicating validation result.
* When handler executes asynchronous operations, this method must be called with the Promise to have the wallet process wait for its completion or rejection.
**/
/**
* Interface of data from an unavailable event.
* @interface IWalletUnavailable
*
* @param {string} [wallet] For gateways with more than one wallet button available (e.g: MPGS with ApplePay and GooglePay). Possible values for wallet are 'apple' or 'google'.
* @param {string} [type] Event Code. Value can be 'create_order_id_error' on FlypayV2 order creation failure. Optional for [Flypay V2]. N/A for other wallets.
* @param {string} [error_code] Event Error Code. Value can be any error code return from Paydock's API. Optional for [Flypay V2]. N/A for other wallets.
+
**/
/**
* Interface of data for wallet button `update` call.
* @interface IWalletUpdateData
*
* @param {boolean} success
**/
/**
* Interface of data used by the wallet checkout and payment proccess.
* @interface IWalletMeta
*
* @type {object}
* @param {string} [amount_label] Label shown next to the total amount to be paid. Required for [Stripe, ApplePay, GooglePay]. N/A for [FlyPay, Flypay V2, PayPal, Afterpay].
* @param {string} [country] Country of the user. 2 letter ISO code format. Required for [Stripe, ApplePay, GooglePay, Afterpay]. N/A for [FlyPay, Flypay V2, PayPal].
* @param {boolean} [pay_later] Used to enable Pay Later feature in PayPal Smart Checkout WalletButton integration when available. Optional for [PayPal]. N/A for other wallets.
* @param {boolean} [hide_message] Used to hide Pay Later message in PayPal Smart Checkout WalletButton integration. Optional for [PayPal]. N/A for other wallets.
* @param {boolean} [standalone] Used to enable Standalone Buttons feature in PayPal Smart Checkout WalletButton integration. Used together with `pay_later`. Optional for [PayPal]. N/A for other wallets.
* @param {boolean} [show_billing_address] Used to hide/show the billing address on ApplePay and GooglePay popups. Default value is false. Optional for [ApplePay, GooglePay]. N/A for other wallets.
* @param {boolean} [request_payer_name] Used mainly for fraud purposes - recommended set to true. Optional for [Stripe]. N/A for other wallets.
* @param {boolean} [request_payer_email] Used mainly for fraud purposes - recommended set to true. Optional for [Stripe]. N/A for other wallets.
* @param {boolean} [request_payer_phone] Used mainly for fraud purposes - recommended set to true. Optional for [Stripe]. N/A for other wallets.
* @param {string} [access_token] Used for Flypay V2 express flow. Optional for [Flypay V2]. N/A for other wallets.
* @param {string} [refresh_token] Used for Flypay V2 express flow. Optional for [Flypay V2]. N/A for other wallets.
* @param {boolean} [request_shipping] Used to request or not shipping address in the Wallet checkout, being able to handle amount changes via the `update` event. Optional for [FlyPay, PayPal, ApplePay, GooglePay]. N/A for [Flypay V2, Stripe, Afterpay].
* @param {IApplePayShippingOption[] | IPayPalShippingOption[]} [shipping_options] Used to provide available shipping options.(To use shipping_options the request_shipping flag should be true). Optional for [ApplePay]. N/A for the other wallets.
* @param {string} [merchant_name] Merchant Name used for GooglePay integration via MPGS. Required for [GooglePay]. N/A for other wallets.
* @param {object} [raw_data_initialization] Used to provide values to initialize wallet with raw data. Optional for [ApplePay]. N/A for the other wallets.
* @param {object} [style] For **Paypal**: used to style the buttons, check possible values in the [style guide](https://developer.paypal.com/docs/business/checkout/reference/style-guide).
* When `standalone` and `pay_later`, extra options can be provided in `style.messages` with the [messages style options](https://developer.paypal.com/docs/checkout/pay-later/us/integrate/reference/#stylelayout).
* Also used at **ApplePay**, **GooglePay** and **Afterpay** to select button type.
* Optional for [PayPal, ApplePay, GooglePay, Afterpay]. N/A for [Stripe, FlyPay, Flypay V2].
* @param {object} [style.button_type] Used to select ApplePay button type (e.g: 'buy','donate', etc), check possible values [here](https://developer.apple.com/documentation/apple_pay_on_the_web/displaying_apple_pay_buttons_using_css).
* Also select button type for GooglePay (check GooglePayStyles) and Afterpay (check AfterpayStyles). Optional for [ApplePay, GooglePay, Afterpay]. N/A for other wallets.
* @param {object} [style.button_style] Used to select ApplePay button style (e.g: 'black', 'white', etc), check possible values [here](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaybuttonstyle). Optional for [ApplePay]. N/A for other wallets.
* @param {object} [style.height] Used to select Afterpay button height. Optional for [Afterpay]. N/A for other wallets.
* @param {array} [wallets] By default if this is not sent or empty, we will try to show either Apple Pay or Google Pay buttons. This can be limited sending the following array in this field: ['apple','google]. Optional for [Stripe, ApplePay, GooglePay]. N/A for other wallets.
* @param {string} [client_id] Client ID to be used in the provider system. Required for [Flypay V2]. N/A for [FlyPay, GooglePay, ApplePay, PayPal, Afterpay].
* @param {Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>} [apple_pay_capabilities] Device capabilities needed for wallet button to be available.
* For further information about refer to [the documentation](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/4440085-applepaycapabilities).
* If the recognized value is credentials_status_unknown, the payment most possibly cannot be finished on the web, and the buyer must complete it on a compatible device, like Iphone, via QR scan.
* Optional parameter for [ApplePay]. N/A for [FlyPay, GooglePay, Flypay V2, PayPal, Afterpay].
**/
/**
* Interface of Shipping Options for ApplePay
* @interface IApplePayShippingOption
*
* @type {object}
* @param {string} [id] Identifier of the Shipping Option. Required.
* @param {string} [label] Identifier of the Shipping Option. Required.
* @param {string} [amount] Amount of the Shipping Option. Required.
* @param {string} [detail] Details of the Shipping Option. Required.
* @param {string} [type] Type of the Shipping Option. Values can be 'ELECTRONIC', 'GROUND', 'NOT_SHIPPED', 'OVERNIGHT', 'PICKUP', 'PRIORITY', 'SAME_DAY'. Optional.
**/
/**
* Interface of Shipping Options for GooglePay
* @interface IGooglePayShippingOption
*
* @type {object}
* @param {string} [id] Identifier of the Shipping Option. Required.
* @param {string} [label] Identifier of the Shipping Option. Required.
* @param {string} [detail] Details of the Shipping Option. Optional.
* @param {string} [type] Type of the Shipping Option. Values can be 'ELECTRONIC', 'GROUND', 'NOT_SHIPPED', 'OVERNIGHT', 'PICKUP', 'PRIORITY', 'SAME_DAY'. Optional.
**/
/**
* Interface of Shipping Options for PayPal
* @interface IPayPalShippingOption
*
* @type {object}
* @param {string} [id] Identifier of the Shipping Option. Required.
* @param {string} [label] Identifier of the Shipping Option. Required.
* @param {string} [amount] Amount of the Shipping Option. Required.
* @param {string} [currency] Currency of the Shipping Option. Required.
* @param {string} [type] Type of the Shipping Option. Values can be 'SHIPPING' or 'PICKUP'. Required.
**/
//# sourceMappingURL=index.d.ts.map