getExpiryDate() public méthode

Get the card expiry date, using the specified date format string.
public getExpiryDate ( string $format ) : string
$format string
Résultat string
Exemple #1
0
 public static function cardToApiParameters(\Omnipay\Common\CreditCard $card)
 {
     $data = array();
     $data['econCardno'] = $card->getNumber();
     $data['cardExpdate'] = $card->getExpiryDate('Ym');
     $data['CVV2'] = $card->getCvv();
     $data['kanjiName1_1'] = $card->getLastName();
     $data['kanjiName1_2'] = $card->getFirstName();
     return $data;
 }
 public function testStoreCard()
 {
     $card = new CreditCard($this->getValidCard());
     $card->setStartMonth(1);
     $card->setStartYear(2000);
     $this->request = new CreateCardRequest($this->getHttpClient(), $this->getHttpRequest());
     $this->request->initialize(array('card' => $card));
     $data = $this->request->getData();
     $this->assertSame($card->getNumber(), $data['card_number']);
     $this->assertSame($card->getExpiryDate('m/Y'), $data['card_expiry']);
     $this->assertSame($card->getCvv(), $data['cvv']);
     $this->request = new PurchaseRequest($this->getHttpClient(), $this->getHttpRequest());
     $this->request->initialize(array('amount' => '10.00', 'transactionReference' => 'TestReference999', 'cardReference' => 'abc1234'));
     $this->request->setTransactionId('525-P-S2Y05UQ9');
     $this->request->setClientIp('127.0.0.1');
     $data = $this->request->getData();
     $this->assertSame('10.00', $data['amount']);
     $this->assertSame('abc1234', $data['card_token']);
 }
Exemple #3
0
 public function testExpiryDate()
 {
     $this->assertSame($this->card, $this->card->setExpiryMonth('09'));
     $this->assertSame($this->card, $this->card->setExpiryYear('2012'));
     $this->assertSame('092012', $this->card->getExpiryDate('mY'));
 }