Permalink
Browse files

Documentation improvements

  • Loading branch information...
1 parent 7b7d578 commit 366dfdb86ddbadd66e60362720f058ef3fa37b70 @jrclippers10 jrclippers10 committed Nov 13, 2014
Showing with 84 additions and 6 deletions.
  1. +23 −3 README.md
  2. +57 −0 gocoin-util.php
  3. +4 −3 history.md
View
@@ -5,10 +5,30 @@ Version 0.3.0
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 NON-INFRINGEMENT. IN NO EVENT SHALL THE DEVELOPERS OR AUTHORS OR COPYRIGHT HOLDERS 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.<br><br>
## Using the Official GoCoin WooCommerce Plugin
-When a shopper chooses the GoCoin payment method and places their order, they will be redirected to gateway.GoCoin.com to pay.
-GoCoin will send a notification to your server which this plugin handles. Then the customer will be redirected to n order summary page.
+When a shopper chooses the GoCoin payment method and places their order, they will be redirected to https://gateway.gocoin.com to pay.
+GoCoin will send a notification to your server which this plugin handles. Then the customer will be redirected to an order summary page.
-The order status in the admin panel will be "on-hold" when the order is placed and "processing" if payment has been confirmed.
+** Version 0.3.0 of this plugin recommends at least Wordpress Version 4.0 and WooCommerce Version 2.2. Earlier versions may work, but have not been fully tested. **
+
+### Using the plugin
+All that is required for this plugin to function is your GoCoin Merchant ID and an API Key. You can obtain these from the [GoCoin Dashboard](https://dashboard.gocoin.com) in the "Developers" section. Copy and paste these values into the plugin settings and click "Save."
+
+###Version 0.3.0
+
+##### CryptoCurrency Support
+This plugin supports all currencies that GoCoin supports
+
+##### Fiat Currency Support
+Your store can be used in with of the available currencies on WooCommerce.
+
+##### Order Status
+When an order is created, its status will be 'pending.' (This is a change from previous versions, which immediately placed the order into 'on-hold.')
+
+When a payment is detected, whether the invoice is paid in full or underpaid, the order status will be updated to on-hold.
+
+When all payments are paid in full and confirmed on the blockchain (Bitcoin Network), the order status will be 'processing.'
+
+Any invalid payment will result in a status of 'failed'
View
@@ -0,0 +1,57 @@
+<?php
+/**
+ * GoCoin Utilities
+ *
+ */
+class Util
+{
+ public function sign($data, $key){
+ $include = array('price_currency','base_price','base_price_currency','order_id','customer_name');
+ // $data must be an array
+ if(is_array($data)) {
+
+ $querystring = "";
+ while(count($include) > 0) {
+ $k = $include[0];
+ if (isset($data[$k])) {
+ $querystring .= $k . "=" . $data[$k] . "&";
+ array_shift($include);
+ }
+ else {
+ return false;
+ }
+ }
+
+ //Strip trailing '&' and lowercase
+ $msg = substr($querystring, 0, strlen($querystring) - 1);
+ $msg = strtolower($query_str);
+
+ // hash with key
+ $hash = hash_hmac("sha256", $query_str, $key, true);
+ $encoded = base64_encode($hash);
+ return $encoded;
+ }
+ else {
+ return false;
+ }
+ }
+
+ public function postData() {
+ //get webhook content
+ $response = new stdClass();
+ $post_data = file_get_contents("php://input");
+
+ if (!$post_data) {
+ $response->error = 'Request body is empty';
+ }
+
+ $post_as_json = json_decode($post_data);
+ if (is_null($post_as_json)){
+ $response->error = 'Request body was not valid json';
+ } else {
+ $response = $post_as_json;
+ }
+ return $response;
+ }
+}
+?>
View
@@ -1,9 +1,10 @@
## Changelog
#### v0.3.0
-Improvements to UX
-Remove OAuth procedures in favor of API Keys
-Improve signature (sha256 HMAC)
+Multi-Currency support
+Improved logging
+Order status accuracy/parity improvements
+
#### v0.2.0
Improve plugin security and user experience.

0 comments on commit 366dfdb

Please sign in to comment.