• Resolved rgkmedia

    (@rgkmedia)


    Looking into offering bank wiring as a means of payment within Namaste. Noticed that with woocommerce you have the option to take payments directly. Only problem is woocommerce does this outside of wordpress so there is currently no way of knowing when the payment transaction has been successful – this has to be done manually. To automate it would need to write some code to interact with the bank’s payment gateway which then informs namaste when a payment has been successful. What is the flag within Namaste that states the user is now a paid up member of a course and where woudl it need to be flagged to?
    Also do you know of any other plugins compatible with Namaste that can handle direct bank transfers without the need for manual input?
    Thanks.

Viewing 1 replies (of 1 total)
  • Plugin Author Bob

    (@prasunsen)

    Each bank has its own API so finding a plugin that will work with your bank is very, very optimistic. You either have to write the code yourself or handle bank payments manually. If you are going to code, here’s how it’s done in Paypal – you’ll need similar code to handle the bank wires:

    // everything OK, insert payment and enroll
    		if($payment_completed and $txn_id_okay and $receiver_okay and $payment_currency_okay 
    				and $payment_amount_okay) {					
    			$wpdb->query($wpdb->prepare("INSERT INTO ".NAMASTE_PAYMENTS." SET 
    				course_id=%d, user_id=%s, date=CURDATE(), amount=%s, status='completed', paycode=%s, paytype='paypal'", 
    				$_GET['course_id'], $_GET['user_id'], $fee, $_POST['txn_id']));
    			
    			do_action('namaste-paid', $_GET['user_id'], $fee, "course", $_GET['course_id'], $is_school);	
    				
    			// enroll accordingly to course settings - this will be placed in a method once we 
    			// have more payment options
    			$enroll_mode = get_post_meta($_GET['course_id'], 'namaste_enroll_mode', true);	
    			if(!NamasteLMSStudentModel :: is_enrolled($_GET['user_id'], $_GET['course_id']))  {
    				$_course = new NamasteLMSCourseModel();
    				$status = ($enroll_mode == 'free') ? 'enrolled' : 'pending';				
    				$_course->enroll($_GET['user_id'], $_GET['course_id'], $status);
    			}	
    
    			if(!self :: $pdt_mode) exit;
    			else namaste_redirect(get_permalink($_GET['course_id']));
    		}  
Viewing 1 replies (of 1 total)
  • The topic ‘bank wiring with namaste’ is closed to new replies.