Forum Index

No notifications
Notifications

Favorites

No favorites found
General Training Discussion General chat and comment on KnowledgeKube training
Subscribe to post
User avatar
matt.pitman - (27/09/2016 13:01:10)
RE:Is there payment gateway feature in KK?
Hello again. To implement a payment service redirect in your KnowledgeKube model, you'll need to do the following: 1. If you have not already established an account with the desired payment service, do so. Depending on the payment provider, you may be given the option to configure certain preferences such as a return URL or values to be returned post-transaction. 2. Add a Form Load Expression that calls AddPostFormScript();. You don't need to use any arguments for this function - it simply initialises a generic script to allow redirection and sharing of data with a specified URL. 3. Create your means of redirection. This will typically be a Button, and for the rest of this example we'll assume you are using a button. 4. If the payment service is able return query string data (e.g. a confirmation code) to your model and you want it to do so, add the following statement at the top of the button's expression to ensure the model can receive and utilise this data:
CheckCargo();
Note: If you do this, you'll need to ensure you create Cargo Variables that will receive the value(s) returned by the payment provider. 5. Add a Parameter Expression-type attribute to your button. Set the attribute's Expression Name to ONCLIENTCLICK and enter the following in its Attribute Expression field:
SubmitPostForm(PaymentGatewayUrl,"Key:Value");
Note: Make sure you replace PaymentGatewayUrl with a string containing the actual URL of your payment gateway - this can come from a variable or other type of keyword if you prefer. The "Key:Value" string can contain any number of key value pairs (separated by commas) where each Key is a property specified by the payment service, and the matching Value is a model keyword (e.g. question or variable) that will supply that property with its value. For example:
"AccountName:VARMyAccount,SortCode:VARSortCode"
After a user clicks the button, the model will redirect them to the payment gateway, passing all specified property values to that gateway. The user can then fill in any remaining details, and assuming the gateway is configured to return users to the original model, it will do so. Any values returned by the gateway can then be picked up by the model's Cargo, and used by the model as required. If you're not sure about any aspect of this, or if you run into issues with a particular provider, please let us know and if we can assist, we will. Kind regards.
RSS Feed