Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
Add WooCommerce Bookings support
Browse files Browse the repository at this point in the history
  • Loading branch information
stezu committed Jan 8, 2015
1 parent 946d57f commit 04a1ed2
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions classes/class-s4wc_gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,19 @@ public function is_available() {
return false;
}

// Stripe will only process orders of at least 50 cents
if ( WC()->cart->total * 100 < 50 ) {
// Allow smaller orders to process for WooCommerce Bookings
if ( is_checkout_pay_page() ) {
$order_key = urldecode( $_GET['key'] );
$order_id = absint( get_query_var( 'order-pay' ) );
$order = new WC_Order( $order_id );

if ( $order->id == $order_id && $order->order_key == $order_key && $order->get_total() * 100 < 50) {
return false;
}
}

// Stripe will only process orders of at least 50 cents otherwise
elseif ( WC()->cart->total * 100 < 50 ) {
return false;
}

Expand Down

0 comments on commit 04a1ed2

Please sign in to comment.