示例#1
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);
 }
示例#2
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;
 }
示例#3
0
 /**
  * @inheritdoc
  */
 public function fillPaymentFormDataset(Dataset $dataset, Transaction $transaction)
 {
     // add some common fields
     $dataset->setParam('action', 'gaf')->setParam('ver', 4)->setParam('datetime', date("YmdHis"));
     // convert amount into cents
     $amount = (int) ($transaction->getSum() * 100);
     // add transaction information
     /** @noinspection SpellCheckingInspection */
     $dataset->setParam('id', $this->getConfParam('id'))->setParam('ecuno', $transaction->getTransactionId())->setParam('eamount', $amount)->setParam('cur', $transaction->getCurrency())->setParam('lang', $this->getLanguageCode($transaction->getLanguage()))->setParam('charEncoding', $this->getConfParam('charEncoding', 'UTF-8'))->setParam('feedBackUrl', $this->getReturnUrl())->setParam('delivery', $this->getConfParam('delivery', 'S'));
     if (intval($ecuno = $dataset->getParam('ecuno', 0)) < 100000) {
         $dataset->setParam('ecuno', $ecuno + 100000000);
         // add 100 000 000
     }
     $this->addMacSignature($dataset);
 }