Kartris User Guide

17.6.5. Setting up the VBS - notifying Kartris of payment

The final step is to ensure that successful payments are notified to Kartris so it can update orders appropriately. To do this, we created a .vbs script. By default, this script comes in the Bitcoin plugin folder within the Kartris site zip. But you can put this anywhere on your server.

There are a number of settings within this that will need to be set. You can edit it in notepad or a similar plain text editor. A typical file might look like this:
'====================
'Kartris Database
'====================
strKartrisDBName = "k25008_test"
strKartrisDBServerName = "localhost\SQLExpress"
blnUseWindowsAuth = true
strKartrisDBUserName = "sa"
strKartrisDBPassword = "sa"
strKartrisDBPort = 1433

'====================
'Bitcoin Client - Should match with your Bitcoin payment gateway settings in Kartris
'====================
strBitcoinHost = "http://localhost"
strBitcoinPort = "8332"
strBitcoinUsername = "Kartris"  
strBitcoinPassword = "ThisShouldBeSecureAndNotThisDefaultOrYouWillGetRobbed"

'=======================
'REQUIRED CONFIRMATIONS
'Number of confirmations for bitcoin payments to be considered 'paid'
'=======================
intRequiredConfirmation = "1"

'====================
'WORKING FOLDER PATH
'Folder where the log files will be saved to
'====================
'--don't forget to put backslash at the end (\)
strWorkingFolderPath = "C:\Users\TestUser\Desktop\"
'Whether to only log confirmed payments, will not log queries for addresses that returns 0.
'*True = smaller log file size but with less details. 
blnLogConfirmedPaymentsOnly = True

'====================
'Other Settings
'====================
numCursorType = 1 'for SQL Server
strEmailMethod = "off"
strMailServer = "localhost"
strEmailFromAddress = "no_reply@mysite.xyz"
strEmailSubject = "Summary"
In the above file, we have values for the strKartrisDBUserName and strKartrisDBPassword, but because we set blnUseWindowsAuth to true, these aren't required, so the values don't matter.

The Bitcoin client details should match those configured in the bitcoin.conf file, and the Kartris back end (see @17.6.3. Setting up the Bitcoin client and @17.6.4. Set up within Kartris above).

We have set the intRequiredConfirmation to "1". This is the number of confirmations the Bitcoin client should receive before an order is considered as successfully paid. Most Bitcoin documentation suggests waiting for 3-6 confirmations before considering a transaction as successful and irreversible, but the downside is that this will take longer. We'd suggest you start with a higher number (e.g. 6) and only reduce it if the delay becomes an issue (for most mail order items, waiting up to an hour, but normally less isn't going to make any real difference as to how quickly the customer will get their order.

You should set up a scheduled task in Windows to run this .vbs on a regular basis, we suggest every 10 minutes.
 
powered by tomehost