Return_URL JMSPaymentsCoreBundle Symfony 2 Paypal

У меня есть несколько вопросов о системе Paypal JMSPaymentCoreBundle Symfony 2.

  1. Где в задней части тестового счета PayPal я могу найти проверенные тестовые платежи?

  2. Как настроить return_url для перенаправления на путь app_orders_paymentcomplete? В классе OrdersController у меня есть, если

if ($result->getStatus() === Result::STATUS_SUCCESS) {
            return $this->redirect($this->generateUrl('app_orders_paymentcomplete', [
                                'id' => $order->getId(),
            ]));
        }

Но приложение до него не доходит. В настоящее время я настроил два параметра return_url и cancel_url в app / config.yml. Paypal перенаправляет на return_url из app / config.yml

  1. Какая таблица в базе данных отвечает за платеж, это таблица платежей?

OrdersController

/**
     * @Route("/{id}/payment/create",
     * name="app_orders_paymentcreate"
     * )
     * 
     */
    public function paymentCreateAction(Order $order) {
        $payment = $this->createPayment($order);

        $ppc = $this->get('payment.plugin_controller');
        $result = $ppc->approveAndDeposit($payment->getId(), $payment->getTargetAmount());

        if ($result->getStatus() === Result::STATUS_PENDING) {
            $ex = $result->getPluginException();

            if ($ex instanceof ActionRequiredException) {
                $action = $ex->getAction();

                if ($action instanceof VisitUrl) {
                    return $this->redirect($action->getUrl());
                }
            }
        } else if (Result::STATUS_SUCCESS !== $result->getStatus()) {
            throw new \RuntimeException('Transaction was not successful: ' . $result->getReasonCode());
        }

        if ($result->getStatus() === Result::STATUS_SUCCESS) {
            return $this->redirect($this->generateUrl('app_orders_paymentcomplete', [
                                'id' => $order->getId(),
            ]));
        }

        throw $result->getPluginException();






        // In a real-world application you wouldn't throw the exception. You would,
        // for example, redirect to the showAction with a flash message informing
        // the user that the payment was not successful.
    }

    /**
     * @Route("/{id}/payment/complete",
     * name="app_orders_paymentcomplete"
     * )
     * 
     */
    public function paymentCompleteAction(Order $order) {
        return new Response('Payment complete');
    }

0 ответов

Другие вопросы по тегам