Skip to content

Commit 3457b34

Browse files
authored
Merge pull request #12 from HelloAsso/fix/payment-without-token
Fix/payment without token
2 parents 4233807 + 449c3d3 commit 3457b34

14 files changed

Lines changed: 1656 additions & 850 deletions

block/helloasso-woocommerce-blocks.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
}
55

66
use Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType;
7-
87
final class Helloasso_Blocks extends AbstractPaymentMethodType
98
{
109
private $gateway;
@@ -13,12 +12,14 @@ final class Helloasso_Blocks extends AbstractPaymentMethodType
1312
public function initialize()
1413
{
1514
$this->settings = get_option('woocommerce_helloasso_settings', []);
16-
$this->gateway = new WC_HelloAsso_Gateway();
15+
16+
$this->gateway =WC_Payment_Gateways::instance()->payment_gateways()[$this->name];
17+
1718
}
1819

1920
public function is_active()
2021
{
21-
return $this->gateway->is_available();
22+
return $this->gateway->is_available() && get_option('helloasso_access_token_asso');
2223
}
2324

2425
public function get_payment_method_script_handles()

composer.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "helloasso/helloasso-payments-for-woocommerce",
3+
"description": "Hello Asso Payments Gateway for WooCommerce",
4+
"license": "GPL-3.0-or-later",
5+
"autoload": {
6+
"psr-4": {
7+
"Helloasso\\HelloassoPaymentsForWoocommerce\\": "inc/"
8+
}
9+
},
10+
"authors": [
11+
{
12+
"name": "helloasso"
13+
}
14+
],
15+
"require": {}
16+
}

0 commit comments

Comments
 (0)