Created
January 6, 2019 22:17
-
-
Save ProdigyView/e9a7e252edf9a32ca18bda8cd32d7b77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (isset($data['token']) && AuthBearer::hasAccess($data['token'], $type)) { | |
if($type == 'charge' && checkNounce($data['nounce'], $nounces)) { | |
$id = charge($data['amount'], $data['nounce'], array('product' => 'Shoes'), $charges); | |
$response = array('status' => 'success', 'message' => $id); | |
}else if($type == 'charge') { | |
$response = array('status' => 'error', 'message' => 'Invalid Nounce'); | |
} else if($type == 'refund' && refund($data['id'], $charges)) { | |
$response = array('status' => 'success', 'message' => 'Refund Successful'); | |
} else if($type == 'refund') { | |
$response = array('status' => 'error', 'message' => 'Unable To Peform Refund'); | |
} | |
} else{ | |
$response = array('status' => 'error', 'message' => 'Invalid Token On Purchase'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment