-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6dc368e
commit 470f3f0
Showing
6 changed files
with
250 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
bitcoin-virtuemart | ||
================== | ||
|
||
A [Bitcoin](Bitcoin) payment processor plugin for the | ||
[VirtueMart](VirtueMart) shopping cart for [Joomla!](Joomla). | ||
|
||
Version: @@bitcoin-virtuemart-version@@ | ||
|
||
Features | ||
-------- | ||
|
||
* Generates a new bitcoin address for every order | ||
* Provides payment address to customer on site at checkout, plus in a | ||
subsequent email | ||
* Configurable timeout after which unpaid transactions will be canceled | ||
automatically | ||
* Configurable number of Bitcoin network confirmations after which an order | ||
is considered paid | ||
* HTTP or HTTPS access to bitcoind | ||
|
||
Requirements | ||
------------ | ||
|
||
### Base requirements | ||
* Joomla! 1.5 | ||
* VirtueMart 1.1.x | ||
|
||
### PHP requirements: | ||
* PHP5 | ||
* cURL support | ||
* SSL support (if you're using HTTPS to talk to bitcoind) | ||
|
||
### Other requirements: | ||
* Access to create a cronjob on your web server (or elsewhere) | ||
* wget or the curl commandline tool on the machine running the cronjob | ||
|
||
Limitations | ||
----------- | ||
|
||
* It is assumed that Bitcoin is the *only* currency accepted. | ||
* All prices are assumed to be in Bitcoins, and no currency conversions are | ||
performed. | ||
* A cronjob is required to check for payment receipt, at least until | ||
bitcoind allows attaching a JSON-RPC callback to an address. | ||
* Emailing the bitcoin address requires an extra email to be sent (modifying | ||
the order confirmation message VirtueMart sends would be preferable, but | ||
the API doesn't support that). | ||
* Validation of bitcoind's generated address is based only on its length. | ||
The PHP solution available requires the GMP extension to be installed. | ||
* Orders for downloadables are not tagged as "shipped" once paid. | ||
* The Bitcoin address associated with a transaction is stored in a database | ||
field not intended for it. | ||
* No localization support. | ||
|
||
Installation | ||
------------ | ||
|
||
* Install Joomla! <http://help.joomla.org/content/category/15/99/132/>. | ||
* Install VirtueMart (a PDF file included in the distribution explains the | ||
process). | ||
* Untar the distribution archive in your Joomla! installation's base | ||
directory. | ||
|
||
Configuration | ||
------------- | ||
|
||
* Log into your Joomla! installation as an administrator. | ||
* Click Components -> VirtueMart on the main menu. | ||
* At left, click Store -> List Payment Methods. | ||
* Click Bitcoin in the list. | ||
* Click the checkbox next to "Name" at the top of the list, then clear the | ||
Bitcoin checkbox. | ||
* Click "Unpublish" at top. | ||
* On the "Payment Method Form" tab, configure as follows: | ||
* Active - checked | ||
* Payment Method Name - Bitcoin | ||
* Code - BC | ||
* Payment class name - ps_bitcoin | ||
* Payment method type - HTML-Form based (e.g. PayPal) | ||
* Now click to the "Configuration" tab and proceed as follows: | ||
* Configure your bitcoind server information. | ||
* If you are using HTTPS to talk to bitcoind and would like to validate | ||
the connection using bitcoind's own SSL certificate, enter the | ||
absolute path to the certificate file (server.cert) you've uploaded | ||
to the server. | ||
* Configure your payment timeout and number of transaction confirmations | ||
required. | ||
* *Note the instruction to create a cronjob.* The cronjob is what | ||
queries bitcoind periodically to see if pending orders have been paid. The | ||
cronjob is mandatory. | ||
* Leave the "Order status" options at their defaults: | ||
* Successful = Confirmed | ||
* Uncompleted = Pending | ||
* Failed = Cancelled | ||
* Copy and paste all of the code from `extrainfo.php` in the distribution | ||
archive's root directory into the "Payment Extra Info" box. | ||
* Save. | ||
* Create the Bitcoin currency: | ||
* Assuming you're still in the VirtueMart component, click Admin -> | ||
List Currencies at left. | ||
* Click New at top right. | ||
* Enter: | ||
* Currency name: Bitcoin | ||
* Currency code: BTC | ||
* Save. | ||
* Set the store-wide currency: | ||
* Click Store -> Edit Store | ||
* In the "Currency Display Style" box: | ||
* Open "Currency" and select Bitcoin. | ||
* Enter "BTC" as the Currency Symbol. | ||
* Under "List of accepted currencies" click Bitcoin and make sure | ||
that all other currencies are deselected. | ||
* Save. | ||
|
||
Donate | ||
------ | ||
|
||
* Bitcoin payments: 1MU97wyf7msCVdaapneW2dW1uXP7oEQsFA | ||
* Gifts via other methods: <http://www.nostate.com/support-nostatecom/> | ||
|
||
Authors | ||
------- | ||
|
||
* [Mike Gogulski](http://github.com/mikegogulski) - | ||
<http://www.nostate.com/> <http://www.gogulski.com/> | ||
|
||
Credits | ||
------- | ||
|
||
* jsonrpc | ||
* PayCific | ||
|
||
License | ||
------- | ||
|
||
bitcoin-virtuemart is free and unencumbered public domain software. For more | ||
information, see <http://unlicense.org/> or the accompanying UNLICENSE file. | ||
|
||
|
||
[Bitcoin]: http://www.bitcoin.org/ | ||
[VirtueMart]: http://www.virtuemart.net/ | ||
[Joomla]: http://www.joomla.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
This is free and unencumbered software released into the public domain. | ||
|
||
Anyone is free to copy, modify, publish, use, compile, sell, or | ||
distribute this software, either in source code form or as a compiled | ||
binary, for any purpose, commercial or non-commercial, and by any | ||
means. | ||
|
||
In jurisdictions that recognize copyright laws, the author or authors | ||
of this software dedicate any and all copyright interest in the | ||
software to the public domain. We make this dedication for the benefit | ||
of the public at large and to the detriment of our heirs and | ||
successors. We intend this dedication to be an overt act of | ||
relinquishment in perpetuity of all present and future rights to this | ||
software under copyright law. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
For more information, please refer to <http://unlicense.org/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
include_once(CLASSPATH . "payment/ps_bitcoin.cfg.php"); | ||
require_once(CLASSPATH . "ps_order.php"); | ||
$tot = number_format($db->f("order_total"), 2, ".", ""); | ||
$addr = $_SESSION["bitcoin_address"]; | ||
$oid = $db->f("order_id"); | ||
$addrinfo = "To make your payment and complete your order, please send BTC " . $tot . " to Bitcoin address " . $addr; | ||
$confirminfo = "Your payment will be confirmed when " . BITCOIN_CONFIRMS . " confirmation"; | ||
if (BITCOIN_CONFIRMS != 1) | ||
$confirminfo .= "s"; | ||
$confirminfo .= " of the transaction ha"; | ||
if (BITCOIN_CONFIRMS != 1) | ||
$confirminfo .= "ve"; | ||
else | ||
$confirminfo .= "s"; | ||
$confirminfo .= " been received."; | ||
$confirminfo .= " If payment is not received within " . BITCOIN_TIMEOUT . " hours, your order will be canceled automatically."; | ||
// TODO: better address validation | ||
if (strlen($addr) >= 27 && strlen($addr) <= 40) { | ||
$q = "UPDATE #__vm_order_payment SET order_payment_name='" . $addr . "' WHERE order_id='" . $oid . "'"; | ||
$db->query($q); | ||
echo "<p><strong>" . $addrinfo . "</strong><p>"; | ||
echo "<p>" . $confirminfo . "</p>"; | ||
|
||
$d['include_comment'] = "Y"; | ||
$d['order_comment'] = $addrinfo . ". " . $confirminfo; | ||
$d['current_order_status'] = "P"; | ||
$d['order_status'] = "P"; | ||
$d['notify_customer'] = "Y"; | ||
$d['order_id'] = $oid; | ||
$order = new ps_order; | ||
// TODO: hackish but it gets the info to the customer. revisit. | ||
$order->order_status_update($d); | ||
|
||
} else { | ||
$vmLogger->err("Shopping cart expired."); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters