本文整理匯總了PHP中MP::get_preapproval_payment方法的典型用法代碼示例。如果您正苦於以下問題:PHP MP::get_preapproval_payment方法的具體用法?PHP MP::get_preapproval_payment怎麽用?PHP MP::get_preapproval_payment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MP
的用法示例。
在下文中一共展示了MP::get_preapproval_payment方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: MP
require_once "lib/mercadopago.php";
$mp = new MP("3821444876288488", "1MsZwpHqFP2MDPh1d4IaXsIrUAbIXbjt");
$arquivo = fopen('result_ipn.php', 'a');
fwrite($arquivo, "\n POST <? echo('<pre>'); ?> " . $_SERVER['REQUEST_URI'] . "<? echo('</pre>'); ?><br><br>");
fclose($arquivo);
switch ($_GET["topic"]) {
case "payment":
$payment_info = $mp->get_payment_info($_GET["id"]);
if ($payment_info["status"] == 200) {
$arquivo = fopen('result_ipn.php', 'a');
fwrite($arquivo, "\n<? echo('<pre>'); ?> " . json_encode($payment_info) . "<? echo('</pre>'); ?><br><hr><br>");
fclose($arquivo);
}
break;
case "preapproval":
$payment_info = $mp->get_preapproval_payment($_GET["id"]);
if ($payment_info["status"] == 200) {
$arquivo = fopen('result_ipn.php', 'a');
fwrite($arquivo, "\n<pre> " . json_encode($payment_info) . "</pre><br><hr><br>");
fclose($arquivo);
}
break;
case "authorized_payment":
$payment_info = $mp->get_authorized_payment($_GET["id"]);
if ($payment_info["status"] == 200) {
$arquivo = fopen('result_ipn.php', 'a');
fwrite($arquivo, "\n<pre> " . json_encode($payment_info) . "</pre><br><hr><br>");
fclose($arquivo);
}
break;
}