예제 #1
0
 public function __construct(Session $session, Router $router, $environement, $merchant_pos_id, $pos_auth_key, $client_id, $client_secret, $signature_key)
 {
     $this->session = $session;
     $this->session->start();
     $this->environment = $environement;
     $this->merchantPosId = $merchant_pos_id;
     $this->posAuthKey = $pos_auth_key;
     $this->clientId = $client_id;
     $this->clientSecret = $client_secret;
     $this->signatureKey = $signature_key;
     $this->currencyCode = 'PLN';
     // TODO: from configuration
     $this->orderType = self::ORDER_TYPE_VIRTUAL;
     \OpenPayU_Configuration::setEnvironment($this->environment);
     \OpenPayU_Configuration::setMerchantPosId($this->merchantPosId);
     \OpenPayU_Configuration::setPosAuthKey($this->posAuthKey);
     \OpenPayU_Configuration::setClientId($this->clientId);
     \OpenPayU_Configuration::setClientSecret($this->clientSecret);
     \OpenPayU_Configuration::setSignatureKey($this->signatureKey);
     $this->authUrl = \OpenPayU_Configuration::$authUrl;
     $this->summaryUrl = \OpenPayU_Configuration::$summaryUrl;
     $this->notifyUrl = $router->generate('webultdPayuPaymentBundle_status', array(), true);
     $this->cancelUrl = $router->generate('webultdPayuPaymentBundle_cancel', array(), true);
     $this->completeUrl = $router->generate('webultdPayuPaymentBundle_success', array(), true);
 }
 public function testPosAuthKey()
 {
     OpenPayU_Configuration::setPosAuthKey('PosAuthKey');
     $this->assertEquals('PosAuthKey', OpenPayU_Configuration::getPosAuthKey());
 }