BaseController.php
3 years ago
ChargeController.php
3 years ago
CustomerController.php
3 years ago
DownloadController.php
3 years ago
InvoiceController.php
3 years ago
OrderController.php
3 years ago
PaymentMethodController.php
2 years ago
SubscriptionController.php
3 years ago
UserController.php
3 years ago
SubscriptionController.php
553 lines
| 1 | <?php |
| 2 | namespace SureCartBlocks\Controllers; |
| 3 | |
| 4 | use SureCart\Models\Component; |
| 5 | use SureCart\Models\Price; |
| 6 | use SureCart\Models\Subscription; |
| 7 | use SureCart\Models\SubscriptionProtocol; |
| 8 | use SureCart\Models\User; |
| 9 | |
| 10 | /** |
| 11 | * The subscription controller. |
| 12 | */ |
| 13 | class SubscriptionController extends BaseController { |
| 14 | /** |
| 15 | * Render the block |
| 16 | * |
| 17 | * @param array $attributes Block attributes. |
| 18 | * @return function |
| 19 | */ |
| 20 | public function preview( $attributes = [] ) { |
| 21 | return wp_kses_post( |
| 22 | Component::tag( 'sc-subscriptions-list' ) |
| 23 | ->id( 'customer-subscriptions-preview' ) |
| 24 | ->with( |
| 25 | [ |
| 26 | 'heading' => $attributes['title'] ?? null, |
| 27 | 'isCustomer' => User::current()->isCustomer(), |
| 28 | 'allLink' => add_query_arg( |
| 29 | [ |
| 30 | 'tab' => $this->getTab(), |
| 31 | 'model' => 'subscription', |
| 32 | 'action' => 'index', |
| 33 | ], |
| 34 | remove_query_arg( array_keys( $_GET ) ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 35 | ), |
| 36 | 'query' => [ |
| 37 | 'customer_ids' => array_values( User::current()->customerIds() ), |
| 38 | 'status' => [ 'active', 'trialing', 'past_due', 'canceled' ], |
| 39 | 'page' => 1, |
| 40 | 'per_page' => 5, |
| 41 | ], |
| 42 | ] |
| 43 | )->render( $attributes['title'] ? "<span slot='heading'>" . $attributes['title'] . '</span>' : '' ) |
| 44 | ); |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Render the block |
| 49 | * |
| 50 | * @return function |
| 51 | */ |
| 52 | public function index() { |
| 53 | \SureCart::assets()->addComponentData( |
| 54 | 'sc-subscriptions-list', |
| 55 | '#customer-subscriptions-index', |
| 56 | [ |
| 57 | 'heading' => $attributes['title'] ?? __( 'Plans', 'surecart' ), |
| 58 | 'isCustomer' => User::current()->isCustomer(), |
| 59 | 'query' => [ |
| 60 | 'customer_ids' => array_values( User::current()->customerIds() ), |
| 61 | 'status' => [ 'active', 'trialing', 'canceled' ], |
| 62 | 'page' => 1, |
| 63 | 'per_page' => 20, |
| 64 | ], |
| 65 | ] |
| 66 | ); |
| 67 | ob_start(); |
| 68 | ?> |
| 69 | <sc-spacing style="--spacing: var(--sc-spacing-large)"> |
| 70 | <sc-breadcrumbs> |
| 71 | <sc-breadcrumb href="<?php echo esc_url( add_query_arg( [ 'tab' => $this->getTab() ], remove_query_arg( array_keys( $_GET ) ) ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?>"> |
| 72 | <?php esc_html_e( 'Dashboard', 'surecart' ); ?> |
| 73 | </sc-breadcrumb> |
| 74 | <sc-breadcrumb> |
| 75 | <?php esc_html_e( 'Plans', 'surecart' ); ?> |
| 76 | </sc-breadcrumb> |
| 77 | </sc-breadcrumbs> |
| 78 | <sc-subscriptions-list id="customer-subscriptions-index"></sc-subscriptions-list> |
| 79 | </sc-spacing> |
| 80 | <?php |
| 81 | return ob_get_clean(); |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Show and individual checkout session. |
| 86 | * |
| 87 | * @return function |
| 88 | */ |
| 89 | public function edit() { |
| 90 | $id = $this->getId(); |
| 91 | |
| 92 | if ( ! $id ) { |
| 93 | return $this->notFound(); |
| 94 | } |
| 95 | |
| 96 | // fetch subscription. |
| 97 | $subscription = Subscription::with( |
| 98 | [ |
| 99 | 'price', |
| 100 | 'price.product', |
| 101 | 'current_period', |
| 102 | 'period.checkout', |
| 103 | 'purchase', |
| 104 | 'discount', |
| 105 | 'discount.coupon', |
| 106 | 'purchase.license', |
| 107 | 'license.activations', |
| 108 | ] |
| 109 | )->find( $id ); |
| 110 | |
| 111 | ob_start(); |
| 112 | ?> |
| 113 | |
| 114 | <sc-spacing style="--spacing: var(--sc-spacing-large)"> |
| 115 | <sc-breadcrumbs> |
| 116 | <sc-breadcrumb href="<?php echo esc_url( add_query_arg( [ 'tab' => $this->getTab() ], remove_query_arg( array_keys( $_GET ) ) ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?>"> |
| 117 | <?php esc_html_e( 'Dashboard', 'surecart' ); ?> |
| 118 | </sc-breadcrumb> |
| 119 | <sc-breadcrumb href=" |
| 120 | <?php |
| 121 | echo esc_url( |
| 122 | add_query_arg( |
| 123 | [ |
| 124 | 'tab' => $this->getTab(), |
| 125 | 'action' => 'index', |
| 126 | 'model' => 'subscription', |
| 127 | ], |
| 128 | remove_query_arg( array_keys( $_GET ) ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 129 | ) |
| 130 | ); |
| 131 | ?> |
| 132 | "> |
| 133 | <?php esc_html_e( 'Plans', 'surecart' ); ?> |
| 134 | </sc-breadcrumb> |
| 135 | <sc-breadcrumb> |
| 136 | <?php esc_html_e( 'Plan', 'surecart' ); ?> |
| 137 | </sc-breadcrumb> |
| 138 | </sc-breadcrumbs> |
| 139 | |
| 140 | <?php |
| 141 | echo wp_kses_post( |
| 142 | Component::tag( 'sc-subscription' ) |
| 143 | ->id( 'customer-subscription-edit' ) |
| 144 | ->with( |
| 145 | [ |
| 146 | 'heading' => __( 'Current Plan', 'surecart' ), |
| 147 | 'showCancel' => \SureCart::account()->portal_protocol->subscription_cancellations_enabled && ! $subscription->remaining_period_count, |
| 148 | 'protocol' => SubscriptionProtocol::with( [ 'preservation_coupon' ] )->find(), // \SureCart::account()->subscription_protocol, |
| 149 | 'subscription' => $subscription, |
| 150 | ] |
| 151 | )->render() |
| 152 | ); |
| 153 | ?> |
| 154 | |
| 155 | <?php |
| 156 | // show switch if we can change it. |
| 157 | if ( $subscription->canBeSwitched() ) : |
| 158 | echo wp_kses_post( |
| 159 | Component::tag( 'sc-subscription-switch' ) |
| 160 | ->id( 'customer-subscription-switch' ) |
| 161 | ->with( |
| 162 | [ |
| 163 | 'heading' => __( 'Update Plan', 'surecart' ), |
| 164 | 'productId' => $subscription->price->product->id, |
| 165 | 'productGroupId' => $subscription->price->product->product_group, |
| 166 | 'subscription' => $subscription, |
| 167 | ] |
| 168 | )->render() |
| 169 | ); |
| 170 | endif; |
| 171 | ?> |
| 172 | |
| 173 | </sc-spacing> |
| 174 | |
| 175 | <?php |
| 176 | return ob_get_clean(); |
| 177 | } |
| 178 | |
| 179 | /** |
| 180 | * Update the subscription payment method |
| 181 | * |
| 182 | * @return string |
| 183 | */ |
| 184 | public function update_payment_method() { |
| 185 | $id = $this->getId(); |
| 186 | |
| 187 | if ( ! $id ) { |
| 188 | return $this->notFound(); |
| 189 | } |
| 190 | |
| 191 | // fetch subscription. |
| 192 | $subscription = Subscription::with( |
| 193 | [ |
| 194 | 'price', |
| 195 | 'price.product', |
| 196 | 'current_period', |
| 197 | 'period.checkout', |
| 198 | 'discount', |
| 199 | 'discount.coupon', |
| 200 | ] |
| 201 | )->find( $id ); |
| 202 | |
| 203 | ob_start(); |
| 204 | ?> |
| 205 | |
| 206 | <sc-spacing style="--spacing: var(--sc-spacing-large)"> |
| 207 | <sc-breadcrumbs> |
| 208 | <sc-breadcrumb href="<?php echo esc_url( add_query_arg( [ 'tab' => $this->getTab() ], remove_query_arg( array_keys( $_GET ) ) ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?>"> |
| 209 | <?php esc_html_e( 'Dashboard', 'surecart' ); ?> |
| 210 | </sc-breadcrumb> |
| 211 | <sc-breadcrumb href=" |
| 212 | <?php |
| 213 | echo esc_url( |
| 214 | add_query_arg( |
| 215 | [ |
| 216 | 'tab' => $this->getTab(), |
| 217 | 'action' => 'index', |
| 218 | 'model' => 'subscription', |
| 219 | ], |
| 220 | remove_query_arg( array_keys( $_GET ) ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 221 | ) |
| 222 | ); |
| 223 | ?> |
| 224 | "> |
| 225 | <?php esc_html_e( 'Plans', 'surecart' ); ?> |
| 226 | </sc-breadcrumb> |
| 227 | <sc-breadcrumb href=" |
| 228 | <?php |
| 229 | echo esc_url( |
| 230 | add_query_arg( |
| 231 | [ |
| 232 | 'tab' => $this->getTab(), |
| 233 | 'action' => 'edit', |
| 234 | 'model' => 'subscription', |
| 235 | 'id' => $this->getId(), |
| 236 | ], |
| 237 | remove_query_arg( array_keys( $_GET ) ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 238 | ) |
| 239 | ); |
| 240 | ?> |
| 241 | "> |
| 242 | <?php esc_html_e( 'Plan', 'surecart' ); ?> |
| 243 | </sc-breadcrumb> |
| 244 | <sc-breadcrumb> |
| 245 | <?php esc_html_e( 'Update Payment Method', 'surecart' ); ?> |
| 246 | </sc-breadcrumb> |
| 247 | </sc-breadcrumbs> |
| 248 | |
| 249 | <?php |
| 250 | echo wp_kses_post( |
| 251 | Component::tag( 'sc-subscription' ) |
| 252 | ->id( 'customer-subscription-edit' ) |
| 253 | ->with( |
| 254 | [ |
| 255 | 'heading' => __( 'Current Plan', 'surecart' ), |
| 256 | 'showCancel' => false, |
| 257 | 'subscription' => $subscription, |
| 258 | ] |
| 259 | )->render() |
| 260 | ); |
| 261 | ?> |
| 262 | |
| 263 | <?php |
| 264 | echo wp_kses_post( |
| 265 | Component::tag( 'sc-subscription-payment-method' ) |
| 266 | ->id( 'customer-subscription-payment-method' ) |
| 267 | ->with( |
| 268 | [ |
| 269 | 'heading' => __( 'Change Payment Method', 'surecart' ), |
| 270 | 'subscription' => $subscription, |
| 271 | ] |
| 272 | )->render() |
| 273 | ); |
| 274 | ?> |
| 275 | |
| 276 | </sc-spacing> |
| 277 | |
| 278 | <?php |
| 279 | return ob_get_clean(); |
| 280 | } |
| 281 | |
| 282 | |
| 283 | /** |
| 284 | * Get the terms text. |
| 285 | */ |
| 286 | public function getTermsText() { |
| 287 | $account = \SureCart::account(); |
| 288 | $privacy_url = $account->portal_protocol->privacy_url ?? \get_privacy_policy_url(); |
| 289 | $terms_url = $account->portal_protocol->terms_url ?? ''; |
| 290 | |
| 291 | if ( ! empty( $privacy_url ) && ! empty( $terms_url ) ) { |
| 292 | return sprintf( __( 'By updating or canceling your plan, you agree to the <a href="%1$1s" target="_blank">%2$2s</a> and <a href="%3$3s" target="_blank">%4$4s</a>', 'surecart' ), esc_url( $terms_url ), __( 'Terms', 'surecart' ), esc_url( $privacy_url ), __( 'Privacy Policy', 'surecart' ) ); |
| 293 | } |
| 294 | |
| 295 | if ( ! empty( $privacy_url ) ) { |
| 296 | return sprintf( __( 'By updating or canceling your plan, you agree to the <a href="%1$1s" target="_blank">%2$2s</a>', 'surecart' ), esc_url( $privacy_url ), __( 'Privacy Policy', 'surecart' ) ); |
| 297 | } |
| 298 | |
| 299 | if ( ! empty( $terms_url ) ) { |
| 300 | return sprintf( __( 'By updating or canceling your plan, you agree to the <a href="%1$1s" target="_blank">%2$2s</a>', 'surecart' ), esc_url( $terms_url ), __( 'Terms', 'surecart' ) ); |
| 301 | } |
| 302 | |
| 303 | return ''; |
| 304 | } |
| 305 | |
| 306 | /** |
| 307 | * Confirm the ad_hoc amount. |
| 308 | * |
| 309 | * @return void |
| 310 | */ |
| 311 | public function confirm_amount() { |
| 312 | $price = Price::find( $this->getParam( 'price_id' ) ); |
| 313 | ob_start(); |
| 314 | ?> |
| 315 | |
| 316 | <sc-spacing style="--spacing: var(--sc-spacing-xx-large)"> |
| 317 | <sc-breadcrumbs> |
| 318 | <sc-breadcrumb href="<?php echo esc_url( add_query_arg( [ 'tab' => $this->getTab() ], remove_query_arg( array_keys( $_GET ) ) ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?>"> |
| 319 | <?php esc_html_e( 'Dashboard', 'surecart' ); ?> |
| 320 | </sc-breadcrumb> |
| 321 | <sc-breadcrumb href=" |
| 322 | <?php |
| 323 | echo esc_url( |
| 324 | add_query_arg( |
| 325 | [ |
| 326 | 'tab' => $this->getTab(), |
| 327 | 'action' => 'edit', |
| 328 | 'model' => 'subscription', |
| 329 | 'id' => $this->getId(), |
| 330 | ], |
| 331 | remove_query_arg( array_keys( $_GET ) ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 332 | ) |
| 333 | ); |
| 334 | ?> |
| 335 | "> |
| 336 | <?php esc_html_e( 'Plan', 'surecart' ); ?> |
| 337 | </sc-breadcrumb> |
| 338 | <sc-breadcrumb> |
| 339 | <?php esc_html_e( 'Enter Amount', 'surecart' ); ?> |
| 340 | </sc-breadcrumb> |
| 341 | </sc-breadcrumbs> |
| 342 | |
| 343 | <?php |
| 344 | |
| 345 | echo wp_kses_post( |
| 346 | Component::tag( 'sc-subscription-ad-hoc-confirm' ) |
| 347 | ->id( 'subscription-ad-hoc-confirm' ) |
| 348 | ->with( |
| 349 | [ |
| 350 | 'heading' => __( 'Enter An Amount', 'surecart' ), |
| 351 | 'price' => $price, |
| 352 | ] |
| 353 | )->render() |
| 354 | ); |
| 355 | ?> |
| 356 | |
| 357 | </sc-spacing> |
| 358 | |
| 359 | <?php |
| 360 | return ob_get_clean(); |
| 361 | } |
| 362 | |
| 363 | /** |
| 364 | * Confirm changing subscription |
| 365 | * |
| 366 | * @return function |
| 367 | */ |
| 368 | public function confirm() { |
| 369 | $back = add_query_arg( [ 'tab' => $this->getTab() ], remove_query_arg( array_keys( $_GET ) ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 370 | ob_start(); |
| 371 | ?> |
| 372 | |
| 373 | <sc-spacing style="--spacing: var(--sc-spacing-xx-large)"> |
| 374 | <sc-breadcrumbs> |
| 375 | <sc-breadcrumb href="<?php echo esc_url( add_query_arg( [ 'tab' => $this->getTab() ], remove_query_arg( array_keys( $_GET ) ) ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?>"> |
| 376 | <?php esc_html_e( 'Dashboard', 'surecart' ); ?> |
| 377 | </sc-breadcrumb> |
| 378 | <sc-breadcrumb href=" |
| 379 | <?php |
| 380 | echo esc_url( |
| 381 | add_query_arg( |
| 382 | [ |
| 383 | 'tab' => $this->getTab(), |
| 384 | 'action' => 'edit', |
| 385 | 'model' => 'subscription', |
| 386 | 'id' => $this->getId(), |
| 387 | ], |
| 388 | remove_query_arg( array_keys( $_GET ) ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 389 | ) |
| 390 | ); |
| 391 | ?> |
| 392 | "> |
| 393 | <?php esc_html_e( 'Plan', 'surecart' ); ?> |
| 394 | </sc-breadcrumb> |
| 395 | <sc-breadcrumb> |
| 396 | <?php esc_html_e( 'Confirm', 'surecart' ); ?> |
| 397 | </sc-breadcrumb> |
| 398 | </sc-breadcrumbs> |
| 399 | |
| 400 | <?php |
| 401 | $terms = $this->getTermsText(); |
| 402 | $quantity_enabled = (bool) \SureCart::account()->portal_protocol->subscription_quantity_updates_enabled; |
| 403 | if ( $this->getParam( 'ad_hoc_amount' ) ) { |
| 404 | $quantity_enabled = false; |
| 405 | } |
| 406 | |
| 407 | echo wp_kses_post( |
| 408 | Component::tag( 'sc-upcoming-invoice' ) |
| 409 | ->id( 'customer-upcoming-invoice' ) |
| 410 | ->with( |
| 411 | [ |
| 412 | 'heading' => __( 'New Plan', 'surecart' ), |
| 413 | 'subscriptionId' => $this->getId(), |
| 414 | 'priceId' => $this->getParam( 'price_id' ), |
| 415 | 'adHocAmount' => $this->getParam( 'ad_hoc_amount' ), |
| 416 | 'successUrl' => esc_url_raw( $back ), |
| 417 | 'quantityUpdatesEnabled' => (bool) $quantity_enabled, |
| 418 | 'quantity' => 1, |
| 419 | ] |
| 420 | )->render( $terms ? '<span slot="terms">' . wp_kses_post( $terms ) . '</span>' : '' ) |
| 421 | ); |
| 422 | ?> |
| 423 | |
| 424 | |
| 425 | </sc-spacing> |
| 426 | |
| 427 | <?php |
| 428 | return ob_get_clean(); |
| 429 | |
| 430 | } |
| 431 | |
| 432 | /** |
| 433 | * Confirm cancel subscription |
| 434 | * |
| 435 | * @return function |
| 436 | */ |
| 437 | public function cancel() { |
| 438 | $back_url = add_query_arg( [ 'tab' => $this->getTab() ], remove_query_arg( array_keys( $_GET ) ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 439 | $edit_subscription_url = add_query_arg( |
| 440 | [ |
| 441 | 'tab' => $this->getTab(), |
| 442 | 'action' => 'edit', |
| 443 | 'model' => 'subscription', |
| 444 | 'id' => $this->getId(), |
| 445 | ], |
| 446 | remove_query_arg( array_keys( $_GET ) ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 447 | ); |
| 448 | ob_start(); |
| 449 | ?> |
| 450 | <sc-spacing style="--spacing: var(--sc-spacing-xx-large)"> |
| 451 | <sc-breadcrumbs> |
| 452 | <sc-breadcrumb href="<?php echo esc_url( $back_url ); ?>"> |
| 453 | <?php esc_html_e( 'Dashboard', 'surecart' ); ?> |
| 454 | </sc-breadcrumb> |
| 455 | <sc-breadcrumb href="<?php echo esc_url( $edit_subscription_url ); ?>" > |
| 456 | <?php esc_html_e( 'Plan', 'surecart' ); ?> |
| 457 | </sc-breadcrumb> |
| 458 | <sc-breadcrumb> |
| 459 | <?php esc_html_e( 'Cancel', 'surecart' ); ?> |
| 460 | </sc-breadcrumb> |
| 461 | </sc-breadcrumbs> |
| 462 | |
| 463 | <?php |
| 464 | echo wp_kses_post( |
| 465 | Component::tag( 'sc-subscription-cancel' ) |
| 466 | ->id( 'customer-subscription-cancel' ) |
| 467 | ->with( |
| 468 | [ |
| 469 | 'subscriptionId' => $this->getId(), |
| 470 | 'backUrl' => esc_url_raw( $edit_subscription_url ), |
| 471 | 'successUrl' => esc_url_raw( $back_url ), |
| 472 | ] |
| 473 | )->render() |
| 474 | ); |
| 475 | ?> |
| 476 | |
| 477 | </sc-spacing> |
| 478 | <?php |
| 479 | return ob_get_clean(); |
| 480 | } |
| 481 | |
| 482 | /** |
| 483 | * Update payment |
| 484 | * |
| 485 | * @return function |
| 486 | */ |
| 487 | public function payment() { |
| 488 | $back_url = add_query_arg( [ 'tab' => $this->getTab() ], remove_query_arg( array_keys( $_GET ) ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 489 | |
| 490 | $edit_subscription_url = add_query_arg( |
| 491 | [ |
| 492 | 'tab' => $this->getTab(), |
| 493 | 'action' => 'edit', |
| 494 | 'model' => 'subscription', |
| 495 | 'id' => $this->getId(), |
| 496 | ], |
| 497 | remove_query_arg( array_keys( $_GET ) ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 498 | ); |
| 499 | |
| 500 | $confirm_subscription_url = add_query_arg( |
| 501 | [ |
| 502 | 'tab' => $this->getTab(), |
| 503 | 'action' => 'confirm', |
| 504 | 'model' => 'subscription', |
| 505 | 'ad_hoc_amount' => $this->getParam( 'ad_hoc_amount' ), |
| 506 | 'id' => $this->getId(), |
| 507 | 'price_id' => $this->getParam( 'price_id' ), |
| 508 | ], |
| 509 | remove_query_arg( array_keys( $_GET ) ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 510 | ); |
| 511 | |
| 512 | $subscription = Subscription::find( $this->getId() ); |
| 513 | ob_start(); |
| 514 | ?> |
| 515 | |
| 516 | <sc-spacing style="--spacing: var(--sc-spacing-xx-large)"> |
| 517 | <sc-breadcrumbs> |
| 518 | <sc-breadcrumb href="<?php echo esc_url( $back_url ); ?>"> |
| 519 | <?php esc_html_e( 'Dashboard', 'surecart' ); ?> |
| 520 | </sc-breadcrumb> |
| 521 | <sc-breadcrumb href="<?php echo esc_url( $edit_subscription_url ); ?>"> |
| 522 | <?php esc_html_e( 'Plan', 'surecart' ); ?> |
| 523 | </sc-breadcrumb> |
| 524 | <sc-breadcrumb href="<?php echo esc_url( $confirm_subscription_url ); ?>"> |
| 525 | <?php esc_html_e( 'Confirm', 'surecart' ); ?> |
| 526 | </sc-breadcrumb> |
| 527 | <sc-breadcrumb> |
| 528 | <?php esc_html_e( 'Payment Method', 'surecart' ); ?> |
| 529 | </sc-breadcrumb> |
| 530 | </sc-breadcrumbs> |
| 531 | |
| 532 | <?php |
| 533 | echo wp_kses_post( |
| 534 | Component::tag( 'sc-subscription-payment' ) |
| 535 | ->id( 'customer-subscription-payment' ) |
| 536 | ->with( |
| 537 | [ |
| 538 | 'customerIds' => $this->customerIds(), |
| 539 | 'subscription' => $subscription, |
| 540 | 'backUrl' => esc_url_raw( $confirm_subscription_url ), |
| 541 | 'successUrl' => esc_url_raw( $confirm_subscription_url ), |
| 542 | 'quantity' => 1, |
| 543 | ] |
| 544 | )->render() |
| 545 | ); |
| 546 | ?> |
| 547 | </sc-spacing> |
| 548 | |
| 549 | <?php |
| 550 | return ob_get_clean(); |
| 551 | } |
| 552 | } |
| 553 |