pcp-37 / add endpoint, redirect insufficient funds to paypal to choose different payment method

This commit is contained in:
David Remer 2020-08-27 10:58:08 +03:00
parent 80b492e083
commit 16501ee765
4 changed files with 90 additions and 11 deletions

View file

@ -11,6 +11,7 @@ use Inpsyde\PayPalCommerce\WcGateway\Admin\OrderTablePaymentStatusColumn;
use Inpsyde\PayPalCommerce\WcGateway\Admin\PaymentStatusOrderDetail;
use Inpsyde\PayPalCommerce\WcGateway\Checkout\CheckoutPayPalAddressPreset;
use Inpsyde\PayPalCommerce\WcGateway\Checkout\DisableGateways;
use Inpsyde\PayPalCommerce\WcGateway\Endpoint\ReturnUrlEndpoint;
use Inpsyde\PayPalCommerce\WcGateway\Gateway\CreditCardGateway;
use Inpsyde\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
use Inpsyde\PayPalCommerce\WcGateway\Notice\AuthorizeOrderActionNotice;
@ -1551,4 +1552,14 @@ return [
dirname(__FILE__, 3) . '/woocommerce-paypal-commerce-gateway.php'
);
},
'wcgateway.endpoint.return-url' => static function (ContainerInterface $container) : ReturnUrlEndpoint {
$gateway = $container->get('wcgateway.paypal-gateway');
$endpoint = $container->get('api.endpoint.order');
$prefix = $container->get('api.prefix');
return new ReturnUrlEndpoint(
$gateway,
$endpoint,
$prefix
);
},
];