Skip to content

Commit

Permalink
Merge pull request #81 from PaymentSuite/hotfix/paypal-web-checkout-sf4
Browse files Browse the repository at this point in the history
Make controllers public and replace string by type namespace in form …
  • Loading branch information
juanjomb authored Jul 6, 2020
2 parents 8413357 + 617466d commit 95fb76d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ services:
#
paymentsuite.paypal_web_checkout.payment_controller:
class: PaymentSuite\PaypalWebCheckoutBundle\Controller\PaymentController
public: true
arguments:
- '@paymentsuite.paypal_web_checkout.manager'
- '@templating'

paymentsuite.paypal_web_checkout.process_controller:
class: PaymentSuite\PaypalWebCheckoutBundle\Controller\ProcessController
public: true
arguments:
- '@paymentsuite.paypal_web_checkout.manager'
- '@paymentsuite.logger'
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
namespace PaymentSuite\PaypalWebCheckoutBundle\Services;

use PaymentSuite\PaypalWebCheckoutBundle\Services\Interfaces\PaypalWebCheckoutSettingsProviderInterface;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\FormFactory;
use Symfony\Component\Form\FormView;
use PaymentSuite\PaymentCoreBundle\Services\interfaces\PaymentBridgeInterface;
Expand Down Expand Up @@ -130,22 +131,22 @@ public function buildForm()
$formBuilder
->setAction($this->urlFactory->getApiEndpoint())
->setMethod('POST')
->add('business', 'hidden', [
->add('business', HiddenType::class, [
'data' => $this->settingsProvider->getBusiness(),
])
->add('return', 'hidden', [
->add('return', HiddenType::class, [
'data' => $successReturnUrl,
])
->add('cancel_return', 'hidden', [
->add('cancel_return', HiddenType::class, [
'data' => $cancelReturnUrl,
])
->add('notify_url', 'hidden', [
->add('notify_url', HiddenType::class, [
'data' => $processUrl,
])
->add('currency_code', 'hidden', [
->add('currency_code', HiddenType::class, [
'data' => $orderCurrency,
])
->add('env', 'hidden', [
->add('env', HiddenType::class, [
'data' => '',
]);

Expand All @@ -170,20 +171,20 @@ public function buildForm()

foreach ($itemsData as $orderLine) {
$formBuilder
->add('item_name_'.$iteration, 'hidden', [
->add('item_name_'.$iteration, HiddenType::class, [
'data' => $orderLine['item_name'],
])
->add('amount_'.$iteration, 'hidden', [
->add('amount_'.$iteration, HiddenType::class, [
'data' => $orderLine['amount'],
])
->add('quantity_'.$iteration, 'hidden', [
->add('quantity_'.$iteration, HiddenType::class, [
'data' => $orderLine['quantity'],
]);
++$iteration;
}

if (isset($cartData['discount_amount_cart'])) {
$formBuilder->add('discount_amount_cart', 'hidden', [
$formBuilder->add('discount_amount_cart', HiddenType::class, [
'data' => $cartData['discount_amount_cart'],
]);
}
Expand Down

0 comments on commit 95fb76d

Please sign in to comment.