Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Utku Turna15,090 Points
Wordpress WooCommerce Custom Payment Gateway Order Status
Hi i created a woocommerce custom payment gateway for my project. I works fine except for one thing. When i get the payment successfully the order status in admin area still listed as on-hold and after a while cancelled. I should be successful after payment.
This gateway redirects user to an external payment page after that it redirects them back to my thank you page if there is an error at payment it redirects to my error page etc.
Can you help me with that :( Thank you.
Thiago Tardioli18,054 Points
What is the parameter that your gateway returns to success or failure?
Could you put the snippet of your code that receives the parameter of your gateway?
Cheers, Thiago Tardioli
Utku Turna15,090 Points
list goes on etc. etc... '''
state=100 means successful. If its above 100 it fails.
They gave 3 options for confirmation actually, 1 email (thats not what i want) 2. HTTP/GET on webpage 3. Webservice
The codes above are for the 2nd option. HTTP GET.
In my plugin code i do that "'SuccessfulPageUrl' => 'http://webpage.com/thank-you'," i think i can write a php template for this page to execute status update am i right ?
I give parameters like this
array('token' => array( 'UserCode' => 'xxxx', 'Pin' => 'xxxxxxxxxxxxxx' ), 'input' => array( 'MPAY' => '', 'Content' => $urunler, 'SendOrderResult' => true, 'PaymentTypeId' => 1, etc. ....
I do that at the bottom "
$client = new nusoap_client($endpoint, true);
$response = $client->call('SaleWithTicket', $param, $mynamespace); $woocommerce->cart->empty_cart(); return array( 'result' => 'success', 'redirect' => $response['SaleWithTicketResult']['RedirectUrl'], );
Nothing wrong with payment etc. just i couldnt figure out how to update status in woocommerce panel after a successful payment.
Thank you so much for help :)