wpsc_confirm_checkout

Located in: wpsc-transaction_results_functions.php

Functions that call this hook: transaction_results()
Arguments Accepted: $purchase_log_id;
Version Introduced: 3.8

This action is triggered once all the payment processing has taken place (download data links generated and purchase log table updated) it is the last hook called in the transaction results functions page before all the data is generated for the purchase reports and emails.

You would use this action to check if a sale was accepted and run any additional tasks before the user is taken to the “transaction results page”.

Code in context:
[php firstline=”152″ highlight=”169″]
if ( count( $download_data ) > 0 ) {
foreach ( $download_data as $single_download ) {
$file_data = get_post( $single_download[‘product_id’] );
// if the uniqueid is not equal to null, its "valid", regardless of what it is
if ( $single_download[‘uniqueid’] == null )
$link[] = array( "url" => site_url( "?downloadid=" . $single_download[‘id’] ), "name" => $file_data->post_title );
else
$link[] = array( "url" => site_url( "?downloadid=" . $single_download[‘uniqueid’] ), "name" => $file_data->post_title );

}
} else {
$order_status = $purchase_log[‘processed’];
}
if( isset( $download_data[‘id’] ) )
$previous_download_ids[] = $download_data[‘id’];
}

do_action( ‘wpsc_confirm_checkout’, $purchase_log[‘id’] );

$total = 0;
$shipping = $row[‘pnp’];
$total_shipping += $shipping;

$total += ( $row[‘price’] * $row[‘quantity’]);
$message_price = wpsc_currency_display( $total, array( ‘display_as_html’ => false ) );
$message_price_html = wpsc_currency_display( $total );
$shipping_price = wpsc_currency_display( $shipping, array( ‘display_as_html’ => false ) );
[/php]