<?php
require_once "../lib/DzPay.Api.php";

class ScanPay
{
    public function pay($scanPayInput)
    {
        $pay = new Pay();
        $result = $pay->Payment($scanPayInput,5);
        if($result->GetSuccess())
        {
            echo '商户单号：'.$result->GetData('MerchantOrderNo').',平台单号：'.$result->GetData('PlatformOrderNo').PHP_EOL;
            echo '<img src="http://pan.baidu.com/share/qrcode?w=250&h=250&url='.$result->GetData("ToPayData").'" />';
        }
        else
        {
            echo $result->GetData("RespMessage");
        }
    }
}