public function credit(FinancialTransactionInterface $transaction, $retry)
 {
     $data = $transaction->getExtendedData();
     $approveTransaction = $transaction->getCredit()->getPayment()->getApproveTransaction();
     $parameters = array();
     if (Number::compare($transaction->getRequestedAmount(), $approveTransaction->getProcessedAmount()) !== 0) {
         $parameters['REFUNDTYPE'] = 'Partial';
         $parameters['AMT'] = $this->client->convertAmountToPaypalFormat($transaction->getRequestedAmount());
         $parameters['CURRENCYCODE'] = $transaction->getCredit()->getPaymentInstruction()->getCurrency();
     }
     $response = $this->client->requestRefundTransaction($data->get('authorization_id'), $parameters);
     $this->throwUnlessSuccessResponse($response, $transaction);
     $transaction->setReferenceNumber($response->body->get('REFUNDTRANSACTIONID'));
     $transaction->setProcessedAmount($response->body->get('NETREFUNDAMT'));
     $transaction->setResponseCode(PluginInterface::RESPONSE_CODE_SUCCESS);
 }