I wish to count the number of purchases a Pay Per View item has recieved

Below is the code I am using just under the '// case: successful payment' comment in the PHP file.
It is obviously wrong or in incorrect spot. Are you able to help me?
$countnumber = get_post_meta( $post_id, 'wpcf-count', true );
$countnumbernew = ($countnumber + 1);
update_post_meta( $post_id, 'wpcf-count', $countnumbernew );

wpcf-count is the meta_key in my wp_postmeta table. This is the field I wish to adjust.