-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test mode notice in page order detail. (#7898)
- Loading branch information
Showing
11 changed files
with
102 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: add | ||
|
||
Add test mode notice in page order detail. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import React from 'react'; | ||
import { __ } from '@wordpress/i18n'; | ||
import interpolateComponents from '@automattic/interpolate-components'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import InlineNotice from 'wcpay/components/inline-notice'; | ||
|
||
const TestModeNotice = (): JSX.Element => { | ||
return ( | ||
<InlineNotice icon={ true } status="warning" isDismissible={ false }> | ||
{ interpolateComponents( { | ||
mixedString: __( | ||
'WooPayments was in test mode when this order was placed. {{learnMoreLink/}}', | ||
'woocommerce-payments' | ||
), | ||
components: { | ||
learnMoreLink: ( | ||
<a | ||
target="_blank" | ||
href="https://woo.com/document/woopayments/testing-and-troubleshooting/testing/" | ||
rel="noopener noreferrer" | ||
> | ||
{ __( | ||
'Learn more about test mode', | ||
'woocommerce-payments' | ||
) } | ||
</a> | ||
), | ||
}, | ||
} ) } | ||
</InlineNotice> | ||
); | ||
}; | ||
|
||
export default TestModeNotice; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* Class Order_Mode | ||
* | ||
* @package WooCommerce\Payments | ||
*/ | ||
|
||
namespace WCPay\Constants; | ||
|
||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; // Exit if accessed directly. | ||
} | ||
|
||
/** | ||
* Enum saved in the order meta for the mode that the payment was processed in. | ||
* | ||
* @psalm-immutable | ||
*/ | ||
class Order_Mode extends Base_Constant { | ||
const TEST = 'test'; | ||
const PRODUCTION = 'prod'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters