http://www.freeside.biz/mediawiki/index.php?title=Freeside:4:Documentation:Developer/bin/freeside-void-payments&feed=atom&action=historyFreeside:4:Documentation:Developer/bin/freeside-void-payments - Revision history2024-03-29T05:51:30ZRevision history for this page on the wikiMediaWiki 1.27.7http://www.freeside.biz/mediawiki/index.php?title=Freeside:4:Documentation:Developer/bin/freeside-void-payments&diff=9504&oldid=prevJeremyd: Edit via perl MediaWiki framework (1.13)2015-11-18T15:46:28Z<p>Edit via perl MediaWiki framework (1.13)</p>
<p><b>New page</b></p><div>==NAME==<br />
freeside-void-payments - Automatically void a list of returned payments.<br />
<br />
==SYNOPSIS==<br />
<code><br />
freeside-void-payments [ -f file | [ -s start-date ] [ -e end-date ] ] <br />
[ -r 'reason' ] <br />
[ -g gatewaynum | -a agentnum ] <br />
[ -c ] [ -v ] <br />
[ -X reasonnum ] <br />
user<br />
</code><br />
==DESCRIPTION==<br />
Voids payments that were returned by the payment processor. Can be run periodically from crontab or manually after receiving a list of returned payments. Normally this is a meaningful operation only for electronic checks.<br />
<br />
This script voids payments based on the combination of gateway (see [[Freeside:4:Documentation:Developer/FS/payment gateway|FS::payment_gateway]]) and authorization number, since this is generally how the processor will identify them later.<br />
<br />
<code><br />
-f: Read the list of authorization numbers from the specified file. <br />
If they are not from the default payment gateway, -g or -a <br />
must be given to identify the gateway.<br />
<br />
If -f is not given, the script will attempt to contact the gateway <br />
and download a list of returned transactions. To support this, <br />
the Business::OnlinePayment module for the processor must implement <br />
the get_returns() method. For an example, see <br />
Business::OnlinePayment::WesternACH.<br />
<br />
-s, -e: Specify the starting and ending dates for the void list. <br />
This has no effect if -f is given. The end date defaults to <br />
today, and the start date defaults to one day before the end date.<br />
<br />
-r: The reason for voiding the payments, to be stored in the database.<br />
<br />
-g: The FS::payment_gateway number for the gateway that handled <br />
these payments. If -f is not given, this determines which <br />
gateway will be contacted. This overrides -a.<br />
<br />
-a: The agentnum whose default gateway will be used. If neither -a <br />
nor -g is given, the system default gateway will be used.<br />
<br />
-c: Use the default gateway for check transactions rather than <br />
credit cards.<br />
<br />
-v: Be verbose.<br />
<br />
-X: Automatically cancel all packages belonging to customers whose <br />
payments were returned. Requires a cancellation reasonnum <br />
(from FS::reason).<br />
</code><br />
==EXAMPLE==<br />
Given 'returns.txt', which contains one authorization number on each line, provided by your default e-check processor:<br />
<br />
<code><br />
freeside-void-payments -f returns.txt -c -r 'Returned check'<br />
</code><br />
If your default processor is Western ACH, which supports automated returns processing, this voids all returned payments since 2009-06-01:<br />
<br />
<code><br />
freeside-void-payments -r 'Returned check' -s 2009-06-01<br />
</code><br />
This, in your crontab, will void returned payments for the last day at 8:30 every morning:<br />
<br />
<code><br />
30 8 * * * /usr/local/bin/freeside-void-payments -r 'Returned check'<br />
</code><br />
==BUGS==<br />
Most payment gateways don't support it.<br />
<br />
==SEE ALSO==<br />
[[Freeside:4:Documentation:Developer/Business/OnlinePayment|Business::OnlinePayment]], [[Freeside:4:Documentation:Developer/FS/cust pay|FS::cust_pay]]</div>Jeremyd