Skip to content

Instantly share code, notes, and snippets.

@lucasnetau
Created September 22, 2016 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucasnetau/bcacb528d664f0ad1339086c1a585021 to your computer and use it in GitHub Desktop.
Save lucasnetau/bcacb528d664f0ad1339086c1a585021 to your computer and use it in GitHub Desktop.
Patch for SHA256 support for OmniPay MIGS
--- AbstractRequest.php.2 2016-09-21 19:45:07.846345749 -0400
+++ AbstractRequest.php 2016-09-21 19:46:47.049424061 -0400
@@ -67,6 +67,9 @@
$hash = null;
foreach ($data as $k => $v) {
+ // Skip vpc_ keys that are not included in the hash calculation
+ if(in_array($k, array('vpc_SecureHash', 'vpc_SecureHashType'))) continue;
+
if ((strlen($v) > 0) && ((substr($k, 0, 4)=="vpc_") || (substr($k, 0, 5) =="user_"))) {
$hash .= $k . "=" . $v . "&";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment