本文整理汇总了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;
}