<?php 
namespace app\common\payment;

//實作金流基礎類別
abstract class BasePayment{
    public function __construct(){

    }

    public function generate($input, $action){
        //將傳入的$input array轉成html form,設定action為$action
        $html = '<form id="payment_form" method="post" action="'.$action.'">';
        foreach($input as $key => $value){
            $html .= '<input name="'.$key.'" value="'.$value.'">';
        }
        
        $html .= '<input type="submit" value="確定付款"/>';
        $html .= '</form>';

        return $html;
    }
}
