| @@ -46,24 +46,29 @@ | ||
| 46 | 46 | * |
| 47 | 47 | * @psalm-return 'live'|'test' |
| 48 | 48 | */ |
| 49 | 49 | public static function active_mode() { |
| 50 | - $settings = self::get_settings(); | |
| 51 | - return $settings->settings->test_mode ? 'test' : 'live'; | |
| 50 | + return self::get_settings()->settings->test_mode ? 'test' : 'live'; | |
| 52 | 51 | } |
| 53 | 52 | |
| 54 | 53 | /** |
| 55 | - * Add education about Stripe fees. | |
| 54 | + * Add education about Square fees. | |
| 56 | 55 | * |
| 56 | + * Square is not included in a grandfathered license, so its fees always apply | |
| 57 | + * there even though Stripe fees do not. | |
| 58 | + * | |
| 59 | + * @param string $content UTM Content for the admin upgrade link. | |
| 60 | + * @param array|false|string $gateway Gateway or list of gateways this applies to. | |
| 61 | + * | |
| 57 | 62 | * @return void |
| 58 | 63 | */ |
| 59 | - public static function fee_education( $medium = 'tip', $gateway = false ) { | |
| 60 | - $license_type = FrmAddonsController::license_type(); | |
| 61 | - if ( in_array( $license_type, array( 'elite', 'business' ), true ) ) { | |
| 64 | + public static function fee_education( $content = 'tip', $gateway = false ) { | |
| 65 | + if ( ! FrmAddonsController::payment_fees_apply( 'square' ) ) { | |
| 62 | 66 | return; |
| 63 | 67 | } |
| 64 | 68 | |
| 65 | 69 | $classes = 'frm-light-tip show_square'; |
| 70 | + | |
| 66 | 71 | if ( $gateway && ! array_intersect( (array) $gateway, array( 'square' ) ) ) { |
| 67 | 72 | $classes .= ' frm_hidden'; |
| 68 | 73 | } |
| 69 | 74 | |
| @@ -69,10 +74,10 @@ | ||
| 69 | 74 | |
| 70 | 75 | FrmTipsHelper::show_tip( |
| 71 | 76 | array( |
| 72 | 77 | 'link' => array( |
| 73 | - 'content' => 'square-fee', | |
| 74 | - 'medium' => $medium, | |
| 78 | + 'campaign' => 'square-fee', | |
| 79 | + 'content' => $content, | |
| 75 | 80 | ), |
| 76 | 81 | 'tip' => 'Pay as you go pricing: 3% fee per-transaction + Square fees.', |
| 77 | 82 | 'call' => __( 'Upgrade to save on fees.', 'formidable' ), |
| 78 | 83 | 'class' => $classes, |