<?php

namespace Vinteract\Payments\Providers\PinPayments;

class Refund {
	
	public function process($postData) {
		
		// Create request instance.
		
		$request = new \Vinteract\Payments\Providers\PinPayments\Request("POST");
		
		// Process request and get the response.
		
		$response = $request->process(\Vinteract\Payments\Providers\PinPayments\PinPayments::getRequestUrl("charges/{$postData["transaction"]["transaction_id"]}/refunds"), [
			"amount" => $postData["refund"]["amount"] * 100,
		]);
		
		// Return the response.
		
		return $response;
		
	}
	
}
