<commit_before><?php
namespace Payum\Payeezy\Action;

use Payum\Core\Bridge\Spl\ArrayObject;
use Payum\Core\Exception\RequestNotSupportedException;
use Payum\Core\Request\Cancel;
use Payum\Payeezy;

class CancelAction extends Api\BaseApiAwareAction {
	/**
	 * {@inheritDoc}
	 *
	 * @param Cancel $request
	 */
	public function execute($request) {
		/* @var $request Cancel */
		RequestNotSupportedException::assertSupports($this, $request);
		$details = ArrayObject::ensureArrayObject($request->getModel());
		if (!isset($details['method'])) {
			$details['method'] = 'credit_card';
		}
		$details['transaction_type'] = 'void';
		$transaction_id = null;
		if (isset($details['transaction_tag'])) {
			$transaction_id = $details['transaction_id'];
			unset($details['transaction_id']);
		}

		$result = $this->api->doRequest($details->toUnsafeArray(), $transaction_id);<commit_msg>update cancel and refund<commit_after><?php
namespace Payum\Payeezy\Action;

use Payum\Core\Bridge\Spl\ArrayObject;
use Payum\Core\Exception\RequestNotSupportedException;
use Payum\Core\Request\Cancel;
use Payum\Payeezy;

class CancelAction extends Api\BaseApiAwareAction {
	/**
	 * {@inheritDoc}
	 *
	 * @param Cancel $request
	 */
	public function execute($request) {
		/* @var $request Cancel */
		RequestNotSupportedException::assertSupports($this, $request);
		$details = ArrayObject::ensureArrayObject($request->getModel());
		if (!isset($details['method'])) {
			$details['method'] = 'credit_card';
		}
		$details['transaction_type'] = 'void';

		$transaction_id = null;
		if (isset($details['transaction_tag'])) {
			$transaction_id = $details['transaction_id'];
			unset($details['transaction_id']);
		}

		$result = $this->api->doRequest($details->toUnsafeArray(), $transaction_id);
{'fraction_non_alphanumeric': 0.1636568848758465, 'fraction_numerical': 0.0, 'mean_word_length': 5.845559845559846, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '7424621', 'n_tokens_mistral': 597, 'n_tokens_neox': 551, 'n_words': 92}