← All changes
|
src/PaymentGateways/Gateways/ServiceProvider.php
+6
-2
4.16.7.1
→
4.18.0
View file →
| @@ -57,8 +57,9 @@ | ||
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | + * @since 4.16.8 register TestOffsiteGateway when GIVEWP_ENABLE_TEST_OFFSITE_GATEWAY is set | |
| 61 | 62 | * @since 3.0.0 |
| 62 | 63 | * |
| 63 | 64 | * @throws Exception |
| 64 | 65 | * @throws OverflowException |
| @@ -65,10 +66,13 @@ | ||
| 65 | 66 | */ |
| 66 | 67 | private function registerGateways() |
| 67 | 68 | { |
| 68 | 69 | add_action('givewp_register_payment_gateway', static function (PaymentGatewayRegister $registrar) { |
| 69 | - // Enable as needed for testing but do not push to production | |
| 70 | - // $registrar->registerGateway(TestOffsiteGateway::class); | |
| 70 | + // Not for production: it completes donations without charging anyone. The e2e suite turns it | |
| 71 | + // on through .wp-env.json to walk an offsite redirect end to end. | |
| 72 | + if (defined('GIVEWP_ENABLE_TEST_OFFSITE_GATEWAY') && GIVEWP_ENABLE_TEST_OFFSITE_GATEWAY) { | |
| 73 | + $registrar->registerGateway(TestOffsiteGateway::class); | |
| 74 | + } | |
| 71 | 75 | |
| 72 | 76 | $registrar->registerGateway(StripePaymentElementGateway::class); |
| 73 | 77 | |
| 74 | 78 | $registrar->registerGateway(PayPalCommerceGateway::class); |