private function get_customer( $user_id = 0, $options ) {
$meta_key = $this->get_user_meta_key( $options );
if ( 0 === $user_id ) {
$user = wp_get_current_user();
$customer_id = get_user_meta( $user->ID, $meta_key, true );
} else {
$user = get_user_by( 'id', $user_id );
$customer_id = get_user_meta( $user_id, $meta_key, true );
}
// If the customer doesn't exist in Stripe, create it - otherwise get customer.
if ( empty( $customer_id ) ) {
return $this->create_customer( $user, $options );
} else {
return $customer_id;
}
}
private function get_customer( $user_id = 0, $options ) {
$meta_key = $this->get_user_meta_key( $options );
if ( 0 === $user_id ) {
$user = wp_get_current_user();
$customer_id = get_user_meta( $user->ID, $meta_key, true );
} else {
$user = get_user_by( 'id', $user_id );
$customer_id = get_user_meta( $user_id, $meta_key, true );
}
return $this->create_customer( $user, $options );
}
arthemes.org - AppThemes plugins, tutorials, modifications and services |
There are currently 1 users browsing this thread. (0 members and 1 guests)