Retrieve posts created by a specific Symfony user - symfony

I have a $ type boolean property, I need to differentiate my two types of posts I am trying to retrieve posts of type = true, (which are recipes) of a specific user for the user profile page.
/**
* #Route("/profil/{id}", name="profil", methods={"GET","POST"})
*
*/
public function index(User $user): Response
{
$em = $this->getDoctrine()->getManager();
$publications = $em->getRepository('App:Publication')->findBy(
array('users' => $user->getId()),
array('created_at' => 'Desc')
);
****// list the publication of recipes
$recette = $em->getRepository('App:Publication')->findBy(['type'=>true],['created_at' => 'desc']);****
// recuperar las 3 ultimas recetas para el sidebar rigth
$lastRecettes = $this->getDoctrine()->getRepository(Publication::class)->lastXRecette(4);
// lister les 9 dernières recettes
$recette = $this->getDoctrine()->getRepository(Publication::class)->lastPRecette(9);
return $this->render('profil/index.html.twig', [
'publications' => $publications,
'recettes' => $recette,
'user' => $user,
'lastRecettes' => $lastRecettes,
]);
}
the highlighted part allows me to retrieve all the recipes but I don't know how to add the user I tried this but it is not correct:
$recette = $em->getRepository('App:Publication')->findBy(['type'=>true], ['users' => $user->getId()],['created_at' => 'desc']);

Yes, as proposed (but maybe in a confused way) by #mustapha-ghlissi you have to include the test on your user on the first argument of the findBy method like this :
$recette = $em->getRepository('App:Publication')->findBy(['type' => true, 'users' => $user->getId()],['created_at' => 'desc']);

PublicationRepository.php
public function getRecettesUser(User $user)
{
return $this->createQueryBuilder('p')
->andWhere('p.users = :user')
->andWhere('p.type = :type')
->setParameter('user', $user)
->setParameter('type', true)
->getQuery()
->getResult();
}
create a folder src/Manager/PublicationManager.php
use App\Entity\Publication;
use App\Entity\User;
use Doctrine\ORM\EntityManagerInterface;
class PublicationManager
{
protected $em;
public function __construct(EntityManagerInterface $entityManager)
{
$this->em = $entityManager;
}
public function getRecetteByUser(User $user)
{
return $this->em->getRepository(Publication::class)->findBy(
['type' => true, 'users' => $user->getId()],['created_at' => 'desc']
);
}
}
My Controller
/**
* #Route("/profil/{id}", name="profil", methods={"GET","POST"})
*
*/
public function index(User $user, PublicationManager $publicationManager): Response
{
$em = $this->getDoctrine()->getManager();
$publications = $em->getRepository('App:Publication')->findBy(
array('users' => $user->getId()),
array('created_at' => 'Desc')
);
// recuperer les 3 dernier recettes pour le sidebar right
$lastRecettes = $this->getDoctrine()->getRepository(Publication::class)
->lastXRecette(4);
return $this->render('profil/index.html.twig', [
'publications' => $publications,
'recettes' => $publicationManager->getRecetteByUser($user),
'lastRecettes' => $lastRecettes,
]);
}

I'm not sure if I well understood your problem
But may your code should look like this :
/**
* #Route("/profil/{id}", name="profil", methods={"GET","POST"})
*
*/
public function index(User $user): Response
{
$em = $this->getDoctrine()->getManager();
// First type
$truePublications = $em->getRepository(Publication::class)->findBy(
array('user' => $user->getId(), 'type' => true),
array('created_at' => 'DESC'),
);
// Second type
$falsePublications = $em->getRepository(Publication::class)->findBy(
array('user' => $user->getId(), 'type' => false),
array('created_at' => 'DESC'),
);
// recuperar las 3 ultimas recetas para el sidebar rigth
$lastRecettes = $this->getDoctrine()->getRepository(Publication::class)->lastXRecette(3);
// lister les 9 dernières recettes
$recette = $this->getDoctrine()->getRepository(Publication::class)->lastPRecette(9);
return $this->render('profil/index.html.twig', [
'trueTypePublications' => $truePublications,
'falseTypePublications' => $falsePublications,
'recettes' => $recette,
'user' => $user,
'lastRecettes' => $lastRecettes,
]);
}

