コード例 #1
0
ファイル: Checkout.php プロジェクト: srph/dragonpay-sdk-php
 /**
  * Get the generated URL to the Dragonpay Payment Switch API.
  *
  * @param array $params
  * @param null|string $filter
  * @return string
  * @TODO Clean up logging
  */
 public function getUrl(array $params, $filter = null)
 {
     $params['merchantId'] = $this->client->getMerchantId();
     $params['password'] = $this->client->getMerchantPassword();
     // Log generation of URL
     $logMessage = "[dragonpay-sdk][url-generation] Generating URL to Dragonpay Payment Switch.";
     $this->log($logMessage);
     $url = $this->urlGenerator->generate($params, $this->client->isTesting());
     // Log successful generation of URL
     $logMessage = "[dragonpay-sdk][url-generation] Successfully generated URL to Dragonpay Payment Switch. URL: \"{$url}\"";
     $this->log($logMessage);
     if ($filter !== null) {
         $url = $this->addFilter($url, $filter);
     }
     return $url;
 }
コード例 #2
0
 /**
  * Set the merchant credentials.
  */
 private function setMerchantCredentials()
 {
     $this->credentials['merchantId'] = $this->client->getMerchantId();
     $this->credentials['merchantPassword'] = $this->client->getMerchantPassword();
 }