PCP-39 add capture downloads only immediatly option

This commit is contained in:
David Remer 2020-08-25 13:55:07 +03:00
parent abd4c171dc
commit 607a247133
4 changed files with 74 additions and 3 deletions

View file

@ -104,13 +104,17 @@ return [
$paymentsEndpoint = $container->get('api.endpoint.payments');
$orderFactory = $container->get('api.factory.order');
$threeDsecure = $container->get('button.helper.three-d-secure');
$authorizedPaymentsProcessor = $container->get('wcgateway.processor.authorized-payments');
$settings = $container->get('wcgateway.settings');
return new OrderProcessor(
$sessionHandler,
$cartRepository,
$orderEndpoint,
$paymentsEndpoint,
$orderFactory,
$threeDsecure
$threeDsecure,
$authorizedPaymentsProcessor,
$settings
);
},
'wcgateway.processor.authorized-payments' => static function (ContainerInterface $container): AuthorizedPaymentsProcessor {
@ -340,6 +344,23 @@ return [
'requirements' => [],
'gateway' => 'all',
],
'capture_for_virtual_only' => [
'title' => __('Capture Virtual-Only Orders ', 'woocommerce-paypal-commerce-gateway'),
'type' => 'checkbox',
'default' => false,
'desc_tip' => true,
'description' => __(
'If the order contains exclusively virtual items, enable this to immediately capture, rather than authorize, the transaction.',
'woocommerce-paypal-commerce-gateway'
),
'label' => __('Capture Virtual-Only Orders', 'woocommerce-paypal-commerce-gateway'),
'screens' => [
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
],
'requirements' => [],
'gateway' => 'all',
],
'payee_preferred' => [
'title' => __('Instant Payments ', 'woocommerce-paypal-commerce-gateway'),
'type' => 'checkbox',