Click-To-Pay Objects Reference (Request)
For complete sample code please refer here
Available dictionary objects
iStatus
Use: iStatus.success
c2pEnvironment
Use: c2pEnvironment.sandbox
c2pReviewAction
Use: c2pReviewAction.pay
Request objects
ClickToPayRequest
The Main object that contains all the information necessary to communicate with Click-To-Pay API.
Name
Type
Required
Description
environment
Yes
Can be either
c2pEnvironment.sandbox
or
c2pEnvironment.production
externalClientId
String
Yes
ID assigned to your merchant by Click-To-Pay Registration
click2payContainer
String
Yes
ID of the main div that will host the Click-To-Pay experience
mainCssClass
String
No
Default: c2p-def
To override default styling, use
this field to provide the name of your
own css class
displayWaitScreenAfterCheckout
Boolean
No
Default: true
After checkout Click-To-Pay control
will be automatically reloaded.
This controls if “Wait“ screen is set
during that operation
reviewAction
No
Default: c2pReviewAction.pay
Controls final Button caption
consumer clicks to make the payment
onButtonLoaded
Function
No
onPaymentPrefill
Function
Yes
onPaymentValidate
Function
No
onPaymentSuccess
Function
Yes
onPaymentCancel
Function
No
onPaymentError
Function
No
onCPButtonLoaded callback example
onPaymentPrefill callback example
onPaymentValidate callback example
onPaymentSuccess callback example
onPaymentCancel callback example
onPaymentError callback example
CPButtonLoadedResult Object
Name
Type
Description
status
There are be 3 possible cases:
Click-To-Pay Button loaded successfully:
status = iStatus.success
An error occurred while loading Click-To-Pay Button:
status = iStatus.error
reason
String
If Click-To-Pay Button failed to load this field will be populated with the reason.
Last updated