Skip to content

Commit

Permalink
PHPCS fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdharmesh committed Feb 26, 2024
1 parent e94def6 commit 3212858
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions includes/Framework/PaymentGateway/Payment_Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -1799,7 +1799,7 @@ protected function do_transaction( $order ) {
if ( ! $this->verify_order_total( $order ) ) {
Square_Helper::wc_add_notice( esc_html__( 'The sum of partial totals does not match the order total.', 'woocommerce-square' ), 'error' );
return false;
};
}

// Save the charge type as `PARTIAL`.
$this->update_order_meta( $order, 'charge_type', self::CHARGE_TYPE_PARTIAL );
Expand Down Expand Up @@ -3947,10 +3947,10 @@ public function build_split_payment_order_note( $order, $square_order ) {
if ( \Square\Models\TenderType::SQUARE_GIFT_CARD === $tender->getType() ) {
$this->update_order_meta( $order, 'gift_card_partial_total', $tender_amount );
$message .= ' ' . sprintf( wp_kses_post( 'for an amount of %1$s on the gift card' ), wc_price( $tender_amount ) );
} else if ( \Square\Models\TenderType::CARD === $tender->getType() ) {
} elseif ( \Square\Models\TenderType::CARD === $tender->getType() ) {
$this->update_order_meta( $order, 'other_gateway_partial_total', $tender_amount );
$message .= ' ' . sprintf( wp_kses_post( 'and %1$s on the credit card' ), wc_price( $tender_amount ) );
} else if ( \Square\Models\TenderType::WALLET === $tender->getType() ) {
} elseif ( \Square\Models\TenderType::WALLET === $tender->getType() ) {
$this->update_order_meta( $order, 'other_gateway_partial_total', $tender_amount );
$message .= ' ' . sprintf( wp_kses_post( 'and %1$s on the cash app pay' ), wc_price( $tender_amount ) );
}
Expand Down
7 changes: 3 additions & 4 deletions includes/Gateway/Cash_App_Pay_Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ public function get_guest_customer_id( \WC_Order $order ) {
public function get_order( $order_id ) {
$order = parent::get_order( $order_id );

$order->payment->nonce = new \stdClass();
$order->payment->nonce = new \stdClass();

if ( $this->is_gift_card_applied() ) {
$order->payment->nonce->gift_card = Square_Helper::get_post( 'square-gift-card-payment-nonce' );
Expand Down Expand Up @@ -760,7 +760,7 @@ public function get_payment_request() {
$amount = WC()->cart->total;

// Check if a gift card is applied.
$check_for_giftcard = isset( $_POST['check_for_giftcard'] ) ? 'true' === sanitize_text_field( wp_unslash( $_POST['check_for_giftcard'] ) ) : false;
$check_for_giftcard = isset( $_POST['check_for_giftcard'] ) ? 'true' === sanitize_text_field( wp_unslash( $_POST['check_for_giftcard'] ) ) : false; // phpcs:ignore WordPress.Security.NonceVerification.Missing
$gift_card_applied = false;
if ( $check_for_giftcard ) {
$partial_amount = $this->get_partial_cash_app_amount();
Expand Down Expand Up @@ -789,7 +789,7 @@ public function get_partial_cash_app_amount() {
if ( ! Gift_Card::does_checkout_support_gift_card() || ! $payment_token ) {
return $amount;
}

$is_sandbox = wc_square()->get_settings_handler()->is_sandbox();
if ( $is_sandbox ) {
// The card allowed for testing with the Sandbox account has fund of $1.
Expand All @@ -806,7 +806,6 @@ public function get_partial_cash_app_amount() {
$amount = $amount - $balance;
}
}


return $amount;
}
Expand Down

0 comments on commit 3212858

Please sign in to comment.