Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
Rene Vergara | a82ef3c2ca | |
pitmutt | 23d31d8bec | |
Rene V. Vergara A. | ab08d12f2b | |
Rene Vergara | e7655b2af1 | |
Rene Vergara | 9d1d9cc5ae | |
Rene Vergara | 15584ca7b1 |
|
@ -3,8 +3,15 @@ All notable changes to this project will be documented in this file.
|
|||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [1.0.2] - 2023-07-20
|
||||
|
||||
## [Unreleased]
|
||||
- Fixed typo in API call
|
||||
|
||||
## [1.0.1] - 2023-06-26
|
||||
|
||||
- Updates for production release
|
||||
|
||||
## [1.0.0] - 2023-06-26
|
||||
|
||||
- Security hardening changes to plugin queries.
|
||||
- Re-design of ZGo API callback to support WooCommerce 7.8.0
|
||||
|
|
|
@ -46,11 +46,13 @@ class zpmt_stats_page {
|
|||
$this->_npages++;
|
||||
}
|
||||
|
||||
$sql = 'insert into zgo_pmtlst (pg_ix,pg_page,pg_npages,pg_offset,pg_limit) values (1,' .
|
||||
$this->_page . ',' .
|
||||
$this->_npages . ',' .
|
||||
$this->_offset . ',' .
|
||||
$this->_limit .')';
|
||||
// $sql = 'insert into zgo_pmtlst (pg_ix,pg_page,pg_npages,pg_offset,pg_limit) values (1,' .
|
||||
// $this->_page . ',' .
|
||||
// $this->_npages . ',' .
|
||||
// $this->_offset . ',' .
|
||||
// $this->_limit .')';
|
||||
|
||||
$sql = $wpdb->prepare('insert into zgo_pmtlst (pg_ix,pg_page,pg_npages,pg_offset,pg_limit) values (1,%d,%d,%d,%d);',$this->_page,$this->_npages,$this->_offset,$this->_limit);
|
||||
$wpdb->query($sql);
|
||||
} else {
|
||||
// Load last state
|
||||
|
@ -67,7 +69,10 @@ class zpmt_stats_page {
|
|||
if ( $this->_nrows > ($this->_npages*$this->_limit) ) {
|
||||
$this->_npages++;
|
||||
}
|
||||
$sql = 'update zgo_pmtlst set pg_npages=' . $this->_npages . ' where pg_ix=1';
|
||||
|
||||
// $sql = 'update zgo_pmtlst set pg_npages=' . $this->_npages . ' where pg_ix=1';
|
||||
|
||||
$sql = $wpdb->prepare('update zgo_pmtlst set pg_npages=%d where pg_ix=1;',$this->_npages);
|
||||
$wpdb->query($sql);
|
||||
}
|
||||
}
|
||||
|
@ -149,9 +154,13 @@ class zpmt_stats_page {
|
|||
//
|
||||
// Save new list state
|
||||
//
|
||||
$sql = 'update zgo_pmtlst set pg_page=' . $this->_page .
|
||||
', pg_npages=' . $this->_npages .
|
||||
', pg_offset=' . $this->_offset . ' where pg_ix=1;';
|
||||
|
||||
// $sql = 'update zgo_pmtlst set pg_page=' . $this->_page .
|
||||
// ', pg_npages=' . $this->_npages .
|
||||
// ', pg_offset=' . $this->_offset . ' where pg_ix=1;';
|
||||
|
||||
$sql = $wpdb->prepare('update zgo_pmtlst set pg_page=%d, pg_npages=
|
||||
%d, pg_offset=%d where pg_ix=1;',$this->_page,$this->_npages,$this->_offset);
|
||||
$wpdb->query($sql);
|
||||
}
|
||||
|
||||
|
@ -233,14 +242,14 @@ class zpmt_stats_page {
|
|||
}
|
||||
$line++;
|
||||
print '<td><a href="https://dev.zgo.cash/invoice/' . htmlentities($row->pmt_orderid, ENT_QUOTES) . '" target="_blank">' . htmlentities($row->pmt_orderid, ENT_QUOTES) . "</a></td>";
|
||||
print "<td>" . $row->pmt_wc_order . "</td>";
|
||||
print "<td>" . htmlwntities($row->pmt_wc_order,ENT_QUOTES) . "</td>";
|
||||
print "<td>" . htmlentities($row->pmt_wc_custname, ENT_QUOTES) . "</td>";
|
||||
print '<td style="text-align:center;">'. $row->pmt_accepted . "</td>";
|
||||
print '<td style="text-align:center;">'.$row->pmt_confirmed ."</td>";
|
||||
print '<td style="text-align:center;">'. htmlentities($row->pmt_accepted,ENT_QUOTES) . "</td>";
|
||||
print '<td style="text-align:center;">'.htmlentities($row->pmt_confirmed,ENT_QUOTES) ."</td>";
|
||||
print '<td style="text-align:right;">'. number_format($row->pmt_amount,2) . "</td>";
|
||||
print '<td style="text-align:right;">'. number_format($row->pmt_rate,2) . "</td>";
|
||||
print '<td style="text-align:right;">'. number_format($row->pmt_zec,8) . "</td>";
|
||||
print '<td style="text-align:center;">'.$row->pmt_wc_paid ."</td></tr>";
|
||||
print '<td style="text-align:center;">'. htmlentities($row->pmt_wc_paid,ENT_QUOTES) ."</td></tr>";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
@ -577,8 +586,8 @@ class zpmt_stats_page {
|
|||
global $wpdb;
|
||||
|
||||
$sql = 'select ifnull(sum(a.pmt_amount),0) as gTotalAmount, ' .
|
||||
'ifnull(count(*),0) as gTotalPmts, ' .
|
||||
'ifnull(sum(a.pmt_zec),0) as gTotalZec ' .
|
||||
'ifnull(count(*),0) as gTotalPmts, ' .
|
||||
'ifnull(sum(a.pmt_zec),0) as gTotalZec ' .
|
||||
'from zgo_payments a ' .
|
||||
'where a.pmt_wc_paid = 1;' ;
|
||||
$result = $wpdb->get_row($sql,OBJECT);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
/**
|
||||
* Plugin Name: ZGo Payment Gateway
|
||||
* Plugin URI: https://vergara.tech'
|
||||
* Plugin URI: https://zgo.cash/
|
||||
* Description: ZGo latest payment processing solution for Woocommerce. Accept payments using Zcash.
|
||||
* Version: 1.0.0
|
||||
* Version: 1.1.1
|
||||
* Requires at least: 5.2
|
||||
* Requires PHP: 7.2
|
||||
* Author: Vergara Tech LLC
|
||||
|
@ -181,7 +181,7 @@ function zgopmt_init() {
|
|||
if ( isset($this->zgoownerid) &&
|
||||
($this->zgoownerid !== '') ) {
|
||||
|
||||
$url = 'https://test.zgo.cash/auth?ownerid=' .
|
||||
$url = 'https://api.zgo.cash/auth?ownerid=' .
|
||||
$this->zgoownerid . '&token=' .
|
||||
$this->zgotoken . '&siteurl=' .
|
||||
$this->base64url_encode($this->siteURL);
|
||||
|
@ -220,7 +220,7 @@ function zgopmt_init() {
|
|||
$wc_order_key = $order->get_order_key();
|
||||
|
||||
|
||||
$url = 'https://test.zgo.cash/woopayment' .
|
||||
$url = 'https://api.zgo.cash/woopayment' .
|
||||
'?ownerid=' . $this->zgoownerid .
|
||||
'&token=' . $this->zgotoken .
|
||||
'&order_id=' . $order_id .
|
||||
|
@ -272,7 +272,7 @@ function zgopmt_init() {
|
|||
|
||||
return array(
|
||||
'result' => 'success',
|
||||
'redirect' => 'https://dev.zgo.cash/invoice/' . $zgoOrderid . '?token=' . $zgoOrderToken,
|
||||
'redirect' => 'https://app.zgo.cash/invoice/' . $zgoOrderid . '?token=' . $zgoOrderToken,
|
||||
);
|
||||
break;
|
||||
case 202:
|
||||
|
|
Loading…
Reference in New Issue