mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
downgrade plugin to php 7.0
This commit is contained in:
parent
5e011b4f95
commit
c5899d915c
61 changed files with 419 additions and 368 deletions
|
@ -26,7 +26,7 @@ use Inpsyde\PayPalCommerce\Onboarding\Environment;
|
|||
use Inpsyde\PayPalCommerce\Onboarding\State;
|
||||
|
||||
return array(
|
||||
'button.client_id' => static function ( ContainerInterface $container ): string {
|
||||
'button.client_id' => static function ( $container ): string {
|
||||
|
||||
$settings = $container->get( 'wcgateway.settings' );
|
||||
$client_id = $settings->has( 'client_id' ) ? $settings->get( 'client_id' ) : '';
|
||||
|
@ -47,7 +47,7 @@ return array(
|
|||
return $env->current_environment_is( Environment::SANDBOX ) ?
|
||||
'AQB97CzMsd58-It1vxbcDAGvMuXNCXRD9le_XUaMlHB_U7XsU9IiItBwGQOtZv9sEeD6xs2vlIrL4NiD' : '';
|
||||
},
|
||||
'button.smart-button' => static function ( ContainerInterface $container ): SmartButtonInterface {
|
||||
'button.smart-button' => static function ( $container ): SmartButtonInterface {
|
||||
|
||||
$state = $container->get( 'onboarding.state' );
|
||||
/**
|
||||
|
@ -86,16 +86,16 @@ return array(
|
|||
$messages_apply
|
||||
);
|
||||
},
|
||||
'button.url' => static function ( ContainerInterface $container ): string {
|
||||
'button.url' => static function ( $container ): string {
|
||||
return plugins_url(
|
||||
'/modules/ppcp-button/',
|
||||
dirname( __FILE__, 3 ) . '/woocommerce-paypal-commerce-gateway.php'
|
||||
);
|
||||
},
|
||||
'button.request-data' => static function ( ContainerInterface $container ): RequestData {
|
||||
'button.request-data' => static function ( $container ): RequestData {
|
||||
return new RequestData();
|
||||
},
|
||||
'button.endpoint.change-cart' => static function ( ContainerInterface $container ): ChangeCartEndpoint {
|
||||
'button.endpoint.change-cart' => static function ( $container ): ChangeCartEndpoint {
|
||||
if ( ! \WC()->cart ) {
|
||||
throw new RuntimeException( 'cant initialize endpoint at this moment' );
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ return array(
|
|||
$data_store = \WC_Data_Store::load( 'product' );
|
||||
return new ChangeCartEndpoint( $cart, $shipping, $request_data, $repository, $data_store );
|
||||
},
|
||||
'button.endpoint.create-order' => static function ( ContainerInterface $container ): CreateOrderEndpoint {
|
||||
'button.endpoint.create-order' => static function ( $container ): CreateOrderEndpoint {
|
||||
$request_data = $container->get( 'button.request-data' );
|
||||
$repository = $container->get( 'api.repository.cart' );
|
||||
$order_endpoint = $container->get( 'api.endpoint.order' );
|
||||
|
@ -124,7 +124,7 @@ return array(
|
|||
$early_order_handler
|
||||
);
|
||||
},
|
||||
'button.helper.early-order-handler' => static function ( ContainerInterface $container ) : EarlyOrderHandler {
|
||||
'button.helper.early-order-handler' => static function ( $container ) : EarlyOrderHandler {
|
||||
|
||||
$state = $container->get( 'onboarding.state' );
|
||||
$order_processor = $container->get( 'wcgateway.order-processor' );
|
||||
|
@ -132,14 +132,14 @@ return array(
|
|||
$prefix = $container->get( 'api.prefix' );
|
||||
return new EarlyOrderHandler( $state, $order_processor, $session_handler, $prefix );
|
||||
},
|
||||
'button.endpoint.approve-order' => static function ( ContainerInterface $container ): ApproveOrderEndpoint {
|
||||
'button.endpoint.approve-order' => static function ( $container ): ApproveOrderEndpoint {
|
||||
$request_data = $container->get( 'button.request-data' );
|
||||
$order_endpoint = $container->get( 'api.endpoint.order' );
|
||||
$session_handler = $container->get( 'session.handler' );
|
||||
$three_d_secure = $container->get( 'button.helper.three-d-secure' );
|
||||
return new ApproveOrderEndpoint( $request_data, $order_endpoint, $session_handler, $three_d_secure );
|
||||
},
|
||||
'button.endpoint.data-client-id' => static function( ContainerInterface $container ) : DataClientIdEndpoint {
|
||||
'button.endpoint.data-client-id' => static function( $container ) : DataClientIdEndpoint {
|
||||
$request_data = $container->get( 'button.request-data' );
|
||||
$identity_token = $container->get( 'api.endpoint.identity-token' );
|
||||
return new DataClientIdEndpoint(
|
||||
|
@ -147,10 +147,10 @@ return array(
|
|||
$identity_token
|
||||
);
|
||||
},
|
||||
'button.helper.three-d-secure' => static function ( ContainerInterface $container ): ThreeDSecure {
|
||||
'button.helper.three-d-secure' => static function ( $container ): ThreeDSecure {
|
||||
return new ThreeDSecure();
|
||||
},
|
||||
'button.helper.messages-apply' => static function ( ContainerInterface $container ): MessagesApply {
|
||||
'button.helper.messages-apply' => static function ( $container ): MessagesApply {
|
||||
return new MessagesApply();
|
||||
},
|
||||
);
|
||||
|
|
|
@ -651,7 +651,7 @@ class SmartButton implements SmartButtonInterface {
|
|||
*
|
||||
* @return array|null
|
||||
*/
|
||||
private function payerData(): ?array {
|
||||
private function payerData() {
|
||||
|
||||
$customer = WC()->customer;
|
||||
if ( ! is_user_logged_in() || ! is_a( $customer, \WC_Customer::class ) ) {
|
||||
|
|
|
@ -23,7 +23,7 @@ use Inpsyde\PayPalCommerce\Session\SessionHandler;
|
|||
class ApproveOrderEndpoint implements EndpointInterface {
|
||||
|
||||
|
||||
public const ENDPOINT = 'ppc-approve-order';
|
||||
const ENDPOINT = 'ppc-approve-order';
|
||||
|
||||
/**
|
||||
* The request data helper.
|
||||
|
|
|
@ -20,7 +20,7 @@ use Inpsyde\PayPalCommerce\Button\Exception\RuntimeException;
|
|||
class ChangeCartEndpoint implements EndpointInterface {
|
||||
|
||||
|
||||
public const ENDPOINT = 'ppc-change-cart';
|
||||
const ENDPOINT = 'ppc-change-cart';
|
||||
|
||||
/**
|
||||
* The current cart object.
|
||||
|
@ -198,7 +198,7 @@ class ChangeCartEndpoint implements EndpointInterface {
|
|||
*
|
||||
* @return array|null
|
||||
*/
|
||||
private function products_from_data( array $data ): ?array {
|
||||
private function products_from_data( array $data ) {
|
||||
|
||||
$products = array();
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ use Inpsyde\PayPalCommerce\WcGateway\Settings\Settings;
|
|||
class CreateOrderEndpoint implements EndpointInterface {
|
||||
|
||||
|
||||
public const ENDPOINT = 'ppc-create-order';
|
||||
const ENDPOINT = 'ppc-create-order';
|
||||
|
||||
/**
|
||||
* The request data helper.
|
||||
|
|
|
@ -19,7 +19,7 @@ use Inpsyde\PayPalCommerce\ApiClient\Exception\RuntimeException;
|
|||
class DataClientIdEndpoint implements EndpointInterface {
|
||||
|
||||
|
||||
public const ENDPOINT = 'ppc-data-client-id';
|
||||
const ENDPOINT = 'ppc-data-client-id';
|
||||
|
||||
/**
|
||||
* The Request Data Helper.
|
||||
|
|
|
@ -85,7 +85,7 @@ class EarlyOrderHandler {
|
|||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function determine_wc_order_id( int $value = null ): ?int {
|
||||
public function determine_wc_order_id( int $value = null ) {
|
||||
|
||||
if ( ! isset( $_REQUEST['ppcp-resume-order'] ) ) {
|
||||
return $value;
|
||||
|
|
|
@ -18,10 +18,10 @@ use Inpsyde\PayPalCommerce\ApiClient\Entity\Order;
|
|||
class ThreeDSecure {
|
||||
|
||||
|
||||
public const NO_DECISION = 0;
|
||||
public const PROCCEED = 1;
|
||||
public const REJECT = 2;
|
||||
public const RETRY = 3;
|
||||
const NO_DECISION = 0;
|
||||
const PROCCEED = 1;
|
||||
const REJECT = 2;
|
||||
const RETRY = 3;
|
||||
|
||||
/**
|
||||
* Determine, how we proceed with a given order.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue