AutoCapture
Last updated
Last updated
Copyright Chainbox 2008-2023
Autocapture is a tool that can be used to quickly and efficiently perform direct payment transactions such as refunds and cancellations of placed transactions without the need to implement or develop new solutions or code.
Autocapture is a small, lightweight and efficient and because of the way it can be called from within other application software, allows the user to perform payment transactions to QuickPay, directly from any 3rd party application, like C5 or any Windows application which supports command-line execution.
As of the date of this writing the following features is supported:
Provider | Capture | Renew | Refund | Cancel | Subscriptions | Get PaymentInfo |
---|---|---|---|---|---|---|
|
Supported Windows version compatible
?> Make sure that the IP from where the AutoCapture client is called is whitelisted and allowed to call the API if the provider has restrictions.
Autocapture is a command line application so it must be called in one of 3 ways:
From an application (C5) - which supports external execution of command line software.
Directly from Windows Command Prompt.
Via the Windows Run command (Windows Button–R).
Calls to Autocapture follow the pattern shown below :
There are currently 5 supported commands and they will all be needed in each call. The order in which the commands are placed is irrelevant.
Examples:
or
Specifies which action is to be done by the payment service provider.
Capture : Captures a previously authorized payment and withdraw the specified amount.
Renew : Renews a previously authorized payment to avoid automatic removal of payment.
Refund : Refunds a previously captured transaction and transfers the money back to the original account.
Cancel : Cancels a previously authorized – but not yet captured – payment.
PaymentInfo : Fetch information about the payment.
Required parameters for the specific actions:
capture : transaction, amount, currency, orderid.
renew : transaction, amount, currency.
refund : transaction, amount, currency, orderid.
cancel : transaction, orderid.
PaymentInfo : transaction.
PaymentInfo output examples:
The ID of the payment that is to be processed. Usually provided by the payment service provider.
The specified amount of the order that is to be processed. With most payment providers this number is given as a non-decimal value, so that 100,00 Kr. is specified as 10000.
The currency of the transaction amount.
Order id of payment order to be processed.
?> When used with QuickPay with a Subscription/Recurring payment, this should be globally unique for each capture - maybe postfix something on the ordernumber: 1234 (1234011120). You can not use same OrderID for different customers/subscriptsions - i.e. sub01, sub02 etc. is probably a bad pattern.
If parameter specified, the payment is captured as "split" payment. Once a payment is captured without this parameter it won't be able to be captured again, even if this parameter is specified.
When capturing a subscription payment, it might take some time for the new recurring payment to be completely authorized before it can be captured. If a timeout is specified AutoCapture will try to wait for the payment to be ready to be captured until the timeout has passed. Note that the program will not return until the timeout has passed or capture has succeeded, so you probably don't want to specify a too high timeout. A timeout of 10-30 seconds is recommended. Timeout might not be exact - worst case up to +/- 10 seconds diff from the specified timeout.
?> This is only applicable for QuickPay provider in subscription-mode.
Performs the action specified, but in subscription mode - Thus for capture, a single payment transaction, which can be done multiple times if the the ticket is registred as Recurring and the provider supports subscriptions.
?> For QuickPay: If you have called this this multiple times with same orderid , and get an error like Recurring payment already authorized it means that the recurring is already created, but since you are calling it again you might got an error the first time that indicate that it might not be captured. We recommend checking & capturing manually in this case.
The Autocapture tool relies on a configuration file named AutoCapture.ini. It follows the INI-file standard format.
The config file should be located either in the the executing/"Start in" directory or in the same folder as the Autocapture program itself. The executing directory has the higehst priority when looking for the config file.
It contains various information used for running the application and communicating with various services. This file can be edited by the user to adjust for specific needs, like when a new payment service provider is to be used.
merchantid : Payment provider ID of shop or merchant.
login : Username for the API user
password : Password for API user
!> Remember to check for Return-code when calling AutoCapture and somehow give user information in case it did not succeed. Otherwise the user might think everything went ok when it didn't.
Autocapture always return an error code (Exit status code), and if needed also a message, upon exit.
0 : Transaction completed successfully.
1 : or higher. A problem was encountered.
When a problem is encountered, Autocapture prints the errormessage, errorcodes etc. it receives from the Provider API to the Standard Error stream - Refer to the providers documentation for explanation/description of error codes/messages. It is the responsibility of the caller to store/save the error codes/messages for later inspection if needed.
I.e, when running AutoCapture from Command Line the return/exit code can be obtained by using the ERRORLEVEL-variable
In case you wish to be able to grep the output, you can use redirection. See Microsofts support.
Example with redirection of error-output to a file called error_99999.txt
The file error_99999.txt
will then contain the error-output of the program and can be presented to the user in case of error
QuickPay V10
X
X
X
X
X
X