capital_C_dangit WooCommerce

This commit is contained in:
David Remer 2020-09-03 07:05:50 +03:00
parent 3aa82347e5
commit 61038cc51e
32 changed files with 78 additions and 78 deletions

View file

@ -28,5 +28,5 @@ jobs:
- name: Run test suite
run: ./vendor/bin/phpunit
- name: Run Woocommerce coding standards
- name: Run WooCommerce coding standards
run: ./vendor/bin/phpcs src modules --extensions=php

View file

@ -293,8 +293,8 @@ class PurchaseUnit {
}
/**
* All money values send to PayPal can only have 2 decimal points. Woocommerce internally does
* not have this restriction. Therefore the totals of the cart in Woocommerce and the totals
* All money values send to PayPal can only have 2 decimal points. WooCommerce internally does
* not have this restriction. Therefore the totals of the cart in WooCommerce and the totals
* of the rounded money values of the items, we send to PayPal, can differ. In those cases,
* we can not send the line items.
*

View file

@ -20,7 +20,7 @@ class AddressFactory {
/**
* Returns either the shipping or billing Address object of a customer.
*
* @param \WC_Customer $customer The Woocommerce customer.
* @param \WC_Customer $customer The WooCommerce customer.
* @param string $type Either 'shipping' or 'billing'.
*
* @return Address
@ -43,7 +43,7 @@ class AddressFactory {
}
/**
* Returns an Address object based of a Woocommerce order.
* Returns an Address object based of a WooCommerce order.
*
* @param \WC_Order $order The order.
*

View file

@ -38,7 +38,7 @@ class AmountFactory {
}
/**
* Returns an Amount object based off a Woocommerce cart.
* Returns an Amount object based off a WooCommerce cart.
*
* @param \WC_Cart $cart The cart.
*
@ -84,7 +84,7 @@ class AmountFactory {
}
/**
* Returns an Amount object based off a Woocommerce order.
* Returns an Amount object based off a WooCommerce order.
*
* @param \WC_Order $order The order.
*

View file

@ -20,7 +20,7 @@ class ItemFactory {
/**
* Creates items based off a Woocommerce cart.
* Creates items based off a WooCommerce cart.
*
* @param \WC_Cart $cart The cart.
*
@ -33,7 +33,7 @@ class ItemFactory {
$product = $item['data'];
/**
* The Woocommerce product.
* The WooCommerce product.
*
* @var \WC_Product $product
*/
@ -60,7 +60,7 @@ class ItemFactory {
}
/**
* Creates Items based off a Woocommerce order.
* Creates Items based off a WooCommerce order.
*
* @param \WC_Order $order The order.
* @return Item[]
@ -75,10 +75,10 @@ class ItemFactory {
}
/**
* Creates an Item based off a Woocommerce Order Item.
* Creates an Item based off a WooCommerce Order Item.
*
* @param \WC_Order_Item_Product $item The Woocommerce order item.
* @param \WC_Order $order The Woocommerce order.
* @param \WC_Order_Item_Product $item The WooCommerce order item.
* @param \WC_Order $order The WooCommerce order.
*
* @return Item
*/
@ -87,7 +87,7 @@ class ItemFactory {
$product = $item->get_product();
/**
* The Woocommerce product.
* The WooCommerce product.
*
* @var \WC_Product $product
*/

View file

@ -80,9 +80,9 @@ class OrderFactory {
}
/**
* Creates an Order object based off a Woocommerce order and another Order object.
* Creates an Order object based off a WooCommerce order and another Order object.
*
* @param \WC_Order $wc_order The Woocommerce order.
* @param \WC_Order $wc_order The WooCommerce order.
* @param Order $order The order object.
*
* @return Order

View file

@ -37,9 +37,9 @@ class PayerFactory {
}
/**
* Returns a Payer object based off a Woocommerce customer.
* Returns a Payer object based off a WooCommerce customer.
*
* @param \WC_Customer $customer The Woocommerce customer.
* @param \WC_Customer $customer The WooCommerce customer.
*
* @return Payer
*/

View file

@ -99,7 +99,7 @@ class PurchaseUnitFactory {
}
/**
* Creates a PurchaseUnit based off a Woocommerce order.
* Creates a PurchaseUnit based off a WooCommerce order.
*
* @param \WC_Order $order The order.
*
@ -137,7 +137,7 @@ class PurchaseUnitFactory {
}
/**
* Creates a PurchaseUnit based off a Woocommerce cart.
* Creates a PurchaseUnit based off a WooCommerce cart.
*
* @param \WC_Cart $cart The cart.
*

View file

@ -34,9 +34,9 @@ class ShippingFactory {
}
/**
* Creates a shipping object based off a Woocommerce customer.
* Creates a shipping object based off a WooCommerce customer.
*
* @param \WC_Customer $customer The Woocommerce customer.
* @param \WC_Customer $customer The WooCommerce customer.
*
* @return Shipping
*/
@ -56,9 +56,9 @@ class ShippingFactory {
}
/**
* Creates a Shipping object based off a Woocommerce order.
* Creates a Shipping object based off a WooCommerce order.
*
* @param \WC_Order $order The Woocommerce order.
* @param \WC_Order $order The WooCommerce order.
*
* @return Shipping
*/

View file

@ -35,7 +35,7 @@ class CartRepository implements PurchaseUnitRepositoryInterface {
}
/**
* Returns all Pur of the Woocommerce cart.
* Returns all Pur of the WooCommerce cart.
*
* @return PurchaseUnit[]
*/

View file

@ -58,7 +58,7 @@ class RequestData {
}
/**
* Woocommerce will give you a customer object on your 2nd request. the first page
* WooCommerce will give you a customer object on your 2nd request. the first page
* load will not yet have this customer object, but the ajax request will. Therefore
* the nonce validation will fail. this fixes this problem:
*

View file

@ -148,7 +148,7 @@ class EarlyOrderHandler {
/**
* Configures the session, so we can pick up the order, once we pass through the checkout.
*
* @param int $order_id The Woocommerce order id.
* @param int $order_id The WooCommerce order id.
* @param Order $order The PayPal order.
*
* @return Order

View file

@ -86,7 +86,7 @@ class RenewalHandler {
/**
* Renew an order.
*
* @param \WC_Order $wc_order The Woocommerce order.
* @param \WC_Order $wc_order The WooCommerce order.
*/
public function renew( \WC_Order $wc_order ) {
@ -140,9 +140,9 @@ class RenewalHandler {
}
/**
* Process a Woocommerce order.
* Process a WooCommerce order.
*
* @param \WC_Order $wc_order The Woocommerce order.
* @param \WC_Order $wc_order The WooCommerce order.
*
* @throws \Exception If customer cannot be read/found.
*/
@ -169,7 +169,7 @@ class RenewalHandler {
* Returns a payment token for a customer.
*
* @param \WC_Customer $customer The customer.
* @param \WC_Order $wc_order The current Woocommerce order we want to process.
* @param \WC_Order $wc_order The current WooCommerce order we want to process.
*
* @return PaymentToken|null
*/
@ -198,10 +198,10 @@ class RenewalHandler {
}
/**
* If the PayPal order is captured/authorized the Woocommerce order gets updated accordingly.
* If the PayPal order is captured/authorized the WooCommerce order gets updated accordingly.
*
* @param Order $order The PayPal order.
* @param \WC_Order $wc_order The related Woocommerce order.
* @param \WC_Order $wc_order The related WooCommerce order.
*/
private function capture_order( Order $order, \WC_Order $wc_order ) {

View file

@ -12,8 +12,8 @@ namespace Inpsyde\PayPalCommerce\WcGateway;
use Inpsyde\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint;
use Inpsyde\PayPalCommerce\Session\SessionHandler;
use Inpsyde\PayPalCommerce\WcGateway\Settings\Settings;
use Inpsyde\Woocommerce\Logging\Logger\NullLogger;
use Inpsyde\Woocommerce\Logging\Logger\WooCommerceLogger;
use Inpsyde\WooCommerce\Logging\Logger\NullLogger;
use Inpsyde\WooCommerce\Logging\Logger\WooCommerceLogger;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;

View file

@ -183,7 +183,7 @@ return array(
'sandbox_on' => array(
'title' => __( 'Sandbox', 'paypal-for-woocommerce' ),
'type' => 'checkbox',
'label' => __( 'To test your Woocommerce installation, you can use the sandbox mode.', 'paypal-for-woocommerce' ),
'label' => __( 'To test your WooCommerce installation, you can use the sandbox mode.', 'paypal-for-woocommerce' ),
'default' => 0,
'screens' => array(
State::STATE_START,

View file

@ -68,7 +68,7 @@ class OrderTablePaymentStatusColumn {
* Render the column.
*
* @param string $column The column.
* @param int $wc_order_id The id or the Woocommerce order.
* @param int $wc_order_id The id or the WooCommerce order.
*/
public function render( string $column, int $wc_order_id ) {
if ( ! $this->settings->has( 'intent' ) || $this->settings->get( 'intent' ) !== self::INTENT ) {
@ -96,7 +96,7 @@ class OrderTablePaymentStatusColumn {
/**
* Whether to render the authorization status of an order or not.
*
* @param \WC_Order $order The Woocommerce order.
* @param \WC_Order $order The WooCommerce order.
*
* @return bool
*/
@ -107,7 +107,7 @@ class OrderTablePaymentStatusColumn {
/**
* Whether the order has been captured or not.
*
* @param \WC_Order $wc_order The Woocommerce order.
* @param \WC_Order $wc_order The WooCommerce order.
*
* @return bool
*/

View file

@ -19,7 +19,7 @@ class PaymentStatusOrderDetail {
/**
* Renders the not captured information.
*
* @param int $wc_order_id The Woocommerce order id.
* @param int $wc_order_id The WooCommerce order id.
*/
public function render( int $wc_order_id ) {
$wc_order = new \WC_Order( $wc_order_id );

View file

@ -166,9 +166,9 @@ class PayPalGateway extends \WC_Payment_Gateway {
}
/**
* Process a payment for an Woocommerce order.
* Process a payment for an WooCommerce order.
*
* @param int $order_id The Woocommerce order id.
* @param int $order_id The WooCommerce order id.
*
* @return array|null
*/
@ -231,9 +231,9 @@ class PayPalGateway extends \WC_Payment_Gateway {
}
/**
* Captures an authorized payment for an Woocommerce order.
* Captures an authorized payment for an WooCommerce order.
*
* @param \WC_Order $wc_order The Woocommerce order.
* @param \WC_Order $wc_order The WooCommerce order.
*
* @return bool
*/

View file

@ -1,6 +1,6 @@
<?php
/**
* Authorizes payments for a given Woocommerce order.
* Authorizes payments for a given WooCommerce order.
*
* @package Inpsyde\PayPalCommerce\WcGateway\Processor
*/
@ -65,9 +65,9 @@ class AuthorizedPaymentsProcessor {
}
/**
* Process a Woocommerce order.
* Process a WooCommerce order.
*
* @param \WC_Order $wc_order The Woocommerce order.
* @param \WC_Order $wc_order The WooCommerce order.
*
* @return bool
*/
@ -112,9 +112,9 @@ class AuthorizedPaymentsProcessor {
}
/**
* Returns the PayPal order from a given Woocommerce order.
* Returns the PayPal order from a given WooCommerce order.
*
* @param \WC_Order $wc_order The Woocommerce order.
* @param \WC_Order $wc_order The WooCommerce order.
*
* @return Order
*/

View file

@ -122,10 +122,10 @@ class OrderProcessor {
}
/**
* Processes a given Woocommerce order and captured/authorizes the connected PayPal orders.
* Processes a given WooCommerce order and captured/authorizes the connected PayPal orders.
*
* @param \WC_Order $wc_order The Woocommerce order.
* @param \WooCommerce $woocommerce The Woocommerce object.
* @param \WC_Order $wc_order The WooCommerce order.
* @param \WooCommerce $woocommerce The WooCommerce object.
*
* @return bool
*/
@ -232,9 +232,9 @@ class OrderProcessor {
}
/**
* Patches a given PayPal order with a Woocommerce order.
* Patches a given PayPal order with a WooCommerce order.
*
* @param \WC_Order $wc_order The Woocommerce order.
* @param \WC_Order $wc_order The WooCommerce order.
* @param Order $order The PayPal order.
*
* @return Order

View file

@ -196,7 +196,7 @@ class CheckoutOrderApproved implements RequestHandler {
continue;
}
/**
* The Woocommerce order.
* The WooCommerce order.
*
* @var \WC_Order $wc_order
*/

View file

@ -135,7 +135,7 @@ class CheckoutOrderCompleted implements RequestHandler {
continue;
}
/**
* The Woocommerce order.
* The WooCommerce order.
*
* @var \WC_Order $wc_order
*/

View file

@ -106,7 +106,7 @@ class PaymentCaptureRefunded implements RequestHandler {
}
/**
* The Woocommerce order.
* The WooCommerce order.
*
* @var \WC_Order $wc_order
*/

View file

@ -113,7 +113,7 @@ class PaymentCaptureReversed implements RequestHandler {
}
/**
* The Woocommerce order.
* The WooCommerce order.
*
* @var \WC_Order $wc_order
*/

View file

@ -2,7 +2,7 @@
/**
* The logging extensions.
*
* @package Inpsyde\Woocommerce\Logging
* @package Inpsyde\WooCommerce\Logging
*/
declare(strict_types=1);

View file

@ -2,15 +2,15 @@
/**
* The logging module.
*
* @package Inpsyde\Woocommerce\Logging
* @package Inpsyde\WooCommerce\Logging
*/
declare(strict_types=1);
namespace Inpsyde\Woocommerce\Logging;
namespace Inpsyde\WooCommerce\Logging;
use Dhii\Modular\Module\ModuleInterface;
return function (): ModuleInterface {
return new WoocommerceLoggingModule();
return new WooCommerceLoggingModule();
};

View file

@ -2,15 +2,15 @@
/**
* The logging services.
*
* @package Inpsyde\Woocommerce\Logging
* @package Inpsyde\WooCommerce\Logging
*/
declare(strict_types=1);
namespace Inpsyde\Woocommerce\Logging;
namespace Inpsyde\WooCommerce\Logging;
use Inpsyde\Woocommerce\Logging\Logger\NullLogger;
use Inpsyde\Woocommerce\Logging\Logger\WooCommerceLogger;
use Inpsyde\WooCommerce\Logging\Logger\NullLogger;
use Inpsyde\WooCommerce\Logging\Logger\WooCommerceLogger;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;

View file

@ -3,12 +3,12 @@
* The Null logger is used, when logging is disabled. It does not log at all
* but complies with the LoggerInterface.
*
* @package Inpsyde\Woocommerce\Logging\Logger
* @package Inpsyde\WooCommerce\Logging\Logger
*/
declare(strict_types=1);
namespace Inpsyde\Woocommerce\Logging\Logger;
namespace Inpsyde\WooCommerce\Logging\Logger;
use Psr\Log\LoggerInterface;
use Psr\Log\LoggerTrait;

View file

@ -5,12 +5,12 @@
*
* This is a decorator that makes any WooCommerce Logger PSR-3-compatible
*
* @package Inpsyde\Woocommerce\Logging\Logger
* @package Inpsyde\WooCommerce\Logging\Logger
*/
declare(strict_types=1);
namespace Inpsyde\Woocommerce\Logging\Logger;
namespace Inpsyde\WooCommerce\Logging\Logger;
use Psr\Log\LoggerInterface;
use Psr\Log\LoggerTrait;
@ -24,7 +24,7 @@ class WooCommerceLogger implements LoggerInterface {
use LoggerTrait;
/**
* The Woocommerce logger.
* The WooCommerce logger.
*
* @var \WC_Logger_Interface
*/
@ -40,7 +40,7 @@ class WooCommerceLogger implements LoggerInterface {
/**
* WooCommerceLogger constructor.
*
* @param \WC_Logger_Interface $wc_logger The Woocommerce logger.
* @param \WC_Logger_Interface $wc_logger The WooCommerce logger.
* @param string $source The source.
*/
public function __construct( \WC_Logger_Interface $wc_logger, string $source ) {

View file

@ -2,12 +2,12 @@
/**
* The logging module.
*
* @package Inpsyde\Woocommerce\Logging
* @package Inpsyde\WooCommerce\Logging
*/
declare(strict_types=1);
namespace Inpsyde\Woocommerce\Logging;
namespace Inpsyde\WooCommerce\Logging;
use Dhii\Container\ServiceProvider;
use Dhii\Modular\Module\ModuleInterface;
@ -15,9 +15,9 @@ use Interop\Container\ServiceProviderInterface;
use Psr\Container\ContainerInterface;
/**
* Class WoocommerceLoggingModule
* Class WooCommerceLoggingModule
*/
class WoocommerceLoggingModule implements ModuleInterface {
class WooCommerceLoggingModule implements ModuleInterface {
/**
* Setup the module.

View file

@ -15,7 +15,7 @@ use Inpsyde\PayPalCommerce\Session\SessionHandler;
use Inpsyde\PayPalCommerce\TestCase;
use Inpsyde\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
use Inpsyde\PayPalCommerce\WcGateway\Settings\Settings;
use Inpsyde\Woocommerce\Logging\WoocommerceLoggingModule;
use Inpsyde\WooCommerce\Logging\WooCommerceLoggingModule;
use Mockery;
class OrderProcessorTest extends TestCase

View file

@ -2,7 +2,7 @@
declare( strict_types = 1 );
/**
* Plugin Name: PayPal for Woocommerce
* Plugin Name: PayPal for WooCommerce
* Plugin URI: TODO
* Description: PayPal's latest complete payments processing solution. Accept PayPal. PayPal Credit, credit/debit cards, alternative digital wallets local payment types and bank accounts. Turn on only PayPal options or process a full suite of payment methods. Enable global transaction with extensive currency and country coverage.
* Version: dev-master