Skip to content

Commit

Permalink
Merge branch 'develop' into add/8197-overview-survey
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaun1985 authored Mar 11, 2024
2 parents 7d3714d + fc83801 commit 1943e98
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions changelog/add-8242-payment-overview-widget-feature-flag
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: dev

Implement a feature flag for the Payment Overview widget.
1 change: 1 addition & 0 deletions client/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ declare global {
isAuthAndCaptureEnabled: boolean;
paymentTimeline: boolean;
isDisputeIssuerEvidenceEnabled: boolean;
isPaymentOverviewWidgetEnabled?: boolean;
};
fraudServices: unknown[];
testMode: boolean;
Expand Down
11 changes: 11 additions & 0 deletions includes/class-wc-payments-features.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class WC_Payments_Features {
const PAY_FOR_ORDER_FLOW = '_wcpay_feature_pay_for_order_flow';
const DISPUTE_ISSUER_EVIDENCE = '_wcpay_feature_dispute_issuer_evidence';
const STREAMLINE_REFUNDS_FLAG_NAME = '_wcpay_feature_streamline_refunds';
const PAYMENT_OVERVIEW_WIDGET_FLAG_NAME = '_wcpay_feature_payment_overview_widget';

/**
* Indicates whether card payments are enabled for this (Stripe) account.
Expand Down Expand Up @@ -256,6 +257,15 @@ public static function is_woopay_first_party_auth_enabled() {
return '1' === get_option( self::WOOPAY_FIRST_PARTY_AUTH_FLAG_NAME, '1' ) && self::is_woopay_express_checkout_enabled();
}

/**
* Checks whether Payment Overview Widget is enabled.
*
* @return bool
*/
public static function is_payment_overview_widget_ui_enabled(): bool {
return '1' === get_option( self::PAYMENT_OVERVIEW_WIDGET_FLAG_NAME, '0' );
}

/**
* Checks whether WooPay Direct Checkout is enabled.
*
Expand Down Expand Up @@ -385,6 +395,7 @@ public static function to_array() {
'isPayForOrderFlowEnabled' => self::is_pay_for_order_flow_enabled(),
'isDisputeIssuerEvidenceEnabled' => self::is_dispute_issuer_evidence_enabled(),
'isRefundControlsEnabled' => self::is_streamline_refunds_enabled(),
'isPaymentOverviewWidgetEnabled' => self::is_payment_overview_widget_ui_enabled(),
]
);
}
Expand Down

0 comments on commit 1943e98

Please sign in to comment.