Ok – I’m a complete novice, but is this anywhere near getting the license into the payload?
`function my_custom_wc_api_order_response( $order_data, $order ) {
$license = get_post_meta($order_id , ‘license_key’ , true );
$order_data[‘license_key’] = $license;
return $order_data;
}
add_filter( ‘woocommerce_api_order_response’, ‘my_custom_wc_api_order_response’, 10, 3 );
Hi Kevin, I have to ask, did it work? Since I would also like to implement it
My code above did not work – in the end I paid a developer to write the php snippet for it. It was more complex than originally thought, as the keys are encrypted in the database so there needs to be a decrypt action as part of it all.
Would you be open to share share the snippet that retrieves the recently purchased license code to me or would I need to hire a developer for my use case? Thank you Kevin.
The plugin provides procedures of getting the license decrypted.
Hello @kevinburgess @andyll00
As @dan009 said, there is a way to decrypt a license key (Assuming that the encrypted license key is stored in the $encrypted_license_key
variable):
$decrypted_license = apply_filters( 'lmfwc_decrypt', $encrypted_license_key);
Similar to this, the filter to encrypt is lmfwc_encrypt
.
To answer your original question: There is no out-of-the box way to do that, you would need to hire a developer to do that for – which you’ve already done 🙂
Let me know if I can provide any other help.