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
ChargeController.php
49 lines
| 1 | <?php |
| 2 | namespace SureCartBlocks\Controllers; |
| 3 | |
| 4 | use SureCart\Models\Component; |
| 5 | use SureCart\Models\User; |
| 6 | |
| 7 | class ChargeController extends BaseController { |
| 8 | /** |
| 9 | * List all charges and paginate. |
| 10 | * |
| 11 | * @return function |
| 12 | */ |
| 13 | public function index() { |
| 14 | ob_start(); ?> |
| 15 | |
| 16 | <sc-spacing style="--spacing: var(--sc-spacing-large)"> |
| 17 | <sc-breadcrumbs> |
| 18 | <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 ?>"> |
| 19 | <?php esc_html_e( 'Dashboard', 'surecart' ); ?> |
| 20 | </sc-breadcrumb> |
| 21 | <sc-breadcrumb> |
| 22 | <?php esc_html_e( 'Payment History', 'surecart' ); ?> |
| 23 | </sc-breadcrumb> |
| 24 | </sc-breadcrumbs> |
| 25 | |
| 26 | <?php |
| 27 | echo wp_kses_post( |
| 28 | Component::tag( 'sc-charges-list' ) |
| 29 | ->id( 'sc-customer-charges' ) |
| 30 | ->with( |
| 31 | [ |
| 32 | 'heading' => __( 'Payment History', 'surecart' ), |
| 33 | 'query' => [ |
| 34 | 'customer_ids' => array_values( User::current()->customerIds() ), |
| 35 | 'page' => $this->getPage(), |
| 36 | 'per_page' => 10, |
| 37 | ], |
| 38 | ] |
| 39 | )->render() |
| 40 | ); |
| 41 | ?> |
| 42 | |
| 43 | </sc-spacing> |
| 44 | |
| 45 | <?php |
| 46 | return ob_get_clean(); |
| 47 | } |
| 48 | } |
| 49 |