コード例 #1
0
 /**
  * @param Payment $payment
  * @return Payment
  */
 public function signPayment(Payment $payment)
 {
     $payment->setSkinCode($this->context->getSkinCode());
     $payment->setMerchantAccount($this->context->getMerchantAccount());
     if ($this->context->isGaTrackingEnabled()) {
         $payment = GaTracking::addTrackingParameters($payment);
     }
     // sign shopper if is not null
     $shopper = $payment->getShopper();
     if ($shopper) {
         $signedShopper = $this->signShopper($shopper);
         $payment->setShopper($signedShopper);
     }
     // sign delivery address if is not null
     $deliveryAddress = $payment->getDeliveryAddress();
     if ($deliveryAddress) {
         $deliveryAddress = $this->signAddress($deliveryAddress);
         $payment->setDeliveryAddress($deliveryAddress);
     }
     // sign billing address if is not null
     $billingAddress = $payment->getBillingAddress();
     if ($billingAddress) {
         $billingAddress = $this->signAddress($billingAddress);
         $payment->setBillingAddress($billingAddress);
     }
     $signature = $this->context->getSignaturesGenerator()->generatePaymentSignature($payment);
     $payment->sign($signature);
     return $payment;
 }
コード例 #2
0
ファイル: GaTracking.php プロジェクト: metisfw/adyen
 /**
  * @param Payment $payment
  * @return Payment
  */
 public static function addTrackingParameters(Payment $payment)
 {
     $resURL = $payment->getResURL();
     $url = new Url($resURL);
     $url->setQueryParameter('utm_nooverride', 1);
     $payment->setResURL($url->getAbsoluteUrl());
     return $payment;
 }
コード例 #3
0
 /**
  * Set specific payment properties
  *
  * @param Payment $payment
  * @return void
  */
 public function initializePayment(Payment $payment)
 {
     $payment->setMerchantReference('12345678');
     $payment->setPaymentAmount(10000);
     $today = new DateTime();
     $shipDate = $today->modifyClone('+ 10 days');
     $payment->setShipBeforeDate($shipDate);
     $sessionValidity = $today->modifyClone('+ 30 minutes');
     $payment->setSessionValidity($sessionValidity);
 }
コード例 #4
0
 /**
  * Set specific payment properties
  *
  * @param Payment $payment
  * @return void
  */
 function initializePayment(Payment $payment)
 {
     $payment->setMerchantReference($this->merchantReference);
     $payment->setCurrencyCode($this->currencyCode);
     $payment->setPaymentAmount($this->paymentAmount);
     $payment->setSessionValidity($this->sessionValidity);
     $payment->setShipBeforeDate($this->shipBeforeDate);
 }
コード例 #5
0
ファイル: SignaturesGenerator.php プロジェクト: metisfw/adyen
 /**
  * @param Payment $payment
  *
  * @return string
  */
 public function generatePaymentSignature(Payment $payment)
 {
     $values = $payment->getSignatureValues();
     $values = $this->filterValues($values);
     return $this->generateSignature($values);
 }
コード例 #6
0
ファイル: PaymentControl.php プロジェクト: metisfw/adyen
 private function setReturnUrl(Payment $payment)
 {
     $payment->setResURL($this->link('//return!'));
 }