mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Fix phpcs
This commit is contained in:
parent
b655d3a710
commit
752d327188
2 changed files with 30 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Handles the onboard with Pay upon Invoice setting.
|
* Handles OXXO payer action.
|
||||||
*
|
*
|
||||||
* @package WooCommerce\PayPalCommerce\Onboarding\Endpoint
|
* @package WooCommerce\PayPalCommerce\Onboarding\Endpoint
|
||||||
*/
|
*/
|
||||||
|
@ -18,6 +18,9 @@ use WooCommerce\PayPalCommerce\ApiClient\Factory\ShippingPreferenceFactory;
|
||||||
use WooCommerce\PayPalCommerce\Button\Endpoint\EndpointInterface;
|
use WooCommerce\PayPalCommerce\Button\Endpoint\EndpointInterface;
|
||||||
use WooCommerce\PayPalCommerce\Button\Endpoint\RequestData;
|
use WooCommerce\PayPalCommerce\Button\Endpoint\RequestData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OXXOEndpoint constructor.
|
||||||
|
*/
|
||||||
class OXXOEndpoint implements EndpointInterface {
|
class OXXOEndpoint implements EndpointInterface {
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,21 +32,29 @@ class OXXOEndpoint implements EndpointInterface {
|
||||||
protected $request_data;
|
protected $request_data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* The purchase unit factory.
|
||||||
|
*
|
||||||
* @var PurchaseUnitFactory
|
* @var PurchaseUnitFactory
|
||||||
*/
|
*/
|
||||||
protected $purchase_unit_factory;
|
protected $purchase_unit_factory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* The shipping preference factory.
|
||||||
|
*
|
||||||
* @var ShippingPreferenceFactory
|
* @var ShippingPreferenceFactory
|
||||||
*/
|
*/
|
||||||
protected $shipping_preference_factory;
|
protected $shipping_preference_factory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* The order endpoint.
|
||||||
|
*
|
||||||
* @var OrderEndpoint
|
* @var OrderEndpoint
|
||||||
*/
|
*/
|
||||||
protected $order_endpoint;
|
protected $order_endpoint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* The logger.
|
||||||
|
*
|
||||||
* @var LoggerInterface
|
* @var LoggerInterface
|
||||||
*/
|
*/
|
||||||
protected $logger;
|
protected $logger;
|
||||||
|
@ -52,6 +63,10 @@ class OXXOEndpoint implements EndpointInterface {
|
||||||
* OXXOEndpoint constructor
|
* OXXOEndpoint constructor
|
||||||
*
|
*
|
||||||
* @param RequestData $request_data The request data.
|
* @param RequestData $request_data The request data.
|
||||||
|
* @param OrderEndpoint $order_endpoint The order endpoint.
|
||||||
|
* @param PurchaseUnitFactory $purchase_unit_factory The purchase unit factory.
|
||||||
|
* @param ShippingPreferenceFactory $shipping_preference_factory The shipping preference factory.
|
||||||
|
* @param LoggerInterface $logger The logger.
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
RequestData $request_data,
|
RequestData $request_data,
|
||||||
|
@ -67,16 +82,24 @@ class OXXOEndpoint implements EndpointInterface {
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The nonce
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public static function nonce(): string {
|
public static function nonce(): string {
|
||||||
return 'ppc-oxxo';
|
return 'ppc-oxxo';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles the request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
public function handle_request(): bool {
|
public function handle_request(): bool {
|
||||||
$data = $this->request_data->read_request( $this->nonce() );
|
|
||||||
|
|
||||||
$purchase_unit = $this->purchase_unit_factory->from_wc_cart();
|
$purchase_unit = $this->purchase_unit_factory->from_wc_cart();
|
||||||
|
|
||||||
$payer_action = '';
|
$payer_action = '';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$shipping_preference = $this->shipping_preference_factory->from_state(
|
$shipping_preference = $this->shipping_preference_factory->from_state(
|
||||||
$purchase_unit,
|
$purchase_unit,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue