Skip to content

Commit

Permalink
use ensure sensitive value method.
Browse files Browse the repository at this point in the history
  • Loading branch information
makasim committed Mar 3, 2016
1 parent 1a1acfc commit 0e6d9a2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Action/CaptureAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function execute($request)
if ($card->getToken()) {
$details['cardReference'] = $card->getToken();
} else {
$details['card'] = new SensitiveValue(array(
$details['card'] = SensitiveValue::ensureSensitive(array(
'number' => $card->getNumber(),
'cvv' => $card->getSecurityCode(),
'expiryMonth' => $card->getExpireAt()->format('m'),
Expand Down
2 changes: 1 addition & 1 deletion src/Action/ConvertPaymentAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function execute($request)
if ($payment->getCreditCard()) {
$card = $payment->getCreditCard();

$details['card'] = new SensitiveValue(array(
$details['card'] = SensitiveValue::ensureSensitive(array(
'number' => $card->getNumber(),
'cvv' => $card->getSecurityCode(),
'expiryMonth' => $card->getExpireAt()->format('m'),
Expand Down
3 changes: 2 additions & 1 deletion tests/Action/ConvertPaymentActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use Payum\Core\Model\CreditCard;
use Payum\Core\Request\GetCurrency;
use Payum\Core\Security\SensitiveValue;
use Payum\OmnipayBridge\Action\ConvertPaymentAction;
use Payum\Core\Model\Payment;
use Payum\Core\Request\Convert;
Expand Down Expand Up @@ -122,7 +123,7 @@ public function shouldCorrectlyConvertPaymentWithCreditCardToDetailsArray()
$this->assertNotEmpty($details);

$this->assertArrayHasKey('card', $details);
$this->assertInstanceOf('Payum\Core\Security\SensitiveValue', $details['card']);
$this->assertInstanceOf(SensitiveValue::class, $details['card']);
$this->assertEquals(array(
'number' => '4444333322221111',
'cvv' => '322',
Expand Down

0 comments on commit 0e6d9a2

Please sign in to comment.