技术相关
联系我们
Axepta BNP 支付接口项目php版本demo未完成版blowfish加密尝试
时间:2024-06-25 16:07
阅读:19
来源:互联网
<!DOCTYPE html> <HTML> <HEAD> <META charset="UTF-8" /> <META http-equiv="X-UA-Compatible" content="IE=edge" /> <META name="viewport" content="width=device-width, initial-scale=1.0" /> <TITLE>Site marchand - commande</TITLE> </HEAD> <BODY> <?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ $MerchantID = 'BNP_DEMO_AXEPTA'; $TransID = "1"; $RefNr = "LS65421"; $weburl = "http://217.0.0.1:81/"; echo "hash256-----------------------------<br>"; //$s1 = "*TID-4453732122167114558*YourMerchantID*1234*EUR"; $s1 = "*{$TransID}*{$MerchantID}*2000*EUR"; $key = "4n!BmF3_?9oJ2Q*z(iD7q6[RSb5)a]A8"; $result = hash_hmac('sha256', $s1,$key); echo "期待值:529c65ce765e684d42a29ca255ad99ae40b78715abc8ee958bfdbafd2597d30a<br>"; echo "s1:{$s1}<br>结果:{$result}<br>"; $len= strlen($s1); //------------------------------------------- 此部分禁止编辑,图片附在尾部 //------------------------------------------ $makedurl = "https://paymentpage.axepta.bnpparibas/payssl.aspx?MerchantID=$MerchantID&Len=$len&DATA=$result&CustomField14=iframe"; echo $makedurl; $demourl = "https://paymentpage.axepta.bnpparibas/payssl.aspx?MerchantID=BNP_DEMO_AXEPTA&Len=291&DATA=43ad07f58ff6a5f9ebbdd42e361d2c85ce4ad41fcd63c697c9ca59076fb5cb782237a2e862a97bb24d949911bb701d698dfed6901f1bcb92404f53b8f5336525167ac5b8a9b89c5fb88d79967366e99e59d95f3f3f0c37126a52495115e28f938e76748a5dc703f7ccbda6ccb4fc253b255c06e0df990fdd94f4313ec2b94142f9978adb9d1079a36a9dbb83e9638e3e58a124d532ece1b7bc175fa340bd0c73c33d4f78374420091e90735bb014a5163d86bfe38795decacf0358075a85c0fbf80c5535046e7f8df64d204c7a4755e07700d4d17c9ef0bdc6e8bbd9c377e3ee0493a0ad2d3a9a624d693d04fe0bdfb3ebb2ef5badb63291ab8d7ad29b4f19b2b0f87dbc0bdb38f282816fe694ac2d512ba741d76a830b2083232246763aa006472661aeb2acf126&CustomField14=iframe"; ?> <br><br> <br> <br> <br> <SCRIPT> // sur la page courante // on place un écouteur avec la méthode addEventListener window.addEventListener( // type d'évenement à écouter "message", // fonction de retour (callback) qui sera exécutée // quand un évenement de type "message" sera émis (event) => { // Si l'origin n'est pas la même que celle placée dans le message // on arrête l'exécution de la fonction if (event.origin !== "https://mon-site.com") return; // on redirige l'utilisateur sur la page souhaitée window.location.href = "https://mon-site.com/payment-success"; } ); </SCRIPT> <STYLE> #payment-iframe { height: 550px; width: 400px; border: none } // ou pour un rendu fullscreen /*#payment-iframe { height: 100vh; width: 100vw; }*/ </style> <IFRAME id="payment-iframe" src="<? echo $demourl?>" <!--src="https://paymentpage.axepta.bnpparibas/payssl.aspx?MerchantID=<? echo $MerchantID?>&Len=<? echo $len?>&DATA=<? echo $result?>&CustomField14=iframe"--> /> ... </BODY> </HTML>