Payment widget is a pop-up for used to enter card information and the email of the payer. The form can only be loaded from the system addresses, since this will ensure the confidentiality of card data.
To integrate the widget, you need to add a script into the head element of your site's markup.
For payment form to be shown, you need to call charge or auth method of cp.CloudPayments object.
and attach as a click event handler to a button, for example.
|publicId||String||Required||Site identifier, can be found in merchant account.|
|description||String||Required||Description of payment purpose in any format|
|invoiceId||String||Optional||Order or invoice number|
|data||JSON||Optional||Any other parameters which will be used with the transaction|
|onSuccess||Function or String||Optional||A function or a website page address. If a function is specified, it will be called after a successful payment. If an address is specified, the user will be transferred to that page after a successful payment.|
|onFail||Function or String||Optional||A function or a website page address. If a function is specified, it will be called after a failed payment. If an address is specified, the user will be transferred to that page after a failed payment.|