<commit_before><?php

/*
 * This file is part of the Omnipay package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Omnipay\PayPal\Message;

/**
 * PayPal Refund Request
 */
class RefundRequest extends AbstractRequest
{
    public function getData()
    {
        $data = $this->getBaseData('RefundTransaction');

        $this->validate('transactionReference');

        $data['TRANSACTIONID'] = $this->getTransactionReference();
        $data['REFUNDTYPE'] = 'Full';

        return $data;
    }
}
<commit_msg>Add PayPal partial refund support. Closes #52<commit_after><?php

/*
 * This file is part of the Omnipay package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Omnipay\PayPal\Message;

/**
 * PayPal Refund Request
 */
class RefundRequest extends AbstractRequest
{
    public function getData()
    {
        $data = $this->getBaseData('RefundTransaction');

        $this->validate('transactionReference');

        $data['TRANSACTIONID'] = $this->getTransactionReference();
        $data['REFUNDTYPE'] = 'Full';
        if ($this->getAmountDecimal() > 0) {
            $data['REFUNDTYPE'] = 'Partial';
            $data['AMT'] = $this->getAmountDecimal();
            $data['CURRENCYCODE'] = $this->getCurrency();
        }

        return $data;
    }
}

{'fraction_non_alphanumeric': 0.1375, 'fraction_numerical': 0.001973684210526316, 'mean_word_length': 3.0668449197860963, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7381939', 'n_tokens_mistral': 452, 'n_tokens_neox': 443, 'n_words': 119}