mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-29 18:55:53 -04:00
- Add function to correctly interpret subscription status from the API - Error validation on customer deletion. - Corrected PHPDoc to reflect reponse codes. - Pass complete data to synchronize subscription function - Rework request function to properly interpret response - Add data to trigger - Unsubscribe customer before deleting them from Mailchimp to prevent error. Signed-off-by: objec <objecttothis@gmail.com>
24 lines
446 B
PHP
24 lines
446 B
PHP
<?php
|
|
|
|
namespace App\Plugins\MailchimpPlugin\Enums;
|
|
|
|
enum SubscriptionStatus: int
|
|
{
|
|
case SUBSCRIBED = 1;
|
|
case UNSUBSCRIBED = 2;
|
|
case PENDING = 3;
|
|
case CLEANED = 4;
|
|
|
|
public static function fromApiString(string $status): ?self
|
|
{
|
|
foreach (self::cases() as $case) {
|
|
if (strtolower($case->name) === strtolower($status)) {
|
|
return $case;
|
|
}
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
|