← All changes
|
backend/src/Services/Integrations/IntegrationService.php
+53
-0
1.4.1
→
1.5
View file →
| @@ -3,8 +3,9 @@ | ||
| 3 | 3 | namespace IvyForms\Services\Integrations; |
| 4 | 4 | |
| 5 | 5 | use IvyForms\Common\Exceptions\InvalidArgumentException; |
| 6 | 6 | use IvyForms\Services\GoogleSheets\Hooks\InitializationHook as GoogleSheetsInitializationHook; |
| 7 | +use IvyForms\Services\Payment\PaymentsFeature; | |
| 7 | 8 | |
| 8 | 9 | /** |
| 9 | 10 | * Integration Service |
| 10 | 11 | * |
| @@ -164,8 +165,10 @@ | ||
| 164 | 165 | ], |
| 165 | 166 | ], |
| 166 | 167 | ]); |
| 167 | 168 | |
| 169 | + $this->registerPaymentIntegrations(); | |
| 170 | + | |
| 168 | 171 | // Salesforce Integration (Pro - Agency) |
| 169 | 172 | // $this->registry->register('salesforce', [ |
| 170 | 173 | // 'label' => 'salesforce_label', |
| 171 | 174 | // 'component' => 'SalesforceIntegrationSettings', |
| @@ -221,6 +224,56 @@ | ||
| 221 | 224 | 'hasFormSettings' => false, |
| 222 | 225 | 'learnMoreUrl' => 'https://ivyforms.com/documentation/', |
| 223 | 226 | ]); |
| 224 | 227 | } |
| 228 | + } | |
| 229 | + | |
| 230 | + /** | |
| 231 | + * Payment integrations (Square / Stripe / PayPal) | |
| 232 | + * | |
| 233 | + * While the payments feature is not released, the cards are shown as "Coming soon": | |
| 234 | + * no toggle, no settings and no form-builder tab (see PaymentsFeature). | |
| 235 | + */ | |
| 236 | + private function registerPaymentIntegrations(): void | |
| 237 | + { | |
| 238 | + $comingSoon = !PaymentsFeature::isEnabled(); | |
| 239 | + | |
| 240 | + $this->registry->register('square', [ | |
| 241 | + 'label' => 'square_label', | |
| 242 | + 'component' => 'SquareIntegrationSettings', | |
| 243 | + 'icon' => 'square', | |
| 244 | + 'description' => 'square_description', | |
| 245 | + 'category' => 'Payment', | |
| 246 | + 'requiresAuth' => true, | |
| 247 | + 'hasGlobalSettings' => true, | |
| 248 | + 'plan' => 'lite', | |
| 249 | + 'learnMoreUrl' => 'https://ivyforms.com/documentation/', | |
| 250 | + 'comingSoon' => $comingSoon, | |
| 251 | + ]); | |
| 252 | + | |
| 253 | + $this->registry->register('stripe', [ | |
| 254 | + 'label' => 'stripe_label', | |
| 255 | + 'component' => 'StripeIntegrationSettings', | |
| 256 | + 'icon' => 'stripe', | |
| 257 | + 'description' => 'stripe_description', | |
| 258 | + 'category' => 'Payment', | |
| 259 | + 'requiresAuth' => true, | |
| 260 | + 'hasGlobalSettings' => true, | |
| 261 | + 'plan' => 'essentials', | |
| 262 | + 'learnMoreUrl' => 'https://ivyforms.com/documentation/', | |
| 263 | + 'comingSoon' => $comingSoon, | |
| 264 | + ]); | |
| 265 | + | |
| 266 | + $this->registry->register('paypal', [ | |
| 267 | + 'label' => 'paypal_label', | |
| 268 | + 'component' => 'PaypalIntegrationSettings', | |
| 269 | + 'icon' => 'paypal', | |
| 270 | + 'description' => 'paypal_description', | |
| 271 | + 'category' => 'Payment', | |
| 272 | + 'requiresAuth' => true, | |
| 273 | + 'hasGlobalSettings' => true, | |
| 274 | + 'plan' => 'essentials', | |
| 275 | + 'learnMoreUrl' => 'https://ivyforms.com/documentation/', | |
| 276 | + 'comingSoon' => $comingSoon, | |
| 277 | + ]); | |
| 225 | 278 | } |
| 226 | 279 | } |