Skip to content

Commit

Permalink
Add more explanative comments in partial refund response
Browse files Browse the repository at this point in the history
  • Loading branch information
siewmai committed Feb 4, 2018
1 parent 64cc4e2 commit 73d9683
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Message/PartialRefundResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@ class PartialRefundResponse extends AbstractResponse
*/
public function getMessage()
{
// Handle MOLPay returned error
if (array_key_exists('error_desc', $this->data)) {
return $this->data['error_desc'];
} else if (array_key_exists('reason', $this->data)) {
}
// Handle MOLPay return success with status 'Rejected'
else if (array_key_exists('reason', $this->data)) {
return $this->data['reason'];
} else {
}
// Handle MOLPay returned unknown exceptions that not specified in spec
else {
return 'Unknown error';
}
}
Expand All @@ -50,6 +55,7 @@ public function isSuccessful()
return false;
}

// API returned 'success', not actual '00' at this development time
return ($this->data['Status'] === '00' || strtolower($this->data['Status']) === 'success');
}

Expand Down

0 comments on commit 73d9683

Please sign in to comment.