Skip to content

Commit

Permalink
2.5/cart-expirydate-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
fatihtoprak committed Dec 23, 2021
1 parent 8372dde commit 557a6f4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
23 changes: 20 additions & 3 deletions core/library/Moka_Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,7 @@ public function process_payment( $orderId )
)
);
}



$payOrder = $this->optimisthubMoka->initializePayment($orderDetails);
$callbackUrl = data_get($payOrder, 'Data.Url');
$callbackHash = data_get($payOrder, 'Data.CodeForHash');
Expand Down Expand Up @@ -557,7 +556,7 @@ private function formatOrder( $orderId )
'CardHolderFullName' => (string) data_get($postData, $this->id.'-name-oncard'),
'CardNumber' => (string) self::formatCartNumber(data_get($postData, $this->id.'-card-number')),
'ExpMonth' => (string) data_get($expriyDate,'month' ),
'ExpYear' => (string) '20'.data_get($expriyDate,'year' ),
'ExpYear' => (string) self::formatExpiryDate(data_get($expriyDate,'year' )),
'CvcNumber' => (string) data_get($postData, $this->id.'-card-cvc'),
'Amount' => (string) self::calculateComissionRate(data_get($postData, $this->id.'-order-total'),$currentComission),
'Currency' => (string) $order->get_currency() == 'TRY' ? 'TL' : $order->get_currency() ,
Expand Down Expand Up @@ -888,6 +887,24 @@ private function formatBaksetProducts( $order )

return $output;
}

/**
* Format Card expriyDate
*
* @param [type] $str
* @return void
*/
private function formatExpiryDate($str)
{
$output = $str;
$lenght = strlen($str);
if($lenght>=3)
{
$output = substr($str,-2);
}

return '20'.$output;
}

}
}
3 changes: 3 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ Moka Pos, Moka Pay plugin;

### Changelog

#### Version 2.5
- Issue : Card Expiry Date validation issue fixed.

#### Version 2.4
- Feature : Added Order Prefix for multiple domain usage.

Expand Down

0 comments on commit 557a6f4

Please sign in to comment.