Restrict Content Pro
rcp_get_user_payments()
Coming soon: Restrict Content Pro is becoming Kadence Memberships. You may see both names used while we update the product, documentation, and customer experience.
Note: This content is provided as a resource within our developer documentation. Because custom code requires highly specific implementation, we encourage you to work with a qualified developer if you need guidance. You can find our recommended consultants here: https://codeable.io/developers/restrict-content-pro
Returns payment records for a user via RCP_Payments::get_payments().
Deprecated in 3.0. Prefer RCP_Customer::get_payments() on the customer from rcp_get_customer_by_user_id().
Parameters
$user_id (int) – WordPress user ID. Default: 0 (current logged-in user).
$args (array) – Optional query overrides merged with user_id.
Return values
(array) – Payment rows/objects from the database. Empty array if $user_id is missing or invalid.
Examples
$payments = rcp_get_user_payments( $user_id );
foreach ( $payments as $payment ) {
// Typical properties: id, amount, date, status, transaction_id, membership_id, etc.
}
$customer = rcp_get_customer_by_user_id( $user_id );
$payments = $customer ? $customer->get_payments() : array();
Related: RCP_Payments, Using The Payment Meta API.