Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RedsysBundle] - route "redsys_result" getOrderId problem #42

Closed
xmon opened this issue Sep 16, 2015 · 4 comments
Closed

[RedsysBundle] - route "redsys_result" getOrderId problem #42

xmon opened this issue Sep 16, 2015 · 4 comments

Comments

@xmon
Copy link

xmon commented Sep 16, 2015

Hi there,

When TPV access route "redsys_result" after making the payment, the following error:

Error: Call to a member function getId() on a non-object

src/MyBundle/PaymentBridgeBundle/Services/PaymentBridge.php

public function getOrderId() { 
        return $this->order->getId(); 
} 

any idea to solve it?

@sfblaauw
Copy link
Contributor

This may be because no order has been passed in the onPaymentOrderLoad event:

public function onPaymentOrderLoad(PaymentOrderLoadEvent $event)
{
    $cart = $this->cartWrapper->get();
    $order = $this->cartOrderTransformer->createOrderFromCart($cart);
    $event
        ->getPaymentBridge()
        ->setPaymentMethod($event->getPaymentMethod())
        ->setOrder($order);
}

@xmon
Copy link
Author

xmon commented Sep 29, 2015

Thx @sfblaauw

I solved it, but now I get another error.

TPV POST access to "payment/redsys/result" before return to website.

and throw a exception: Unable to generate a URL for the named route "/payment/redsys/checkout/ok" as such route does not exist.

the route exist. any idea to solve it?

thanks again

@sfblaauw
Copy link
Contributor

This means that the configuration parameter payment_success route dose not exists.
Insted /payment/redsys/checkout/ok add the route name of this url

This is my Stripe configuration:

stripe:
    payment_success:
        route: my_route_payment_success # The route url is "/payment/redsys/checkout/ok"
        order_append_field: id
    payment_fail:
        route: my_route_payment_fail # The route url is "/payment/redsys/checkout/ko"
        order_append_field: id

@xmon
Copy link
Author

xmon commented Sep 29, 2015

Hi,

this is my configuration:

redsys:
         payment_success:
                  route: card_thanks
                  order_append: true
                  order_append_field: order_id
         payment_fail:
                  route: card_fail
                  order_append: false
                  order_append_field: card_id

I have no stripe configuration. it is necessary for redsysbundle?

in the payment process, when performed correctly, and the page still in TPV, this access to the URL POST mydomain.com/payment/redsys/result profiler and an exception is logged,

Unable to generate a URL for the named route "/payment/redsys/checkout/ok" as such route does not exist.

When you click Continue on TPV page to return back to my site, go to the URL mydomain.com/payment/redsys/checkout/ok?id=xxx and everything works correctly

thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants