当前位置: 首页>>代码示例>>PHP>>正文


PHP Cart66Common::curl方法代码示例

本文整理汇总了PHP中Cart66Common::curl方法的典型用法代码示例。如果您正苦于以下问题:PHP Cart66Common::curl方法的具体用法?PHP Cart66Common::curl怎么用?PHP Cart66Common::curl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cart66Common的用法示例。


在下文中一共展示了Cart66Common::curl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getIntlRates

 public function getIntlRates($zipOrigin, $countryCode, $value, $pounds = 0, $ounces = 0, $commercial = 'N', $mailType = 'Package', $container = 'VARIABLE', $size = "REGULAR", $machinable = 'true', $width = 10, $length = 15, $height = 10, $girth = 0)
 {
     $rateReq = 'IntlRateV2Request USERID="' . $this->_uspsUsername . '"';
     $countryName = Cart66Common::getCountryName($countryCode);
     $weight = $this->_convertToPoundOunces($pounds);
     $pounds = $weight->pounds;
     $ounces += $weight->ounces;
     $data = array('Revision' => '4', 'Package ID="1"' => array('Pounds' => $pounds, 'Ounces' => $ounces, 'Machinable' => $machinable, 'MailType' => $mailType, 'ValueOfContents' => $value, 'Country' => $countryName, 'Container' => $container, 'Size' => $size, 'Width' => $width, 'Length' => $length, 'Height' => $height, 'Girth' => $girth, 'OriginZip' => $zipOrigin));
     $xml = Cart66Common::arrayToXml($data, $rateReq);
     Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] USPS Intl rate request xml:\n{$xml}");
     $url = 'http://production.shippingapis.com/ShippingAPI.dll?API=IntlRateV2&Xml=' . urlencode($xml);
     $result = Cart66Common::curl($url);
     // Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] USPS Result:\n" . $result);
     $this->_parseIntlResult($result);
     return $this->_rates;
 }
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:16,代码来源:Cart66Usps.php

示例2: trim

<?php

$url = trim($url);
$saleAmt = $order->subtotal - $order->discount_amount;
$saleAmt = number_format($saleAmt, 2, '.', '');
$url = str_replace('idev_saleamt=XXX', 'idev_saleamt=' . $saleAmt, $url);
$url = str_replace('idev_ordernum=XXX', 'idev_ordernum=' . $order->trans_id, $url);
$ip = $_SERVER['REMOTE_ADDR'];
if ($order->ip != '') {
    $ip = $order->ip;
}
Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] order ip: {$ip}");
$url .= '&ip_address=' . $ip;
$promotionCode = Cart66Session::get('Cart66PromotionCode');
if (Cart66Setting::getValue('idev_coupon_codes') && $promotionCode) {
    $url .= '&coupon_code=' . $promotionCode;
}
Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Commission notification sent to: {$url}");
Cart66Common::curl($url);
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:19,代码来源:idevaffiliate-award.php


注:本文中的Cart66Common::curl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。