-
Notifications
You must be signed in to change notification settings - Fork 143
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
Issue showing the description on paypal checkout #52
Comments
I suppose you use payment details mapped supper class (Like it is shown in the sandbox). So these fields does not have doctrine mapping by default. <?php
$paymentDetails->setLPaymentrequestItemcategory(0, 0, Api::PAYMENTREQUEST_ITERMCATEGORY_DIGITAL);
$paymentDetails->setLPaymentrequestAmt(0, 0, $data['amount']);
$paymentDetails->setLPaymentrequestQty(0, 0, 1);
$paymentDetails->setLPaymentrequestName(0, 0, $data['item_name']);
$paymentDetails->setLPaymentrequestDesc(0, 0, $item->getDescription()); And you have to add it to your model manually (just an example): <?php
/**
* @ORM\Entity
*/
class PaypalPaymentDetails extends PaymentDetails
{
/**
* @ORM\Column(type="json_array")
*/
protected $l_paymentrequest_nnn_qtymmm = array();
} |
Thank you for your quick response, indeed that worked however now it's throwing me : "The model status must be new." |
could you debug PaymentDetailsStatusAction action: where it marks request as new |
I have the same problems, i find the docs to be not very clear in some cases so its quite hard to get a grasp on how things are supposed to be done. I have added an Item in my controller and now it direcs me directly to the captureDone action without showing paypal at all. It works fine if i remove the product info from the controller. Controller public function cgetAction(Request $request)
{
$paymentName = 'paypal_express_checkout_plus_doctrine';
$storage = $this->get('payum')->getStorageForClass(
'dubdng\PaymentBundle\Entity\PaypalExpressPaymentDetails',
$paymentName
);
$paymentDetails = $storage->createModel();
$paymentDetails->setPaymentrequestCurrencycode(0, 'EUR');
$paymentDetails->setLPaymentrequestItemcategory(0, 0, Api::PAYMENTREQUEST_ITERMCATEGORY_DIGITAL);
$paymentDetails->setLPaymentrequestAmt(0, 0, 99);
$paymentDetails->setLPaymentrequestQty(0, 0, 1);
$paymentDetails->setLPaymentrequestName(0, 0, 'text');
$paymentDetails->setLPaymentrequestDesc(0, 0, 'desc');
$paymentDetails->setPaymentrequestAmt(0, 99);
$storage->updateModel($paymentDetails);
$captureToken = $this->get('payum.security.token_factory')->createCaptureToken(
$paymentName,
$paymentDetails,
'payment_paypal_done' // the route to redirect after capture;
);
$paymentDetails->setInvnum($paymentDetails->getId());
$paymentDetails->setReturnurl($captureToken->getTargetUrl());
$paymentDetails->setCancelurl($captureToken->getTargetUrl());
$storage->updateModel($paymentDetails);
return $this->redirect($captureToken->getTargetUrl());
} Entity <?php
namespace dubdng\PaymentBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Payum\Paypal\ExpressCheckout\Nvp\Bridge\Doctrine\Entity\PaymentDetails;
/**
* @ORM\Entity
*/
class PaypalExpressPaymentDetails extends PaymentDetails
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
protected $id;
/**
* @ORM\Column(type="json_array")
*/
protected $l_paymentrequest_nnn_qtymmm = array();
/**
* @ORM\Column(type="json_array")
*/
protected $l_paymentrequest_nnn_namemmm = array();
/**
* @ORM\Column(type="json_array")
*/
protected $l_paymentrequest_nnn_descmmm = array();
/**
* @ORM\Column(type="json_array")
*/
protected $l_paymentrequest_nnn_amtmmm = array();
/**
* @ORM\Column(type="json_array")
*/
protected $l_paymentrequest_nnn_itemcategorymmm = array();
} |
@awdng could you post what the payment details contains when you come to doneAction? <?php
var_dump(iterator_to_array($paymentDetails)); |
you could help me improve docs |
I debugged my error, it's throwing this: After paying: [2013-10-11 20:37:51] app.DEBUG: [Payum] 1# Payum\Action\StatusDetailsAggregatedModelAction::execute(BinaryMaskStatusRequest{model: PayumSecurityToken}) [] []
[2013-10-11 20:37:51] app.DEBUG: [Payum] 2# Payum\Paypal\ExpressCheckout\Nvp\Action\PaymentDetailsStatusAction::execute(BinaryMaskStatusRequest{model: PaypalExpressPaymentDetails}) [] []
[2013-10-11 20:37:51] app.ERROR: [ERROR]: The model status must be new. with code: 0 [] []
[2013-10-11 20:37:51] security.DEBUG: Write SecurityContext in the session [] [] the checkout itsself (when getting redirected to paypal) [2013-10-11 20:30:16] app.DEBUG: [Payum] 1# Payum\Action\StatusDetailsAggregatedModelAction::execute(BinaryMaskStatusRequest{model: PayumSecurityToken}) [] []
[2013-10-11 20:30:16] app.DEBUG: [Payum] 2# Payum\Paypal\ExpressCheckout\Nvp\Action\PaymentDetailsStatusAction::execute(BinaryMaskStatusRequest{model: PaypalExpressPaymentDetails}) [] []
[2013-10-11 20:30:16] app.DEBUG: [Payum] 1# Payum\Action\CaptureDetailsAggregatedModelAction::execute(SecuredCaptureRequest{model: PayumSecurityToken}) [] []
[2013-10-11 20:30:16] app.DEBUG: [Payum] 2# Payum\Paypal\ExpressCheckout\Nvp\Action\CaptureAction::execute(SecuredCaptureRequest{model: PaypalExpressPaymentDetails}) [] []
[2013-10-11 20:30:16] app.DEBUG: [Payum] 3# Payum\Paypal\ExpressCheckout\Nvp\Action\Api\SetExpressCheckoutAction::execute(SetExpressCheckoutRequest{model: ArrayObject}) [] []
[2013-10-11 20:30:17] app.DEBUG: [Payum] 3# Payum\Paypal\ExpressCheckout\Nvp\Action\Api\AuthorizeTokenAction::execute(AuthorizeTokenRequest{model: ArrayObject}) [] []
[2013-10-11 20:30:17] app.DEBUG: [Payum] 3# AuthorizeTokenAction::execute(AuthorizeTokenRequest{model: ArrayObject}) throws interactive RedirectUrlInteractiveRequest{url: https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-87481783VH369064X} [] []
[2013-10-11 20:30:17] app.DEBUG: [Payum] 2# CaptureAction::execute(SecuredCaptureRequest{model: PaypalExpressPaymentDetails}) throws interactive RedirectUrlInteractiveRequest{url: https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-87481783VH369064X} [] []
[2013-10-11 20:30:17] app.DEBUG: [Payum] 1# CaptureDetailsAggregatedModelAction::execute(SecuredCaptureRequest{model: PaypalExpressPaymentDetails}) throws interactive RedirectUrlInteractiveRequest{url: https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-87481783VH369064X} [] [] |
Everything appears to be working when i set it to @dev release, however i don't receive any ipn calls anymore now |
this may be helpful if you are sure you setup it correctly: http://stackoverflow.com/questions/18556794/calling-ipn-paypal-payumbundle/18558813 |
For people who are looking for my solution, make sure ipn is also enabled on the paypal side, you can also check if there are incomming ipn calls on the paypal ipn history. Thank you for the great support |
Still getting [2013-10-18 22:09:35] app.DEBUG: [Payum] 1# Payum\Action\StatusDetailsAggregatedModelAction::execute(BinaryMaskStatusRequest{model: PayumSecurityToken}) [] []
[2013-10-18 22:09:35] app.DEBUG: [Payum] 2# Payum\Paypal\ExpressCheckout\Nvp\Action\PaymentDetailsStatusAction::execute(BinaryMaskStatusRequest{model: PaypalExpressPaymentDetails}) [] []
[2013-10-18 22:09:35] app.ERROR: [ERROR]: The model status must be new. with code: 0 [] [] It only seems to happen on some occassions |
@c4d3r I am completely sure you missed something. The sandbox is working. I also added paypal express checkout usage to Sylius E-Commerce Platform. That's work fine. Are you sure you do not call capture for same model twice? |
Add the column: array for the 0.7 version |
I had the exact same problem. After the payment on PayPal I got the exception "The model status must be new.". After some debugging (or simply dumping the model) I found the error. Checkout the last lines of the model:
Therefore the description is too long. After i truncated it in the controller everthing works as excepted. Maybe this helps someone. |
thanks for sharing this with us. FYI: I am going to remove a check about payment status in capture controller. |
I am trying to get a purchase to show its description, name and price but nothing is showing up, this is what i get on checkout
http://prntscr.com/1vp82e
The code i am using:
The text was updated successfully, but these errors were encountered: