LLMS_Order_Generator::confirm()
Confirms an existing pending order.
Return Return
(WP_Error|array) Returns an array of data from the payment gateway's confirm_pending_order()
method on success.
Source Source
File: includes/class-llms-order-generator.php
public function confirm() { $validate = $this->validate( true ); if ( is_wp_error( $validate ) ) { return $validate; } $gateway_confirm = $this->gateway->confirm_pending_order( $this->order ); if ( is_wp_error( $gateway_confirm ) ) { return $gateway_confirm; } $user = $this->commit_user(); if ( is_wp_error( $user ) ) { return $user; } // Save the user to the order. $this->order->set_user_data( $this->get_user_data() ); if ( 'SUCCESS' === ( $gateway_confirm['status'] ?? null ) && ! empty( $gateway_confirm['transaction'] ) ) { // Record the transaction. $this->order->record_transaction( $gateway_confirm['transaction'] ); } return $gateway_confirm; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
7.0.0 | Introduced. |