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

class BarcodePay
{
    public function pay($barcodePayInput)
    {
        $pay = new Pay();
        $result = $pay->Payment($barcodePayInput);
        if($result->GetSuccess())
        {
            echo '商户单号：'.$result->GetData('MerchantOrderNo').',平台单号：'.$result->GetData('PlatformOrderNo').'订单状态：';
            switch($result->GetData('Status')){
                case 1:
                    echo '支付成功';
                    break;
                case 2:
                    echo '待支付';
                    break;
                case 3:
                    echo '支付失败';
                    break;
            }
        }
        else
        {
            echo $result->GetData("RespMessage");
        }
    }
}