芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/www/status.pulsehost.co.uk/vendor/openpayu/openpayu/lib/OpenPayU/v2/Refund.php
$orderId, 'refund' => array('description' => $description) ); if (!empty($amount)) { $refund['refund']['amount'] = $amount; } if (!empty($extCustomerId)) { $refund['refund']['extCustomerId'] = $extCustomerId; } if (!empty($extRefundId)) { $refund['refund']['extRefundId'] = $extRefundId; } try { $authType = self::getAuth(); } catch (OpenPayU_Exception $e) { throw new OpenPayU_Exception($e->getMessage(), $e->getCode()); } $pathUrl = OpenPayU_Configuration::getServiceUrl().'orders/'. $refund['orderId'] . '/refund'; $data = OpenPayU_Util::buildJsonFromArray($refund); $result = self::verifyResponse(OpenPayU_Http::doPost($pathUrl, $data, $authType), 'RefundCreateResponse'); return $result; } /** * @param string $response * @param string $messageName * @return OpenPayU_Result */ public static function verifyResponse($response, $messageName='') { $data = array(); $httpStatus = $response['code']; $message = OpenPayU_Util::convertJsonToArray($response['response'], true); $data['status'] = isset($message['status']['statusCode']) ? $message['status']['statusCode'] : null; if (json_last_error() == JSON_ERROR_SYNTAX) { $data['response'] = $response['response']; } elseif (isset($message[$messageName])) { unset($message[$messageName]['Status']); $data['response'] = $message[$messageName]; } elseif (isset($message)) { $data['response'] = $message; unset($message['status']); } $result = self::build($data); if ($httpStatus == 200 || $httpStatus == 201 || $httpStatus == 422 || $httpStatus == 302) { return $result; } else { OpenPayU_Http::throwHttpStatusException($httpStatus, $result); } } }