コード例 #1
0
 public function getData()
 {
     $this->validate('transactionReference');
     $data = parent::getData();
     $data['trans_id'] = $this->getTransactionReference();
     $data['reason'] = $this->getDescription();
     $data['action'] = 'credit';
     return $data;
 }
コード例 #2
0
 public function getData()
 {
     $this->validate('transactionReference');
     $data = parent::getData();
     $data['trans_id'] = $this->getTransactionReference();
     $data['reason'] = $this->getDescription();
     if ($this->getAmount()) {
         $data['action'] = 'partial.credit';
         $data['amount'] = $this->getAmount();
     } else {
         $data['action'] = 'credit';
     }
     return $data;
 }
コード例 #3
0
 /**
  * getData
  *
  * @return array
  * @throws \Omnipay\Common\Exception\InvalidCreditCardException
  * @throws \Omnipay\Common\Exception\InvalidRequestException
  */
 public function getData()
 {
     // An amount parameter is required, as is a currency.
     $this->validate('amount', 'currency', 'description');
     $data = parent::getData();
     // Some predefined variables that need to be set
     $data['next_phase'] = 'paydata';
     $data['agree2terms'] = '1';
     // Send through the charge amount and description, we will always set
     // the qty to 1
     $data['item1_desc'] = $this->getDescription();
     $data['item1_price'] = $this->getAmount();
     $data['item1_qty'] = 1;
     // $data['rebill_amount']      = $this->getAmount();
     $data['valuta_code'] = $this->getCurrency();
     $data['user1'] = $this->getUser1();
     $data['user2'] = $this->getUser2();
     $data['dyn_desc'] = $this->getDynDesc();
     // MultiCards supports card or token payments
     if ($this->getCardReference()) {
         $data['token_id'] = $this->getCardReference();
     } else {
         $this->validate('card');
         $card = $this->getCard();
         // Test Payments in particular use a card number that does not
         // validate against the Luhn algorithm, so don't validate the card.
         // $card->validate();
         /// Card data passed through
         $data['cust_name'] = $card->getName();
         $data['cust_address1'] = $this->stripForbiddenAddressCharacters($card->getBillingAddress1());
         $data['cust_city'] = $card->getBillingCity();
         $data['cust_state'] = $card->getBillingState();
         $data['cust_zip'] = $card->getBillingPostcode();
         $data['cust_phone'] = $card->getBillingPhone();
         $data['cust_email'] = $card->getEmail();
         $data['cust_country'] = $card->getBillingCountry();
         $data['card_num'] = $card->getNumber();
         $data['card_name'] = $card->getName();
         $data['card_exp'] = $card->getExpiryDate('m/y');
         $data['card_code'] = $card->getCvv();
         // This requests a token_id to be returned with the response so that
         // the card reference can be used next time.
         $data['req_trans_token'] = '1';
     }
     return $data;
 }