Esempio n. 1
0
 /**
  * @param array $parameters
  * @return DirectoryRequestResult
  * @throws Exception
  */
 public function execute(array $parameters = array())
 {
     return new DirectoryRequestResult($this->getClient(), parent::execute());
 }
Esempio n. 2
0
 /**
  * @param array $parameters
  * @return TransactionRequestResult
  * @throws Exception
  */
 public function execute(array $parameters = array())
 {
     $client = $this->getClient();
     $payment = $this->getPayment();
     $parameters = array('merchantid' => $client->getMerchantId(), 'payment' => $payment::PAYMENT_IDENTIFIER, 'purchaseid' => $payment->getPurchaseId(), 'amount' => $payment->getAmount(), 'currency' => $payment->getCurrency(), 'entrancecode' => $payment->getEntranceCode(), 'description' => $payment->getDescription(), 'ipaddress' => $client->getIpAddress(), 'returnurl' => $payment->getReturnUrl(), 'cancelurl' => $payment->getCancelUrl(), 'callbackurl' => $payment->getCallbackUrl(), 'notifyurl' => $payment->getNotifyUrl(), 'sha1' => $this->getHash());
     if (method_exists($payment, 'getParameters')) {
         $parameters = array_merge($parameters, $payment->getParameters());
     }
     if ($esend = $this->getEsend()) {
         $esendParameters = array('shipping_lastname' => $esend->getLastname(), 'shipping_address1' => strstr($esend->getAddress(), "\n", true), 'shipping_zip' => $esend->getZipcode(), 'shipping_city' => $esend->getCity(), 'shipping_country' => $esend->getCountry(), 'shipping_countrycode' => $esend->getCountryCode());
         if ($firstname = $esend->getFirstname()) {
             $esendParameters['shipping_firstname'] = $firstname;
         }
         if ($email = $esend->getEmail()) {
             $esendParameters['shipping_mail'] = $email;
         }
         if ($company = $esend->getCompany()) {
             $esendParameters['shipping_company'] = $company;
         }
         if ($address2 = strstr("\n", $esend->getAddress())) {
             $esendParameters['shipping_address2'] = $address2;
         }
         if ($phone = $esend->getPhone()) {
             $esendParameters['shipping_phone'] = $phone;
         }
         if ($weight = $esend->getWeight()) {
             $esendParameters['weight'] = $weight;
         }
         if ($shippingCosts = $esend->getShippingCosts()) {
             $esendParameters['shipping'] = $shippingCosts;
         }
         if ($handleCosts = $esend->getHandleCosts()) {
             $esendParameters['handling'] = $handleCosts;
         }
         $parameters = array_merge($parameters, $esendParameters);
     }
     return new TransactionRequestResult($client, $payment, parent::execute($parameters));
 }
Esempio n. 3
0
 /**
  * @param array $parameters
  * @return StatusRequestResult
  * @throws Exception
  */
 public function execute(array $parameters = array())
 {
     $client = $this->getClient();
     $parameters = array('merchantid' => $client->getMerchantId(), 'trxid' => $this->transactionId, 'sha1' => $this->getHash());
     return new StatusRequestResult($client, parent::execute($parameters));
 }