Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

Commit

Permalink
Also added an test for non existing response code.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Jun 27, 2014
1 parent 78cb765 commit e60334e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ResponseCodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ class Pronamic_WP_Pay_OmniKassa_ResponseCodes {
* @param string $response_code
*/
public static function transform( $response_code ) {
$status = null;

switch ( $response_code ) {
case self::TRANSACTION_SUCCES:
return Pronamic_WP_Pay_Statuses::SUCCESS;
Expand All @@ -165,5 +167,7 @@ public static function transform( $response_code ) {
case self::REQUEST_TIMEOUT:
return Pronamic_WP_Pay_Statuses::EXPIRED;
}

return $status;
}
}
1 change: 1 addition & 0 deletions tests/ResponseCodesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function statusMatrixProvider() {
array( Pronamic_WP_Pay_OmniKassa_ResponseCodes::CANCELLATION_OF_PAYMENT, Pronamic_WP_Pay_Statuses::CANCELLED ),
array( Pronamic_WP_Pay_OmniKassa_ResponseCodes::PENDING_TRANSACTION, Pronamic_WP_Pay_Statuses::OPEN ),
array( Pronamic_WP_Pay_OmniKassa_ResponseCodes::REQUEST_TIMEOUT, Pronamic_WP_Pay_Statuses::EXPIRED ),
array( 'not existing response code', null ),
);
}
}

0 comments on commit e60334e

Please sign in to comment.