Content
More information
In order to interact with the payment form, Payline offers a JavaScript API so that you keep control of the form. Ends the life of the web session token (token obtained via DoWebPayment). The parameters: Returns a complex object containing the buyer's data from the shortcut partner. This function is available in a context of state = PAYMENT_TRANSITIONAL_SHORTCUT. getCssIframeWhiteList() Returns the list of CSS primitives accepted to style the protected fields (Credit card, CVV, etc.). getFragmentedPaymentInfo() In a context of fragmented payments (Carrefour Gift Card, soon ANCV, etc.), it is possible to recover the various payments recorded up to now. You can recover the data when you are in tab or col mode. Allows you to retrieve a complex object containing: Allows you to retrieve the payment schedule. See the integration detail: installment payment N times and recurring payment. To display the schedule N times: getToken() Returns the current token with which the Widget was initialized. Allows you to know the status of the payment session (Session Token) in order to send a payment request without recreating a new order and to avoid the problems of multiple sessions for an order. The getTokenStatus function with the payment session identifier as a parameter and returns the states: ALIVE, EXPIRED, UNKNOWN. init() Request for initialization of the payment form. During initialization, the Payline widget builds the form according to the context of the payment request: amount, proposed payment method, etc. Update of payment session information (addresses, amount, ...) after initialization of the widget and before finalization of payment. This function is validated only if the option to update an order at the point of sale is activated ( see the link of the admin center ). Example to hide, then display the payment form: Example to change the label on Pay button: Example to change the label on Pay button: Warning, always use the classes for these instructions, never the id of the element that is generated on the flyJavaScript API
The functions available from your IS are offered with the library widget-min.js :
:Fonction Description Example endToken()
(additionalData: any,
callback: Function,
spinner: any,
handledByMerchant: boolean)finalizeShortCut() Triggers the finalization of the ShortCut payment (to be called in context.state PAYMENT_TRANSITIONAL_SHORTCUT) getBuyerShortCut() getCancelAndReturnUrls() Returns a complex object containing the returnUrl and the cancelUrl from the DoWebPayment For example, you can create a cancel button
that triggers the following actions:getContextInfo(key) Returns context information using its key among the following values. getCssIframeWhiteList(): any
getLanguage() Returns the language key of the widget (passed in the DoWebPayment frame). "en", "fr", … getOrderInfos() getRecurringDetails() To retrieve recurring payment details:
getToken()
getTokenStatus() hide() Request to hide the payment form. Payline.Api.hide(): void
isSandBox() Allows you to know the environment: production or certification. The function returns true or false. Payline.Api.isSandbox();
reset() Totally reset the widget with the token and the template passed as a parameter. show() Request to display the payment form. Payline.Api.show(): void
toggle() If the widget is displayed, this method hides it, otherwise it displays it. updateWebpaymentData() Use case