Hey.
According to your code, you are paying your users under the reference: “Order_Complete”. Since this is a custom reference you will need to add it into the reference list which will allow you to setup a badge with the requirement of having this reference in the log.
add_filter( 'mycred_all_references', 'mycred_pro_add_custom_refs' );
function mycred_pro_add_custom_refs( $reference ) {
$reference['order_complete'] = 'Completed order payment';
return $reference;
}
You can use the mycred_all_references
filter to register any number of custom references you might add of your own. Otherwise you can find all references listed in the codex.
A small side note, you should keep references lowercase as some features in myCRED will make comparisons and these features assumes your ref is lowercase.
Finally I would change the following:
if(is_user_logged_in()){
to:
if(is_user_logged_in() && function_exists( 'mycred_add' ) ){