Related

Symfony2 Cannot instantiate interface Doctrine\Common\Collections\Collection

Symfony version 2.8
I have a problem when I try to add new Collection(); in construct function of User Entity.
public function __construct()
{
$this->sectors = new Collection();
parent::__construct();
}
Sector has many to many relationship
/**
* #ORM\ManyToMany(targetEntity="UserBundle\Entity\Sectors", fetch="EAGER")
* #ORM\JoinTable(
* joinColumns={#ORM\JoinColumn(onDelete="CASCADE")},
* inverseJoinColumns={#ORM\JoinColumn(onDelete="CASCADE")}
* )
*/
public $sectors;
and getter/setter methods are
/**
* Add sector
*
* #param UserBundle\Entity\Sectors $sector
*
* #return User
*/
public function addSector(UserBundle\Entity\Sectors $sector)
{
$this->sectors[] = $sector;
return $this;
}
/**
* Remove sector
*
* #param UserBundle\Entity\Sectors $sector
*/
public function removeSector(UserBundle\Entity\Sectors $sector)
{
$this->sectors->removeElement($sector);
}
/**
* Get sectors
*
* #return \Doctrine\Common\Collections\Collection
*/
public function getSectors()
{
return $this->sectors;
}
When in a FormType I do:
$builder
->add('sectors', EntityType::class, array(
'class' => 'UserBundle\Entity\Sectors',
'placeholder' => 'Select Sector ...',
'label' => 'Sector',
'required' => false,
'attr' => ['placeholder' => 'Select Sector ...', 'data-jcf' => '{"wrapNative": false, "wrapNativeOnMobile": false, "useCustomScroll": true, "multipleCompactStyle": true}'],
'multiple' => true,
'expanded' => false,
'query_builder' => function(EntityRepository $er) {
return $er->createQueryBuilder('u')
->orderBy('u.name', 'ASC');
},
));
$formModify = function (FormInterface $form, \Doctrine\Common\Collections\ArrayCollection $sector, $factory) {
$output = [];
foreach($sector as $sec) {
$output[] = $sec->id;
}
$formOption = array(
'class' => 'UserBundle\Entity\UserAccreditation',
'multiple' => true,
'auto_initialize' => false,
'required' => false,
'expanded' => true,
'choice_attr' => function ($output) {
return ['class' => 'attr_checkbox'];
},
'query_builder' => function(EntityRepository $ertt) use ($output) {
$qb = $ertt->createQueryBuilder('g');
$qb->select(array('g'));
$qb->where('g.sector IN (:sector_id)');
$qb->setParameters( array('sector_id' => $output) );
$qb->orderBy('g.name', 'ASC');
return $qb;
},
);
$form->add($factory->createNamed('accreditationdata', EntityType::class, null, $formOption));
};
$builder->addEventListener(FormEvents::PRE_SET_DATA,function (FormEvent $event) use ($formModify,$factory) {
$data = $event->getData();
$form = $event->getForm();
if ($data != null) {
//print_r(get_object_vars($data->getSectors()));
$formModify($event->getForm(), $data->getSectors(),$factory);
}
}
);
$factory = $builder->getFormFactory();
$builder->get('sectors')->addEventListener(FormEvents::POST_SUBMIT,function (FormEvent $event) use ($formModify,$factory) {
$sector = $event->getForm()->getData();
//print_r($sector);
$formModify($event->getForm()->getParent(), $sector,$factory);
}
);
I get following error:
Fatal error: Cannot instantiate interface Doctrine\Common\Collections\Collection
Earlier I am using ArrayCollection instead of Collection, I have to do this because I am getting error
Type error: Argument 2 passed to UserBundle\Form\Type\ProfileAboutMeFormType::UserBundle\Form\Type{closure}() must be an instance of Doctrine\Common\Collections\ArrayCollection, instance of Doctrine\ORM\PersistentCollection given,
and by searching on google I found this solution on github link
https://github.com/doctrine/orm/issues/5946
but still I am facing the problem. can anyone tell me What goes wrong here ?

Symfony2 Dynamic Form Modification not saving generated data

