Ejemplo n.º 1
0
 public function __construct(Router $paylineRouter, Router $frontRouter)
 {
     require_once __DIR__ . '/../SDK/paylineSDK.php';
     $this->paylineRouter = $paylineRouter;
     $this->frontRouter = $frontRouter;
     $this->config = new PaylineConfig();
     $this->payline = new paylineSDK($this->config->getMerchantId(), $this->config->getMerchantAccesskey(), '', '', '', '', $this->config->getEnv());
     $this->logger = (new PaylineLogger())->getLogger();
 }
Ejemplo n.º 2
0
 /**
  *
  * in this function you add all the fields you need for your Form.
  * Form this you have to call add method on $this->formBuilder attribute :
  */
 protected function buildForm()
 {
     $paylineConfig = new PaylineConfig();
     $this->formBuilder->add('merchantId', 'text', ['constraints' => [new NotBlank()], 'label' => $this->trans('Merchant id :'), 'data' => $paylineConfig->getMerchantId()])->add('merchantAccesskey', 'text', ['constraints' => [new NotBlank()], 'label' => $this->trans('Merchant access key :'), 'data' => $paylineConfig->getMerchantAccesskey()])->add('contractNumber', 'text', ['constraints' => [new NotBlank()], 'label' => $this->trans('Contract number :'), 'data' => $paylineConfig->getContractNumber()])->add('env', 'choice', ['constraints' => [new NotBlank()], 'label' => $this->trans('Environment :'), 'choices' => [PaylineConfig::ENV_DEV => $this->trans('Development'), PaylineConfig::ENV_HOMO => $this->trans('Approval'), PaylineConfig::ENV_PROD => $this->trans('Production')], 'expanded' => false, 'multiple' => false, 'data' => $paylineConfig->getEnv()])->add('minimumAmount', 'money', ['constraints' => [new NotBlank(), new GreaterThanOrEqual(['value' => 0])], 'label' => $this->trans('Minimum order total'), 'data' => $paylineConfig->getMinimumAmount(), 'label_attr' => ['for' => 'minimum_amount', 'help' => $this->trans('Minimum order total in the default currency for which this payment method is available. Enter 0 for no minimum')]])->add('maximumAmount', 'money', ['constraints' => [new NotBlank(), new GreaterThanOrEqual(['value' => 0])], 'label' => $this->trans('Maximum order total'), 'data' => $paylineConfig->getMaximumAmount(), 'label_attr' => ['for' => 'maximum_amount', 'help' => $this->trans('Maximum order total in the default currency for which this payment method is available. Enter 0 for no maximum')]]);
 }