Title: wpostest's Replies | WordPress.org

---

# wpostest

  [  ](https://wordpress.org/support/users/wpostest/)

 *   [Profile](https://wordpress.org/support/users/wpostest/)
 *   [Topics Started](https://wordpress.org/support/users/wpostest/topics/)
 *   [Replies Created](https://wordpress.org/support/users/wpostest/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/wpostest/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/wpostest/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/wpostest/engagements/)
 *   [Favorites](https://wordpress.org/support/users/wpostest/favorites/)

 Search replies:

## Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JetFormBuilder — Dynamic Blocks Form Builder] How to use form fields in HTML](https://wordpress.org/support/topic/how-to-use-form-fields-in-html/)
 *  Thread Starter [wpostest](https://wordpress.org/support/users/wpostest/)
 * (@wpostest)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/how-to-use-form-fields-in-html/#post-16064831)
 * I found a solution:
 *     ```
       <!DOCTYPE html>
       <html>
       <body>
       <h1>
       Hi %first_name%,
       </h1>
       </body>
       </html>
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Payment Plugins for Stripe WooCommerce] Unsucesfull payment or cancel order](https://wordpress.org/support/topic/unsucesfull-payment-or-cancel-order/)
 *  Thread Starter [wpostest](https://wordpress.org/support/users/wpostest/)
 * (@wpostest)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/unsucesfull-payment-or-cancel-order/#post-15091059)
 * Hi [@mrclayton](https://wordpress.org/support/users/mrclayton/),
 * The redirect URL is working correctly. Clients are returned to the checkout page.
   When they cancel the order or if they successfully pay for the order.
 * All the problem is there:
    I don’t want to show clients the checkout page and
   create orders when they cancel the order meanwhile payment because after that
   they cant pay again for this order.
 * Maybe is there exists any hook that I can use to redirect clients after an unsuccessful
   payment and then prevent creating an order?
 * Take care
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Payment Plugins for Stripe WooCommerce] Unsucesfull payment or cancel order](https://wordpress.org/support/topic/unsucesfull-payment-or-cancel-order/)
 *  Thread Starter [wpostest](https://wordpress.org/support/users/wpostest/)
 * (@wpostest)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/unsucesfull-payment-or-cancel-order/#post-15090161)
 * Okay, no problem.
 * 1. [https://imgur.com/vonp4W0](https://imgur.com/vonp4W0)
    2. [https://imgur.com/1v2J3Q2](https://imgur.com/1v2J3Q2)
   3. [https://imgur.com/NndAvMc](https://imgur.com/NndAvMc) 4. [https://imgur.com/DLEQNyT](https://imgur.com/DLEQNyT)
   5. [https://imgur.com/1jeQqOg](https://imgur.com/1jeQqOg)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Payment Plugins for Stripe WooCommerce] Unsucesfull payment or cancel order](https://wordpress.org/support/topic/unsucesfull-payment-or-cancel-order/)
 *  Thread Starter [wpostest](https://wordpress.org/support/users/wpostest/)
 * (@wpostest)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/unsucesfull-payment-or-cancel-order/#post-15090143)
 * Thank you for fast replay. I hope you can help me.
    I use “Przelewy24” payment
   method.
 * There is the visualisation
    1. [https://prnt.sc/20ekk5b](https://prnt.sc/20ekk5b)(
   Select payment and buy) 2. [https://prnt.sc/20el3ov](https://prnt.sc/20el3ov)(
   Cancel payment) 3. [https://prnt.sc/20el5wf](https://prnt.sc/20el5wf) (Back to
   shop) 4. [https://prnt.sc/20el71g](https://prnt.sc/20el71g) (Back to shop) 5.
   [https://prnt.sc/20elehs](https://prnt.sc/20elehs) (“orders/orders-recived” page)
 * I dont want to show clients step 5 (order recived page) and set order in woocomerce
   when their cancel order. Is there any solution for that?
 * Take care
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Referral Code] Referral by referral code](https://wordpress.org/support/topic/referral-by-referral-code/)
 *  Thread Starter [wpostest](https://wordpress.org/support/users/wpostest/)
 * (@wpostest)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/referral-by-referral-code/#post-13171327)
 * Then is there any place to extend functionality plugin without write my own plugin?
 * And of course you get 5 stars from me 😀
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Referral Code] Referral by referral code](https://wordpress.org/support/topic/referral-by-referral-code/)
 *  Thread Starter [wpostest](https://wordpress.org/support/users/wpostest/)
 * (@wpostest)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/referral-by-referral-code/#post-13170182)
 * Thank you alot for your fast answer. It helped me very much. I spent some time
   to did it. I tried to different methods and finally i made it. Propably with 
   not the best method but it work.
 * I would also like to ask you if I did the right thing to edit the code of this
   plugin directly? Or should I include the following functions elsewhere? It would
   be nice if you answered this question for me 🙂
 * I used the plugin Hook like you said and got the value there from that custom
   field.
 * **Now it looks like this, it may be useful to someone:**
 *     ```
       function um_post_registration_approved_hook( $user_id, $args ) {
       	um_fetch_user( $user_id );
       	UM()->user()->approve();
   
       	//Referal System
       	$new_user_id = $user_id;
       	$ref_code = "";
   
       	$new_user_ref_code = new WP_Refer_Code($new_user_id);
       	//Sprawdzamy czy textbox z jakiegos formularza zawiera kod referencyjny 
       	if($args["refferal"] != ""){
       		$ref_code = $args["refferal"];
       	}
       	else if($args["referal"] != ""){
       		$ref_code = $args["referal"];
       	}
       	else if($args["referall"] != ""){
       		$ref_code = $args["referall"];
       	}
   
       	if(!empty($ref_code) || $ref_code != ""){
       		$referrer_user_id = $new_user_ref_code->get_user_id_by_ref_code($ref_code);
   
       		do_action('wp_referral_code_before_refer_submitted', $new_user_id, $referrer_user_id, $ref_code, $new_user_ref_code);
   
       		update_user_meta( $new_user_id, 'wrc_referrer_id', $referrer_user_id);
   
       		$users_referred_by_referrer = get_user_meta( $referrer_user_id, 'wrc_invited_users', true );
       		if ( empty( $users_referred_by_referrer ) ) {
       			update_user_meta( $referrer_user_id, 'wrc_invited_users', [ $new_user_id ] );
       		} else {
       			$users_referred_by_referrer[] = $new_user_id;
       			update_user_meta( $referrer_user_id, 'wrc_invited_users', $users_referred_by_referrer );
       		}
   
       		do_action( 'wp_referral_code_after_refer_submitted', $new_user_id, $referrer_user_id, $ref_code, $new_user_ref_code );
       	}
       }
       add_action( 'um_post_registration_approved_hook', 'um_post_registration_approved_hook', 10, 2 );
       ```
   
 * **And here is catching the exception:**
 *     ```
       function um_custom_validate_reffcode( $key, $array, $args ) {
       	if ( isset( $args[$key] )) {
       		$ref_code = $args[$key];
       		$user_id = WP_Refer_Code::get_user_id_by_ref_code( $ref_code );
   
               if(empty($user_id)) {
                   UM()->form()->add_error( $key, __( 'Podany kod referencyjny jest nieprawidłowy.', 'ultimate-member' ) );
       		}
       	}
       }
       add_action( 'um_custom_field_validation_ReffCode_Valid', 'um_custom_validate_reffcode', 30, 3 );
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Referral Code] Referral by referral code](https://wordpress.org/support/topic/referral-by-referral-code/)
 *  Thread Starter [wpostest](https://wordpress.org/support/users/wpostest/)
 * (@wpostest)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/referral-by-referral-code/#post-13159865)
 * I have one more questions, is there any way to catch an error if the user gives
   the wrong reference code?

Viewing 7 replies - 1 through 7 (of 7 total)