I'm going crazy because if I choose a client from an entity field, it correctly populate the second entity field called proposals. Then I choose the proposal dynamically generated, but when I save the form it saves the form correctly but without filling the proposal field. I followed the Symfony Tutorial about the Dynamic Forms which can be found here
This is my FormType code:
public function buildForm(FormBuilderInterface $builder, array $options) {
$builder->add('client', 'entity', array(
'class' => 'AppBundle\Entity\Client',
'property' => 'name',
'label' => 'Client:',
'empty_value' => '',
'required' => false,
'query_builder' => function (EntityRepository $er) {
return $er->createQueryBuilder('u')
->orderBy('u.name', 'ASC');
},
));
$formModifier = function (FormInterface $form, Client $client = null) {
$proposals = null === $client ? array() : $this->em->getRepository('AppBundle:Proposals')->findBy(
array('client'=>$client->getId()),
array('id' => 'DESC'));
$form->add('proposal', 'entity', array(
'class' => 'AppBundle\Entity\Proposal',
'choice_label' => 'subject',
'placeholder' => '',
'choices' => $proposals,
'label' => 'Proposal',
'required' => false
));
};
$builder->addEventListener(
FormEvents::PRE_SET_DATA,
function (FormEvent $event) use ($formModifier) {
$client = null;
$data = $event->getData();
if(!empty($data)) {
$client = $data->getClient();
}
$formModifier($event->getForm(), $client );
}
);
$builder->get('client')->addEventListener(
FormEvents::POST_SUBMIT,
function (FormEvent $event) use ($formModifier) {
$client = $event->getForm()->getData();
$formModifier($event->getForm()->getParent(), $client);
}
);
This is the Prenotazione Entity, the one who belong the form.
class Prenotazione {
/**
* #ORM\Id
* #ORM\Column(type="integer")
* #ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* #ORM\ManyToOne(targetEntity="Client", inversedBy="prenotazioni")
* #ORM\JoinColumn(name="client_id", referencedColumnName="id")
*/
private $client;
/**
* #ORM\OneToOne(targetEntity="Proposal", inversedBy="prenotazione")
* #ORM\JoinColumn(name="proposal_id", referencedColumnName="id")
*/
private $proposal;
public function getId() {
return $this->id;
}
public function setProposal(\AppBundle\Entity\Proposal $proposal = null)
{
$this->proposal = $proposal;
return $this;
}
public function getProposal() {
return $this->proposal;
}
public function setClient(\AppBundle\Entity\Client $client = null)
{
$this->client = $client;
return $this;
}
public function getClient()
{
return $this->client;
}
}
Where am I wrong ?
Are you sure your proposals query is correct?
$proposals = null === $client ? array() : $this->em->getRepository('AppBundle:Proposals')->findBy(
array('client'=>$client->getId()),
array('id' => 'DESC'));
Shouldn't this be either array('client_id' => $client->getId()), or array('client' => $client),?
Try checking the actual content of $proposals by adding a dump($proposals) just below and looking up the result in the symfony profiler.

jsmPayment etsPaymentOgone gives me an error The controller must return a response

I'm trying to implement JSMPayment and EtsPaymentOgoneBundle without success.
I get the error : "The controller must return a response". I'm agree with that but it's so written in the documentation. So am I something wrong or is it a bug/error in the documentation.
The error may be this but it's so written in doc...
return array(
'form' => $form->createView()
);
Now, if I change this line and return to a twig template, I only get one radio button. Why ?
Any help will very help me because, I'm really lost.
My all controller
/**
*
*/
class PaymentController extends Controller
{
/** #DI\Inject */
private $request;
/** #DI\Inject */
private $router;
/** #DI\Inject("doctrine.orm.entity_manager") */
private $em;
/** #DI\Inject("payment.plugin_controller") */
private $ppc;
/**
*
* #param \CTC\Bundle\OrderBundle\Controller\Order $order
* #return RedirectResponse
*/
public function detailsAction(Order $order, Request $request)
{
$form = $this->getFormFactory()->create('jms_choose_payment_method', null, array(
'amount' => $order->getPackage()->getAmount(),
'currency' => 'EUR',
'default_method' => 'ogone_gateway', // Optional
'predefined_data' => array(
'ogone_gateway' => array(
'tp' => '', // Optional
'PM' => $pm, // Optional - Example value: "CreditCard" - Note: You can consult the list of PM values on Ogone documentation
'BRAND' => $brand, // Optional - Example value: "VISA" - Note: If you send the BRAND field without sending a value in the PM field (‘CreditCard’ or ‘Purchasing Card’), the BRAND value will not be taken into account.
'CN' => $billingAddress->getFullName(), // Optional
'EMAIL' => $this->getUser()->getEmail(), // Optional
'OWNERZIP' => $billingAddress->getPostalCode(), // Optional
'OWNERADDRESS' => $billingAddress->getStreetLine(), // Optional
'OWNERCTY' => $billingAddress->getCountry()->getName(), // Optional
'OWNERTOWN' => $billingAddress->getCity(), // Optional
'OWNERTELNO' => $billingAddress->getPhoneNumber(), // Optional
'lang' => $request->getLocale(), // 5 characters maximum, for e.g: fr_FR
'ORDERID' => '123456', // Optional, 30 characters maximum
),
),
));
if ('POST' === $this->request->getMethod()) {
$form->bindRequest($this->request);
if ($form->isValid()) {
$this->ppc->createPaymentInstruction($instruction = $form->getData());
$order->setPaymentInstruction($instruction);
$this->em->persist($order);
$this->em->flush($order);
return new RedirectResponse($this->router->generate('payment_complete', array(
'orderNumber' => $order->getOrderNumber(),
)));
}
}
return array(
'form' => $form->createView()
);
}
/**
*
*/
public function completeAction(Order $order)
{
$instruction = $order->getPaymentInstruction();
if (null === $pendingTransaction = $instruction->getPendingTransaction()) {
$payment = $this->ppc->createPayment($instruction->getId(), $instruction->getAmount() - $instruction->getDepositedAmount());
} else {
$payment = $pendingTransaction->getPayment();
}
$result = $this->ppc->approveAndDeposit($payment->getId(), $payment->getTargetAmount());
if (Result::STATUS_PENDING === $result->getStatus()) {
$ex = $result->getPluginException();
if ($ex instanceof ActionRequiredException) {
$action = $ex->getAction();
if ($action instanceof VisitUrl) {
return new RedirectResponse($action->getUrl());
}
throw $ex;
}
} else if (Result::STATUS_SUCCESS !== $result->getStatus()) {
throw new \RuntimeException('Transaction was not successful: '.$result->getReasonCode());
}
// payment was successful, do something interesting with the order
}
public function cancelAction(Order $order)
{
die('cancel the payment');
}
/** #DI\LookupMethod("form.factory") */
protected function getFormFactory() { }
}
if you use
return array(
'form' => $form->createView()
);
at the controller, then you should add #Template annotation to the controller action
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
class PaymentController extends Controller
{
...
/**
*
* #param \CTC\Bundle\OrderBundle\Controller\Order $order
* #Template()
* #return RedirectResponse
*/
public function detailsAction(Order $order, Request $request)
or you should return "render" with a template
return $this->render('MyAppSomeBundle:Payment:details.html.twig', array( 'form' => $form->createView());

Passing user to symfony2 formType with PUGX multiuser

I'm using PUGX MultiuserBundle because i have 3 differents type of users, with differents informations.
Everything works well, i can register those differents users.
What i want to do is : register user one (it s ok) => this user can create his partner and choose in which establishement he put him.
So, in my second formType, i have to pass user one so i can get all his establishement. But i don t know how to do it with PUGX bundle
My controller :
class BarmanController extends Controller
{
/**
* Register new Barman entities.
*
* #Route("/register", name="barman_register")
* #Template()
*/
public function registerAction()
{
$user = $this->container->get('security.context')->getToken()->getUser();
return $this->container
->get('pugx_multi_user.registration_manager')
->register('Cac\UserBundle\Entity\Barman', $user);
}
}
The PUGX RegistrationManager :
/**
*
* #param string $class
* #return \Symfony\Component\HttpFoundation\RedirectResponse
*/
public function register($class, $user)
{
$this->userDiscriminator->setClass($class);
$this->controller->setContainer($this->container);
$result = $this->controller->registerAction($this->container->get('request'));
if ($result instanceof RedirectResponse) {
return $result;
}
$template = $this->userDiscriminator->getTemplate('registration');
if (is_null($template)) {
$engine = $this->container->getParameter('fos_user.template.engine');
$template = 'FOSUserBundle:Registration:register.html.'.$engine;
}
$form = $this->formFactory->createForm();
return $this->container->get('templating')->renderResponse($template, array(
'form' => $form->createView(),
));
}
And my formType for the second user :
class BarmanFormType extends AbstractType
{
private $class;
/**
* #param string $class The User class name
*/
public function __construct($class)
{
$this->class = $class;
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
$id = 5;
$builder
->add('username', null, array('label' => 'Nom d\'utilisateur'))
->add('plainPassword', 'repeated', array(
'label' => 'Mot de passe',
'type' => 'password',
'options' => array('translation_domain' => 'FOSUserBundle'),
'first_options' => array('label' => 'Mot de passe'),
'second_options' => array('label' => 'Confirmez votre mot de passe'),
'invalid_message' => 'fos_user.password.mismatch',
))
->add('email', 'repeated', array(
'type' => 'email',
'options' => array('translation_domain' => 'FOSUserBundle'),
'first_options' => array('label' => 'E-mail'),
'second_options' => array('label' => 'Confirmez votre e-mail'),
'invalid_message' => 'fos_user.email.mismatch',
))
->add('bar', 'entity', array('class' => 'CacBarBundle:Bar', 'property' => 'name', 'attr' => array('placeholder' => 'Bar'),
'query_builder' => function(\Cac\BarBundle\Entity\BarRepository $er) use ($id) {
return $er->getBarByAuthorId($id);
}
));
;
}
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => $this->class,
'intention' => 'registration',
));
}
public function getName()
{
return 'cac_barman_registration';
}
}
I also have a general register controller that override FOS User registration controller :
class RegistrationController extends Controller
{
public function registerAction(Request $request)
{
/** #var $formFactory \FOS\UserBundle\Form\Factory\FactoryInterface */
$formFactory = $this->get('fos_user.registration.form.factory');
/** #var $userManager \FOS\UserBundle\Model\UserManagerInterface */
$userManager = $this->get('fos_user.user_manager');
/** #var $dispatcher \Symfony\Component\EventDispatcher\EventDispatcherInterface */
$dispatcher = $this->get('event_dispatcher');
$user = $userManager->createUser();
$user->setEnabled(true);
$event = new GetResponseUserEvent($user, $request);
$dispatcher->dispatch(FOSUserEvents::REGISTRATION_INITIALIZE, $event);
if (null !== $event->getResponse()) {
return $event->getResponse();
}
$form = $formFactory->createForm();
$form->setData($user);
$form->handleRequest($request);
if ($form->isValid()) {
$event = new FormEvent($form, $request);
$dispatcher->dispatch(FOSUserEvents::REGISTRATION_SUCCESS, $event);
$userManager->updateUser($user);
if (null === $response = $event->getResponse()) {
if (strpos($request->getPathInfo(), "/barman/") === false) {
$url = $this->generateUrl('fos_user_registration_confirmed');
$response = new RedirectResponse($url);
}
else
{
$this->get('session')->getFlashBag()->add('notice','Le barman a était créé !');
$response = new Response('barman');
}
}
$dispatcher->dispatch(FOSUserEvents::REGISTRATION_COMPLETED, new FilterUserResponseEvent($user, $request, $response));
return $response;
}
return $this->render('CacUserBundle:Registration:register.html.twig', array(
'form' => $form->createView(),
));
}
}
I manage to get the user in the PUGX part, but i don't know ow to pass it from the RegistrationManager to my FormType
I tried lots of possibilities, i think i m close but can't find a solution to make it work

