Skip to content

Commit

Permalink
Fix PHPCS issue
Browse files Browse the repository at this point in the history
  • Loading branch information
SanketChodavadiya committed Apr 20, 2023
1 parent 8d35966 commit 754a268
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion includes/api/class-wc-checkoutcom-api-request.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class WC_Checkoutcom_Api_Request {
* @param WC_Order $order Order object.
* @param array $arg Arguments.
* @param string $subscription Subscription renewal flag.
* @param bool $retry_idempotency_key Retry idempotency.
*
* @return array
*/
Expand All @@ -68,7 +69,7 @@ public static function create_payment( WC_Order $order, $arg, $subscription = nu

// Append time.
if ( true === $retry_idempotency_key ) {
$cko_idempotency_key .= '-' . date( 'Y-m-d h:i:s' );
$cko_idempotency_key .= '-' . gmdate( 'Y-m-d h:i:s' );
}

// Call to create charge.
Expand Down Expand Up @@ -1449,6 +1450,8 @@ public static function is_using_saved_payment_method() {
/**
* Checks if URL is giving 200 OK response by pinging.
*
* @param string $url URL.
*
* @return bool
*/
public static function is_url_response_ok( $url ) {
Expand Down
8 changes: 4 additions & 4 deletions includes/class-wc-gateway-checkout-com-cards.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,10 @@ public function process_payment( $order_id ) {
// Create payment with card token.
$result = (array) WC_Checkoutcom_Api_Request::create_payment( $order, $arg );

if ( isset( $result['3d_redirection_error'] ) && true === $result['3d_redirection_error'] ) {
// Retry Create payment with card token.
$result = (array) WC_Checkoutcom_Api_Request::create_payment( $order, $arg, null, true );
}
if ( isset( $result['3d_redirection_error'] ) && true === $result['3d_redirection_error'] ) {
// Retry Create payment with card token.
$result = (array) WC_Checkoutcom_Api_Request::create_payment( $order, $arg, null, true );
}

// check if result has error and return error message.
if ( isset( $result['error'] ) && ! empty( $result['error'] ) ) {
Expand Down

0 comments on commit 754a268

Please sign in to comment.