Using The Payment Meta API

Note: This is part of the developer docs and is considered custom code.
Unfortunately, we cannot provide support for custom code at this time as we do not have the additional resources that would be necessary to provide support for custom code.

If you need assistance with this, please reach out to our list of consultants for further assistance:
https://codeable.io/developers/restrict-content-pro/

Restrict Content Pro version 2.6 introduced a metadata API for payment records. This allows developers to store metadata that is directly associated with particular payments.

This API works nearly identical to the standard  WordPress metadata API.

global $rcp_payments_db;

// Add metadata
$rcp_payments_db->add_meta( $level_id = 0, $key = '', $value = '', $unique = true );

// Update metadata
$rcp_payments_db->update_meta( $level_id = 0, $key = '', $value = '', $previous_value = '' );

// Retrieve metadata
$rcp_payments_db->get_meta( $level_id = 0, $key = '', $single = true );

// Delete metadata
$rcp_payments_db->delete_meta( $level_id = 0, $key = '', $value = '' );

Please note: All of these examples serve as a guideline and are here for your convenience. We do not provide support for troubleshooting or modifying these and we do not provide support for any custom development. If you need help with any of these examples, consider hiring a developer.

Powered by Zendesk