Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/join-block/join.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Plugin Name: Common Knowledge Join Flow
* Description: Common Knowledge join flow plugin.
* Version: 0.2.22
* Version: 0.2.23
* Author: Common Knowledge <hello@commonknowledge.coop>
* Text Domain: common-knowledge-join-flow
* License: GPLv2 or later
Expand Down
2 changes: 1 addition & 1 deletion packages/join-block/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: membership, subscription, join
Contributors: commonknowledgecoop
Requires at least: 5.4
Tested up to: 6.8
Stable tag: 0.2.22
Stable tag: 0.2.23
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down
12 changes: 8 additions & 4 deletions packages/join-block/src/Services/GocardlessService.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public static function removeCustomerById($customerId)
}
}

public static function removeCustomerMandates($customerId)
public static function removeCustomerMandates($customerId, $dontRemoveId = null)
{
global $joinBlockLog;
$joinBlockLog->info("Removing existing mandates for customer {$customerId}");
Expand All @@ -180,12 +180,16 @@ public static function removeCustomerMandates($customerId)
"params" => ["customer" => $customerId]
]);
foreach ($mandates->records as $mandate) {
if ($mandate->id === $dontRemoveId) {
$joinBlockLog->info("Not removing mandate for customer {$customerId}" . $mandate->id);
continue;
}
try {
$joinBlockLog->info("Removing existing mandate for customer " . $mandate->id);
$joinBlockLog->info("Removing existing mandate for customer {$customerId}" . $mandate->id);
$client->mandates()->cancel($mandate->id);
$joinBlockLog->info("Removed existing mandate for customer " . $mandate->id);
$joinBlockLog->info("Removed existing mandate for customer {$customerId}" . $mandate->id);
} catch (\Exception $e) {
$joinBlockLog->error("Failed to delete customer mandate {$mandate->id}: " . $e->getMessage());
$joinBlockLog->error("Failed to delete customer {$customerId} mandate {$mandate->id}: " . $e->getMessage());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/join-flow/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const init = () => {
const sentryDsn = getEnvStr("SENTRY_DSN")
Sentry.init({
dsn: sentryDsn,
release: "1.2.22"
release: "0.2.23"
});

if (getEnv('USE_CHARGEBEE')) {
Expand Down
Loading