Skip to content

Commit 2665c28

Browse files
committed
v3.2.3
- Minor fixes
1 parent 9241df7 commit 2665c28

File tree

6 files changed

+58
-46
lines changed

6 files changed

+58
-46
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.idea/
1+
.idea/
2+
.DS_STORE

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ For more info on our fees [click here](https://cryptapi.io/fees)
7777
### Installation
7878

7979
1. Open your OpenCart admin
80-
2. Go to Extensions
80+
2. Go to Extensions
8181
3. Upload the .zip file
8282

8383
### Configuration
@@ -90,7 +90,7 @@ For more info on our fees [click here](https://cryptapi.io/fees)
9090
6. Select which cryptocurrencies you wish to accept
9191
7. Input your addresses to the cryptocurrencies you selected. This is where your funds will be sent to, so make sure the addresses are correct.
9292
8. Save Changes
93-
9. All done!
93+
9. All done!
9494

9595
### Cronjob
9696

@@ -116,11 +116,11 @@ If the OpenCart order total is below the chosen cryptocurrency's minimum, an err
116116
You can find more documentation about our service on our [get started](https://cryptapi.io/get_started) page, our [technical documentation](https://docs.cryptapi.io/) page or our [resources](https://cryptapi.io/ecommerce/) page.
117117
If there's anything else you need that is not covered on those pages, please get in touch with us, we're here to help you!
118118

119-
#### Where can I get support?
119+
#### Where can I get support?
120120

121121
The easiest and fastest way is via our live chat on our [website](https://cryptapi.io) or via our [contact form](https://cryptapi.io/contacts/).
122122

123-
### Changelog
123+
### Changelog
124124

125125
#### 1.0
126126
* Initial release.
@@ -130,7 +130,7 @@ The easiest and fastest way is via our live chat on our [website](https://crypta
130130
* Updated codebase
131131
* New API URL
132132

133-
#### 3.0
133+
#### 3.0
134134
* New settings and color schemes to fit dark mode
135135
* New settings to add CryptAPI's services fees to the checkout
136136
* New settings to add blockchain fees to the checkout
@@ -161,5 +161,8 @@ The easiest and fastest way is via our live chat on our [website](https://crypta
161161
#### 3.2.2
162162
* Minor fixes
163163

164+
#### 3.2.3
165+
* Minor fixes
166+
164167
== Upgrade Notice ==
165168
* No breaking changes

admin/controller/extension/payment/cryptapi.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ public function index()
210210
public function install()
211211
{
212212
$this->load->model('extension/payment/cryptapi');
213+
// Create order database if doesn't exist
213214
$this->model_extension_payment_cryptapi->install();
214215

215216
// Set Events

catalog/controller/extension/payment/cryptapi.php

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -283,30 +283,37 @@ public function after_purchase(&$route, &$data, &$output)
283283

284284
$nonce = $metaData['cryptapi_nonce'];
285285

286-
// Send the E-mail with the order URL
287-
$mail = new Mail($this->config->get('config_mail_engine'));
288-
$mail->parameter = $this->config->get('config_mail_parameter');
289-
$mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
290-
$mail->smtp_username = $this->config->get('config_mail_smtp_username');
291-
$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
292-
$mail->smtp_port = $this->config->get('config_mail_smtp_port');
293-
$mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');
294-
295-
$subject = sprintf($this->language->get('order_subject'), $order['order_id'], strtoupper($metaData['cryptapi_currency']));
296-
297-
$data['order_greeting'] = sprintf($this->language->get('order_greeting'), $order['order_id'], strtoupper($metaData['cryptapi_currency']));
298-
$data['order_url'] = $metaData['cryptapi_payment_url'];
299-
$data['store'] = html_entity_decode($order['store_name'], ENT_QUOTES, 'UTF-8');
300-
$data['store_url'] = $order['store_url'];
301-
302-
$html = $this->load->view('extension/payment/cryptapi_email', $data);
303-
304-
$mail->setTo($order['email']);
305-
$mail->setFrom($this->config->get('config_email'));
306-
$mail->setSender(html_entity_decode($order['store_name'], ENT_QUOTES, 'UTF-8'));
307-
$mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
308-
$mail->setHtml($html);
309-
$mail->send();
286+
/**
287+
* Tries sending an e-mail. Will fail if configuration is not set but won't throw an error.
288+
*/
289+
try {
290+
// Send the E-mail with the order URL
291+
$mail = new Mail($this->config->get('config_mail_engine'));
292+
$mail->parameter = $this->config->get('config_mail_parameter');
293+
$mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
294+
$mail->smtp_username = $this->config->get('config_mail_smtp_username');
295+
$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
296+
$mail->smtp_port = $this->config->get('config_mail_smtp_port');
297+
$mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');
298+
299+
$subject = sprintf($this->language->get('order_subject'), $order['order_id'], strtoupper($metaData['cryptapi_currency']));
300+
301+
$data['order_greeting'] = sprintf($this->language->get('order_greeting'), $order['order_id'], strtoupper($metaData['cryptapi_currency']));
302+
$data['order_url'] = $metaData['cryptapi_payment_url'];
303+
$data['store'] = html_entity_decode($order['store_name'], ENT_QUOTES, 'UTF-8');
304+
$data['store_url'] = $order['store_url'];
305+
306+
$html = $this->load->view('extension/payment/cryptapi_email', $data);
307+
308+
$mail->setTo($order['email']);
309+
$mail->setFrom($this->config->get('config_email'));
310+
$mail->setSender(html_entity_decode($order['store_name'], ENT_QUOTES, 'UTF-8'));
311+
$mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
312+
$mail->setHtml($html);
313+
$mail->send();
314+
} catch (\Exception $exception) {
315+
# don't do anything
316+
}
310317

311318
return $this->response->redirect($this->url->link('extension/payment/cryptapi/pay', 'order_id=' . $order['order_id'] . 'nonce=' . $nonce, true));
312319
}

catalog/view/javascript/cryptapi/js/cryptapi_script.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,36 @@ function check_status(ajax_url) {
1515

1616
if (data.cancelled === 1) {
1717
jQuery('.ca_loader').remove();
18-
jQuery('.ca_payments_wrapper').slideUp('400');
19-
jQuery('.ca_payment_cancelled').slideDown('400');
20-
jQuery('.ca_progress').slideUp('400');
18+
jQuery('.ca_payments_wrapper').slideUp('200');
19+
jQuery('.ca_payment_cancelled').slideDown('200');
20+
jQuery('.ca_progress').slideUp('200');
2121
is_paid = true;
2222
}
2323

2424
if (data.is_pending === 1) {
2525
waiting_payment.addClass('done');
2626
waiting_network.addClass('done');
2727
jQuery('.ca_loader').remove();
28-
jQuery('.ca_notification_refresh').remove();
29-
jQuery('.ca_notification_cancel').remove();
28+
jQuery('.ca_payment_notification').remove();
3029

3130
setTimeout(function () {
32-
jQuery('.ca_payments_wrapper').slideUp('400');
33-
jQuery('.ca_payment_processing').slideDown('400');
34-
}, 5000);
31+
jQuery('.ca_payments_wrapper').slideUp('200');
32+
jQuery('.ca_payment_processing').slideDown('200');
33+
}, 300);
3534
}
3635

3736
if (data.is_paid) {
3837
waiting_payment.addClass('done');
3938
waiting_network.addClass('done');
4039
payment_done.addClass('done');
4140
jQuery('.ca_loader').remove();
42-
jQuery('.ca_notification_refresh').remove();
43-
jQuery('.ca_notification_cancel').remove();
41+
jQuery('.ca_payment_notification').remove();
4442

4543
setTimeout(function () {
46-
jQuery('.ca_payments_wrapper').slideUp('400');
47-
jQuery('.ca_payment_processing').slideUp('400');
48-
jQuery('.ca_payment_confirmed').slideDown('400');
49-
}, 5000);
44+
jQuery('.ca_payments_wrapper').slideUp('200');
45+
jQuery('.ca_payment_processing').slideUp('200');
46+
jQuery('.ca_payment_confirmed').slideDown('200');
47+
}, 300);
5048

5149
is_paid = true;
5250
}
@@ -99,7 +97,7 @@ function check_status(ajax_url) {
9997
}
10098
});
10199

102-
setTimeout(status_loop, 5000);
100+
setTimeout(status_loop, 2000);
103101
}
104102

105103
status_loop();

catalog/view/theme/default/template/extension/payment/cryptapi.twig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
3636
$('#cryptapi-payment-form').on('change', function () {
3737
var val = $('input[name="cryptapi_coin"]:checked').val();
38-
38+
$('#button-confirm').prop('disabled', true);
3939
$.ajax({
4040
type: "POST",
4141
url: "index.php?route=checkout/confirm",
@@ -47,6 +47,8 @@
4747
.empty()
4848
.append(response);
4949
50+
$('#button-confirm').prop('disabled', false);
51+
5052
$("input[name=cryptapi_coin][value=" + val + "]").prop("checked", true);
5153
}
5254
});

0 commit comments

Comments
 (0)