/** * * @param Merchant_Billing_CreditCard $creditcard */ private function add_creditcard(Merchant_Billing_CreditCard $creditcard) { $this->post['CardName'] = $creditcard->name(); $this->post['CardNumber'] = $creditcard->number; $this->post['ExpiryDateMM'] = $this->cc_format($creditcard->month, 'two_digits'); $this->post['ExpiryDateYY'] = $this->cc_format($creditcard->year, 'two_digits'); if ($this->requires_start_date_or_issue_number($creditcard)) { $this->post['StartDateMM'] = $this->cc_format($creditcard->start_month, "two_digits"); $this->post['StartDateYY'] = $this->cc_format($creditcard->start_year, "two_digits"); $this->post['IssueNumber'] = $creditcard->issue_number; $this->post['CV2'] = $creditcard->verification_value; } }
/** * * @param Merchant_Billing_CreditCard $creditcard */ private function add_creditcard(Merchant_Billing_CreditCard $creditcard) { $cardholdername = strtoupper($creditcard->name()); $this->post .= <<<XML <ns:CardInfo> <ns:CardType>{$this->CARD_MAPPINGS[$creditcard->type]}</ns:CardType> <ns:CardNumber>{$creditcard->number}</ns:CardNumber> <ns:CardHolderName>{$cardholdername}</ns:CardHolderName> <ns:ExpirationMonth>{$creditcard->month}</ns:ExpirationMonth> <ns:ExpirationYear>{$creditcard->year}</ns:ExpirationYear> <ns:Cvv2>{$creditcard->verification_value}</ns:Cvv2> <ns:Aid/> <ns:Emv/> <ns:PinBlock/> </ns:CardInfo> XML; }