|
@@ 1175-1179 (lines=5) @@
|
| 1172 |
|
public function get_intent_from_order( $order ) { |
| 1173 |
|
$order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id(); |
| 1174 |
|
|
| 1175 |
|
if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) { |
| 1176 |
|
$intent_id = get_post_meta( $order_id, '_stripe_intent_id', true ); |
| 1177 |
|
} else { |
| 1178 |
|
$intent_id = $order->get_meta( '_stripe_intent_id' ); |
| 1179 |
|
} |
| 1180 |
|
|
| 1181 |
|
if ( $intent_id ) { |
| 1182 |
|
return WC_Stripe_API::request( array(), "payment_intents/$intent_id", 'GET' ); |
|
@@ 1186-1190 (lines=5) @@
|
| 1183 |
|
} |
| 1184 |
|
|
| 1185 |
|
// The order doesn't have a payment intent, but it may have a setup intent. |
| 1186 |
|
if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) { |
| 1187 |
|
$intent_id = get_post_meta( $order_id, '_stripe_setup_intent', true ); |
| 1188 |
|
} else { |
| 1189 |
|
$intent_id = $order->get_meta( '_stripe_setup_intent' ); |
| 1190 |
|
} |
| 1191 |
|
|
| 1192 |
|
if ( $intent_id ) { |
| 1193 |
|
return WC_Stripe_API::request( array(), "setup_intents/$intent_id", 'GET' ); |