1997 Posts in 529 Topics by 433 members
E-Commerce Modules
SilverStripe Forums » E-Commerce Modules » PaymatePayment_Handler Paid function - issues accessing response data
Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.
Moderators: martimiz, Nicolaas, Howard, Sean, Ryan M., biapar, Willr, Ingo, Jedateach, swaiba, simon_w
| Go to End | Next > | |
| Author | Topic: | 1052 Views |
-
PaymatePayment_Handler Paid function - issues accessing response data

22 November 2009 at 5:29pm Last edited: 23 November 2009 8:02am
Hi
I have got the as far as sending the order information to Paymate, completing the order and then returning to the website. I get stuck when I try to retreive the information that Paymate has reutrned.
I have the code class PaymatePayment_Handler extends Controller {
/**
* Get the Order object to modify, check security that it's the object you want to modify based
* off Paymate confirmation, update the Order object to show complete and Payment object to show
* that it was received. Finally, send a receipt to the buyer to show these details.
*/
function paid() {
global $project;
$orderID = $_POST['ref'];
$order = $order = DataObject::get_by_id("Order", $orderID);
if($order) ....but it appears I am not successfully retreiving ref which is the Paymate name for the Silverstripe OrderID. When I do an isDev it is the $orderID = $_POST['ref']; line that is highlighted with the errors
* PaymatePayment_Handler->paid(HTTPRequest)
Line 162 of Controller.php
* Controller->handleAction(HTTPRequest)
Line 107 of RequestHandler.php
* RequestHandler->handleRequest(HTTPRequest)
Line 122 of Controller.php
* Controller->handleRequest(HTTPRequest)
Line 277 of Director.php
* Director::handleRequest(HTTPRequest,Session)
Line 121 of Director.php
* Director::direct(/PaymatePayment_Handler/paid/72/)
Line 115 of main.phpSo am I right in understanding that this means I am not accessing the Paymate info? Any suggestion on what I am doing wrong (any other work I have seen on accessing a Pamate response uses this)?
Thanks
MM
-
Re: PaymatePayment_Handler Paid function - issues accessing response data

24 November 2009 at 4:00am
Found the issue. Te returned value was being prefix with Order #.
function paid() {
global $project;
$orderID = $_POST[ref];
$orderID = str_replace("Order #","",$orderID);
$order = DataObject::get_by_id("Order",$orderID );
Fixed this.Very happy
Catherine
-
Re: PaymatePayment_Handler Paid function - issues accessing response data

24 November 2009 at 2:00pm
Hey would you be able to post the working code for Paymate. Really keen to use it with my site.
Thanks
Liam -
Re: PaymatePayment_Handler Paid function - issues accessing response data

24 November 2009 at 5:19pm
Hi Liam
Will do, but it'll be the weekend before I post. Am travelling and don't have access to the code, sorry
C
-
Re: PaymatePayment_Handler Paid function - issues accessing response data

24 November 2009 at 5:57pm
Ok that's cool. Thanks.
-
Re: PaymatePayment_Handler Paid function - issues accessing response data

29 November 2009 at 9:54pm
Hey Liam
Attached as promised. There are a couple of issues still to iron out see http://www.silverstripe.org/e-commerce-module-forum/show/274386#post274386#post274386 for details
Send me any feedback/improvements
Catherine
-
Re: PaymatePayment_Handler Paid function - issues accessing response data

2 December 2009 at 9:31am
Thanks for this, havent been able to get to work so far but will keep trying.
-
Re: PaymatePayment_Handler Paid function - issues accessing response data

6 December 2009 at 9:49am
Hey Liam
Where is it failing?
Cheers
Catherine
| 1052 Views | ||
| Go to Top | Next > |