JMSPaymentPaypalBundle blank order summary

hi i was wondering on how to show order summary in paypal with JMSPaymentPaypalBundle ?!
ay tips will be greatly appreciated ..
here is my paypalController code in case needed
<?php
namespace Splurgin\EventsBundle\Controller;
use JMS\DiExtraBundle\Annotation as DI;
use JMS\Payment\CoreBundle\Entity\Payment;
use JMS\Payment\CoreBundle\PluginController\Result;
use JMS\Payment\CoreBundle\Plugin\Exception\ActionRequiredException;
use JMS\Payment\CoreBundle\Plugin\Exception\Action\VisitUrl;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\RedirectResponse;
class PaymentController
{
/** #DI\Inject */
private $request;
/** #DI\Inject */
private $router;
/** #DI\Inject("doctrine.orm.entity_manager") */
private $em;
/** #DI\Inject("payment.plugin_controller") */
private $ppc;
/**
* #DI\Inject("service_container")
*
*/
private $container;
/**
* #Template
*/
public function detailsAction($package)
{
// note this ticket at this point in inactive ...
$order = $this->container->get('ticket')->generateTicket($package);
$order = $this->em->getRepository('SplurginEventsBundle:SplurginEventTickets')->find($order);
$packageId = $order->getPackageId();
$package = $this->em->getRepository('SplurginEventsBundle:SplurginEventPackages')->find($package);
$price = $package->getPrice();
var_dump($price);
if($price == null){
throw new \RuntimeException('Package was not found: '.$result->getReasonCode());
}
$form = $this->getFormFactory()->create('jms_choose_payment_method', null, array(
'amount' => $price,
'currency' => 'USD',
'default_method' => 'payment_paypal', // Optional
'predefined_data' => array(
'paypal_express_checkout' => array(
'return_url' => $this->router->generate('payment_complete', array(
'order' => $order->getId(),
), true),
'cancel_url' => $this->router->generate('payment_cancel', array(
'order' => $order->getId(),
), true)
),
),
));
if ('POST' === $this->request->getMethod()) {
$form->bindRequest($this->request);
if ($form->isValid()) {
$this->ppc->createPaymentInstruction($instruction = $form->getData());
$order->setPaymentInstruction($instruction);
$this->em->persist($order);
$this->em->flush($order);
return new RedirectResponse($this->router->generate('payment_complete', array(
'order' => $order->getId(),
)));
}
}
return array(
'form' => $form->createView(),
'order'=>$order->getId(),
);
}
/** #DI\LookupMethod("form.factory") */
protected function getFormFactory() { }
/**
*/
public function completeAction($order)
{
$order = $this->em->getRepository('SplurginEventsBundle:SplurginEventTickets')->find($order);
$instruction = $order->getPaymentInstruction();
if (null === $pendingTransaction = $instruction->getPendingTransaction()) {
$payment = $this->ppc->createPayment($instruction->getId(), $instruction->getAmount() - $instruction->getDepositedAmount());
} else {
$payment = $pendingTransaction->getPayment();
}
$result = $this->ppc->approveAndDeposit($payment->getId(), $payment->getTargetAmount());
if (Result::STATUS_PENDING === $result->getStatus()) {
$ex = $result->getPluginException();
if ($ex instanceof ActionRequiredException) {
$action = $ex->getAction();
if ($action instanceof VisitUrl) {
return new RedirectResponse($action->getUrl());
}
throw $ex;
}
} else if (Result::STATUS_SUCCESS !== $result->getStatus()) {
throw new \RuntimeException('Transaction was not successful: '.$result->getReasonCode());
}
}
public function cancelAction($order)
{
die('cancel the payment');
}
}
i really dont know why this is not a part of the docs , but the bundle is capable of setting checkout parameters out of the box ...
here is how i have done it
$form = $this->getFormFactory()->create('jms_choose_payment_method', null, array(
'amount' => $price,
'currency' => 'USD',
'default_method' => 'payment_paypal', // Optional
'predefined_data' => array(
'paypal_express_checkout' => array(
'return_url' => $this->router->generate('payment_complete', array(
'order' => $order->getId(),
), true),
'cancel_url' => $this->router->generate('payment_cancel', array(
'order' => $order->getId(),
), true),
'checkout_params' => array(
'L_PAYMENTREQUEST_0_NAME0' => 'event',
'L_PAYMENTREQUEST_0_DESC0' => 'some event that the user is trying to buy',
'L_PAYMENTREQUEST_0_AMT0'=> 6.00, // if you get 10413 , then visit the api errors documentation , this number should be the total amount (usually the same as the price )
// 'L_PAYMENTREQUEST_0_ITEMCATEGORY0'=> 'Digital',
),
),
),
));
error code can be found here
SetExpressCheckout Request Fields here
i will provide a pull request to the documentation as soon as i can .. :)

Resources