public static function main() { $transactionCode = "E505C18007B9440D904604D3AE41999A"; $refundAmount = "1000.00"; //optional try { /** * @todo * #### Credentials ##### * Replace the parameters below with your credentials * You can also get your credentials from a config file. See an example: * $credentials = PagSeguroConfig::getAccountCredentials(); */ // seller authentication $credentials = new PagSeguroAccountCredentials("*****@*****.**", "E231B2C9BCC8474DA2E260B6C8CF60D3"); // application authentication //$credentials = PagSeguroConfig::getApplicationCredentials(); //$credentials->setAuthorizationCode("E231B2C9BCC8474DA2E260B6C8CF60D3"); $refund = PagSeguroRefundService::createRefundRequest($credentials, $transactionCode, $refundAmount); self::printRefund($refund); } catch (PagSeguroServiceException $e) { die($e->getMessage()); } }
/** * Request a PagSeguro refund * @param string $transactionCode * @return Ambigous <boolean, NULL, string, unknown> */ public function refundRequest($transactionCode) { return $this->refundService->createRefundRequest($this->credentials, $transactionCode); }