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 |
| Yes | Can be either
| |
| String | Yes | ID assigned to your merchant by Click-To-Pay Registration |
| String | Yes | ID of the main div that will host the Click-To-Pay experience |
| String | No | Default: |
| Boolean | No | Default: |
| No | Default: | |
| Function | No | A callback function to be called when Click-To-Pay button is loaded. Accepts an object of type CPButtonLoadedResult Please click here for the sample code |
| Function | Yes | A callback function that returns the final price and tax calculations. Please click here for the sample code |
| Function | No | A callback function to be called before Payment is made. Usually used to make custom validations before the payment. Please click here for the sample code |
| Function | Yes | A callback function to be called when Click-To-Pay Payment is authorized for the completion of the transaction. This function accepts a parameter of ClickToPayResponse. Please click here for the sample code |
| Function | No | A callback function to be called when user cancels. Please click here for the sample code |
| Function | No | A callback function to be called when payment errors out. Please click here for the sample code |
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:
| |
reason | String | If Click-To-Pay Button failed to load this field will be populated with the reason. |
Last updated