-
Notifications
You must be signed in to change notification settings - Fork 24
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: Error creating UrlOK to complete the process #10
Comments
@mashware Hi! Are you working with this bundle? Are you testing it? This issue is because, somewhere, instead of generating the route with the name of |
@mashware BTW, Thanks for the feedback :) |
@mmoreram I'm seeing how it works to use it on a website. Events use PaymentSuite\PaymentCoreBundle\Services\Interfaces\PaymentBridgeInterface;
class PaymentBridge implements PaymentBridgeInterface {
/**
* @var Object
*
* Order object
*/
private $order;
/**
* @var integer
*
*/
private $amount;
/**
* @var string
*
*/
private $orderNumber;
public function getPaymentName()
{
return 'redsys';
}
/**
* Set order to PaymentBridge
*
* @var Object $order Order element
*/
public function setOrder($order)
{
$this->order = $order;
}
/**
* Return order
*
* @return Object order
*/
public function getOrder()
{
return $this->order;
}
/**
* Return order identifier value
*
* @return integer
*/
public function getOrderId()
{
return $this->order->getId();
}
/**
* Given an id, find Order
*
* @param int $orderId
* @return Object order
*/
public function findOrder($orderId)
{
/*
* Your code to get Order
*/
return $this->order;
}
/**
* Get the currency in which the order is paid
*
* @return string
*/
public function getCurrency()
{
/*
* Set your static or dynamic currency
*/
return 'EUR'; //EUR
}
/**
* Get total order amount in cents
*
* @return integer
*/
public function getAmount()
{
/*
* Return payment amount (in cents)
*/
return $this->amount;
}
public function setAmount($amount)
{
$this->amount = $amount;
return $this;
}
/**
* Return if order has already been paid
*
* @return boolean
*/
public function isOrderPaid()
{
return array();
}
/**
* Get extra data
*
* @return array
*/
public function getExtraData()
{
return array('terminal' => '001');
}
/**
* @return string
*/
public function getOrderNumber()
{
return $this->orderNumber;
}
/**
* @param $orderNumber
* @return $this
*/
public function setOrderNumber($orderNumber)
{
$this->orderNumber = $orderNumber;
return $this;
}
} EventListener public function onPaymentOrderLoad(PaymentOrderLoadEvent $paymentOrderLoadEvent)
{
$pedido = new Pedido();
$pedido->setTotal(200);
$this->entityManager->persist($pedido);
$this->entityManager->flush();
$paymentBridge = $paymentOrderLoadEvent->getPaymentBridge();
$paymentBridge->setOrder($pedido);
$paymentBridge->setAmount($pedido->getTotal());
$paymentBridge->setOrderNumber('000'.$pedido->getId());
}
/**
* On payment order created event
*
* @param PaymentOrderCreatedEvent $paymentOrderCreatedEvent Payment Order Created event
*/
public function onPaymentOrderCreated(PaymentOrderCreatedEvent $paymentOrderCreatedEvent)
{
}
/**
* On payment done event
*
* @param PaymentOrderDoneEvent $paymentOrderDoneEvent Payment Order Done event
*/
public function onPaymentOrderDone(PaymentOrderDoneEvent $paymentOrderDoneEvent)
{
}
/**
* On payment success event
*
* @param PaymentOrderSuccessEvent $paymentOrderSuccessEvent Payment Order Success event
*/
public function onPaymentOrderSuccess(PaymentOrderSuccessEvent $paymentOrderSuccessEvent)
{
}
/**
* On payment fail event
*
* @param PaymentOrderFailEvent $paymentOrderFailEvent Payment Order Fail event
*/
public function onPaymentOrderFail(PaymentOrderFailEvent $paymentOrderFailEvent)
{
} Services payment.bridge:
class: Escuela\PaymentBridgeBundle\Services\PaymentBridge
payment.event.listener:
class: Escuela\PaymentBridgeBundle\EventListener\Payment
arguments: [@doctrine.orm.entity_manager]
tags:
- { name: kernel.event_listener, event: payment.order.done, method: onPaymentOrderDone }
- { name: kernel.event_listener, event: payment.order.created, method: onPaymentOrderCreated }
- { name: kernel.event_listener, event: payment.order.load, method: onPaymentOrderLoad }
- { name: kernel.event_listener, event: payment.order.success, method: onPaymentOrderSuccess }
- { name: kernel.event_listener, event: payment.order.fail, method: onPaymentOrderFail } |
From what I've seen of Bundle (I do not know if it has anything to do, I will not say if it helps) is that in the "PaymentSuite\RedsysBundle\Services\Wrapper\RedsysFormTypeWrapper", line 173 and 174 file is assigned directly config value instead of generating routes: ->add('Ds_Merchant_UrlOK', 'hidden', array(
'data' => $this->Ds_Merchant_UrlOK,
))
->add('Ds_Merchant_UrlKO', 'hidden', array(
'data' => $this->Ds_Merchant_UrlKO,
)) Config payment_success:
route: card_thanks
order_append: true
order_append_field: order_id
payment_fail:
route: card_view
order_append: false
order_append_field: card_id in the debug I see: $this->Ds_Merchant_UrlOK = card_thanks
$this->Ds_Merchant_UrlKO = card_view I guess this is where they generate the routes opened and not directly assign the value of config. |
Hello, any news on this? or do I put the full url in the config directly? |
Hello, it's a bug, in Take a look at we have done on PaypalWebCheckoutBundle => https://github.com/PaymentSuite/PaypalWebCheckoutBundle/blob/master/Services/Wrapper/PaypalFormTypeWrapper.php Then you can generate the correct url /c @mmoreram |
Hello again, Pd: @mickaelandrieu: Sorry but still find myself not able to make such modifications. |
decouple paylands component from paylands bundle
When you click on 'Next' to finish the payment at the TPV is:
https://sis-t.redsys.es:25443/sis/card_thanks
Sorry for my GoogleIngles
The text was updated successfully, but these errors were encountered: