WordPress.org

Plugin Directory


Ignore:
Timestamp:
07/11/12 17:16:32 (6 years ago)
Author:
waisir
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • alipay/trunk/includes/api_alipay/inc.alipayto.php

    r484616 r570762  
    66 
    77 
     8 
    89$p = $ws_payto_para; 
    910unset ($ws_payto_para); 
    1011///////////////////////////////////////////////////////////////////////////////////// 
     12 
     13$alipay_service = ws_alipay_get_setting('alipay_service'); 
     14if(empty($alipay_service)) $alipay_service ='create_direct_pay_by_user'; 
     15 
     16//create_direct_pay_by_user:即时到帐 
     17//create_partner_trade_by_buyer:担保交易 
     18//trade_create_by_buyer:双接口 
     19 
    1120 
    1221 
     
    1524//构造要请求的参数数组 
    1625$parameter = array( 
    17     "service"           => "create_direct_pay_by_user", 
     26    "service"           => $alipay_service, 
    1827 
    1928    "payment_type"      => "1", 
     
    5261 
    5362 
     63if(empty($orderInfo['ordname'])) $orderInfo['ordname'] ='收货人姓名'; 
     64if(empty($orderInfo['address'])) $orderInfo['address'] ='收货人地址'; 
     65if(empty($orderInfo['postcode'])) $orderInfo['postcode'] =123456; 
     66if(empty($orderInfo['phone'])) $orderInfo['phone'] ='15888888888'; 
     67if($orderInfo['freight']==0) //卖家付运费 
     68{ 
     69    $orderInfo['logistics_payment'] ='SELLER_PAY'; 
     70} 
     71     
     72else 
     73{ 
     74    $orderInfo['logistics_payment'] ='BUYER_PAY'; 
     75     
     76    if(empty($orderInfo['freight']))  
     77    { 
     78        $orderInfo['freight'] =0.00; 
     79         
     80    } 
     81    else 
     82    { 
     83        $parameter['price'] -= $orderInfo['freight']; 
     84         
     85        if($parameter['price']<0.01)$parameter['price']=0.01; 
     86        $parameter['price'] = number_format($parameter['price'],2); 
     87         
     88    } 
     89} 
     90     
     91 
     92$receive_name       = $orderInfo['ordname'];            //收货人姓名,如:张三 
     93$receive_address    = $orderInfo['address'];            //收货人地址,如:XX省XXX市XXX区XXX路XXX小区XXX栋XXX单元XXX号 
     94$receive_zip        = $orderInfo['postcode'];               //收货人邮编,如:123456 
     95$receive_phone      = "0571-88888888";      //收货人电话号码,如:0571-81234567 
     96$receive_mobile     = $orderInfo['phone'];      //收货人手机号码,如:13312341234 
     97 
     98 
     99$parameter['service']='trade_create_by_buyer'; 
     100$parameter['logistics_fee'] = $orderInfo['freight']; 
     101$parameter['logistics_type'] = 'EXPRESS'; 
     102$parameter['logistics_payment'] = $orderInfo['logistics_payment']; 
     103$parameter['receive_name'] = $receive_name; 
     104$parameter['receive_address'] = $receive_address; 
     105$parameter['receive_zip'] = $receive_zip; 
     106$parameter['receive_phone'] = $receive_phone; 
     107$parameter['receive_mobile'] = $receive_mobile; 
     108 
     109 
     110//print_r($parameter); 
     111//die(); 
     112 
    54113$alipayService = new AlipayService( $aliapy_config ); 
    55114$html_text = $alipayService->alipayForm( $parameter ); 
Note: See TracChangeset for help on using the changeset viewer.