ProcessRequestToGateway($secret,$testMode,$gateway); if($response->IsError()) { echo 'AN ERROR OCCURED, Subscription not deleted. Error details: ' . $response->ErrorString(); } else { $expectedResponseHash = md5($terminalId.$response->MerchantReference().$response->DateTime().$secret); if($expectedResponseHash != $response->Hash()) { $merchantRef = $response->MerchantReference(); echo 'SUBSCRIPTION DELETION FAILED: INVALID RESPONSE HASH. Please contact ' . $adminEmail . ' or call ' . $adminPhone . ' to clarify if your card will be billed.'; if(isset($merchantRef)) { echo 'Please quote %Gateway Terminal ID: ' . $terminalId . ', and Subscription Merchant Reference: ' . $merchantRef . ' when mailling or calling.'; } } else { echo "Subscription successfully deleted."; } } ?>