コード例 #1
0
ファイル: Soap.php プロジェクト: sonassi/mage-cybersource
 /**
  * Assigning credit card information
  *
  * @param Mage_Model_Order_Payment $payment
  */
 protected function addCcInfo($payment)
 {
     $info = $this->getInfoInstance();
     $ccNumber = preg_replace('/[\\-\\s]+/', '', $payment->getCcNumber());
     $info->setCcNumber($ccNumber);
     $card = new stdClass();
     $card->fullName = $payment->getCcOwner();
     $card->expirationMonth = $payment->getCcExpMonth();
     $card->expirationYear = $payment->getCcExpYear();
     $card->accountNumber = $payment->getCcNumber();
     if ($payment->hasCcCid()) {
         $card->cvNumber = $payment->getCcCid();
     }
     if ($payment->getCcType() == self::CC_CARDTYPE_SS && $payment->hasCcSsIssue()) {
         $card->issueNumber = $payment->getCcSsIssue();
     }
     if ($payment->getCcType() == self::CC_CARDTYPE_SS && $payment->hasCcSsStartYear()) {
         $card->startMonth = $payment->getCcSsStartMonth();
         $card->startYear = $payment->getCcSsStartYear();
     }
     //Translate cartype to cybersource card type value
     if (array_key_exists($payment->getCcType(), $this->_ccCybersourceCcTypes)) {
         $card->cardType = $this->_ccCybersourceCcTypes[$payment->getCcType()];
         $this->_payer_enroll_check_available = true;
     } else {
         $this->_payer_enroll_check_available = false;
     }
     $this->_request->card = $card;
 }
コード例 #2
0
ファイル: Soap.php プロジェクト: ronseigel/agent-ohm
 /**
  * Assigning credit card information
  *
  * @param Mage_Model_Order_Payment $payment
  */
 protected function addCcInfo($payment)
 {
     $card = new stdClass();
     $card->fullName = $payment->getCcOwner();
     $card->accountNumber = $payment->getCcNumber();
     $card->expirationMonth = $payment->getCcExpMonth();
     $card->expirationYear = $payment->getCcExpYear();
     if ($payment->hasCcCid()) {
         $card->cvNumber = $payment->getCcCid();
     }
     if ($payment->getCcType() == self::CC_CARDTYPE_SS && $payment->hasCcSsIssue()) {
         $card->issueNumber = $payment->getCcSsIssue();
     }
     if ($payment->getCcType() == self::CC_CARDTYPE_SS && $payment->hasCcSsStartYear()) {
         $card->startMonth = $payment->getCcSsStartMonth();
         $card->startYear = $payment->getCcSsStartYear();
     }
     $this->_request->card = $card;
 }