Example #1
0
 /**
  * @inheritdoc
  */
 public function fillPaymentFormDataset(Dataset $dataset, Transaction $transaction)
 {
     /** @noinspection SpellCheckingInspection */
     $dataset->setParam('SOLOPMT_VERSION', '0003')->setParam('SOLOPMT_STAMP', $transaction->getTransactionId())->setParam('SOLOPMT_RCV_ID', $this->getConfParam('SOLOPMT_RCV_ID'))->setParam('SOLOPMT_LANGUAGE', $this->getConfParam('SOLOPMT_LANGUAGE'))->setParam('SOLOPMT_AMOUNT', $transaction->getSum())->setParam('SOLOPMT_DATE', 'EXPRESS')->setParam('SOLOPMT_RETURN', $this->getReturnUrl())->setParam('SOLOPMT_CANCEL', $this->getReturnUrl())->setParam('SOLOPMT_REJECT', $this->getReturnUrl())->setParam('SOLOPMT_CONFIRM', 'YES')->setParam('SOLOPMT_KEYVERS', $this->getConfParam('SOLOPMT_KEYVERS', '0001'))->setParam('SOLOPMT_CUR', $transaction->getCurrency());
     // add reference if set
     if ($transaction->hasReference()) {
         $dataset->setParam('SOLOPMT_REF', $transaction->getReference());
     } elseif (false !== $this->getConfParam('SOLOPMT_REF', false)) {
         $dataset->setParam('SOLOPMT_REF', $this->getConfParam('SOLOPMT_REF'));
     }
     // add comment if set
     if ($transaction->hasComment()) {
         $dataset->setParam('SOLOPMT_MSG', $transaction->getComment());
     } elseif (false !== $this->getConfParam('SOLOPMT_MSG', false)) {
         $dataset->setParam('SOLOPMT_MSG', $this->getConfParam('SOLOPMT_MSG'));
     }
     // add language if set
     if ($transaction->getLanguage() !== $this->getConfParam('SOLOPMT_LANGUAGE')) {
         $dataset->setParam('SOLOPMT_LANGUAGE', $this->getLanguageCode($transaction->getLanguage()));
     }
     $this->formatParams($dataset);
     $mac = $this->generateMacKey($dataset, 'payment');
     $dataset->setParam('SOLOPMT_MAC', $mac);
     return $dataset;
 }
Example #2
0
 /**
  * @inheritdoc
  */
 public function fillPaymentFormDataset(Dataset $dataset, Transaction $transaction)
 {
     $this->addCommonParams($dataset);
     // add params from transaction
     $dataset->setParam('VK_STAMP', $transaction->getTransactionId())->setParam('VK_AMOUNT', $transaction->getSum())->setParam('VK_CURR', $transaction->getCurrency())->setParam('VK_LANG', $this->getLanguageCode($transaction->getLanguage()));
     // add reference if set
     if ($transaction->hasReference()) {
         $dataset->setParam('VK_REF', $transaction->getReference());
     } else {
         if (false !== $this->getConfParam('VK_REF', false)) {
             $dataset->setParam('VK_REF', $this->getConfParam('VK_REF'));
         } else {
             $dataset->setParam('VK_REF', null);
         }
     }
     // add comment if set
     if ($transaction->hasComment()) {
         $dataset->setParam('VK_MSG', $transaction->getComment());
     } else {
         if (false !== $this->getConfParam('VK_MSG', false)) {
             $dataset->setParam('VK_MSG', $this->getConfParam('VK_MSG'));
         }
     }
     $this->formatParams($dataset);
     $this->addMacSignature($dataset);
 }