Rumah pembangunan bahagian belakang tutorial php zencart先生成订单后付款,类似淘宝后台修改订单价格

zencart先生成订单后付款,类似淘宝后台修改订单价格

Aug 08, 2016 am 09:21 AM
gt lt order

Zencart 使用 Paypal 付款,会出现漏单的情况,即 paypal 已经收到客户的付款,但是网站后台没有客户的订单。导致 paypal 漏单的原因大致会是当客户跳转到Paypal 网站付款完毕之后,直接关闭了窗口,或者网络不稳定,没有正常跳转到网站。

解决 Paypal 漏单问题的方案有好几种:

一. 开启 Detailed Line Items in Cart 选项。

原理:在 zencart 后台 Module --> Payment --> PayPal Website Payments Standard - IPN 开启 Detailed Line Items in Cart 选项。这个选项会把你所有的订单物品信息传给 paypal,当客户付款成功而后台未能成功生成订单时,也可以通过 paypal 帐号交易信息看到客户购买了哪些物品。

二. 使用 Paypal Sessions Viewer 插件找回 Paypal 漏掉的订单。

原理:zencart 购物车的物品,通过 paypal 方式付款,会在 paypal_session 表中保存此次付款的所有记录,如果付款成功后,从 paypal 网站跳转到购物网站并生成了订单时,zencart系统会自动删除这条 paypal_session 记录,如果没有成功跳转到购物网站,没有成功生成订单,那这条付款记录数据就会一直保存在数据库,当使用 Paypal Session Viewer 插件,就能查看这条记录的所有数据,包括客户信息,购物时间,商品信息,如果你确定已收到款,就可以把这条 paypal_session 信息转移到订单中,生成一个订单。

插件下载地址:http://www.zen-cart.cn/english-version-modules/admin-tools/paypal-sessions-viewer

三. 修改付款流程,先生成订单后付款。

原理:用过zen-cart的人都知道,zen-cart中下单步骤是下面这样的(其中[]中的表示不是必须的):

1. 购物车(shopping cart)

2. [货运方式(delivery method)]

3. 支付方式(payment method)

4. 订单确认(confirmation)

5. [第三方网站支付]

6. 订单处理(checkout process)——这一步比较重要,因为会在这里将购物车中的信息写入订单

7. 下单成功(checkout success)

这样的流程在正常情况下是没有任何问题的。但是,从第5步到第6部的过程中,用户可能以为付款成功就直接关闭掉网页了,或者由于网络原因造成不能正常跳转到checkout_process页面,这样造成的后果是很严重的,因为订单不能被正常的创建。基于上述的分析, 我们希望稍微地改变一下流程,即在支付之前订单已经创建好了,这样就算在支付时不能从第三方支付网站跳转回来,我们也不会存在用户付款成功却在后台没有订单的情况了。

本人是参照东国先生的这篇 修改zen-cart下单和付款流程以防止漏单 教程去修改的,因为这个教程比较老,而且也没有很全面,所以我根据自己的实际需求,把他做的更完善,更细节化。

经过修改后的蓝图基本是下面这样的:

1. 在checkour_confirmation页面确认订单后,都会直接proccess,并且进入 account_history_info 页面,可以在这里进入付款页面。如下图所示:

2. 如果当时客户没能付款,也可进入自己的后台对历史订单进行付款。如下图所示:

 

3. 未付款的订单,可以在后台修改价格,像淘宝一样拍下宝贝后,店主给你修改价格后再付款一样。如下图所示:

下面我们来正式修改代码,首先我列举出所有要修改的文件:

1. includes/classes/payment.php

2. includes/modules/payment/paypal.php

3. includes/classes/order.php

4. includes/modules/pages/checkout_process/header_php.php

5. includes/modules/pages/account_history_info/header_php.php

6. includes/templates/你的模板目录/templates/tpl_account_history_info_default.php

7. includes/templates/你的模板目录/templates/tpl_account_history_default.php

8. ipn_main_handler.php

9. admin(后台目录)/orders.php

因为先生成订单再付款,付款步骤就会比原来又多了一步,为了简化付款流程,我安装了 Fast And Easy Checkout For Zencart(快速支付) 插件,安装此插件之前,需要安装另外一个插件 Css Js Loader For Zencart,这是快速支付插件的依赖插件。快速支付与先生成订单后支付没什么因果关系,所以如果你不想安装的话完全可以不理。

按步骤修改上面列举的文件:

1. 首先我们需要对现有的支付模块进行一个改造。需要对支付方式的class增加一个字段paynow_action_url,用来表示进行支付的页面 url,另外还需要增加一个函数,paynow_button($order_id),来获取支付表单的参数隐藏域代码。

要增加 paynow_action_url 变量,请在类payment的构造函数中最后加上下面的代码:    

<span>if</span> ( (zen_not_null(<span>$module</span>)) && (<span>in_array</span>(<span>$module</span>.'.php', <span>$this</span>->modules)) && (<span>isset</span>(<span>$GLOBALS</span>[<span>$module</span>]-><span>paynow_action_url)) ) {
        </span><span>$this</span>->paynow_action_url = <span>$GLOBALS</span>[<span>$module</span>]-><span>paynow_action_url;        
}</span>
Salin selepas log masuk

要增加paynow_button($order_id)函数,请在payment类的最后一个函数之后加上如下的代码:

<span>function</span> paynow_button(<span>$order_id</span><span>){
    </span><span>if</span> (<span>is_array</span>(<span>$this</span>-><span>modules)) {
      </span><span>if</span> (<span>is_object</span>(<span>$GLOBALS</span>[<span>$this</span>-><span>selected_module])) {
        </span><span>return</span><span>$GLOBALS</span>[<span>$this</span>->selected_module]->paynow_button(<span>$order_id</span><span>);
      }
    }
}</span>
Salin selepas log masuk

2. 以paypal支付方式为例子,说明如何具体实现。这里直接修改 paypal.php 文件,注意备份此文件。代码如下所示,可以看到,这里去掉了对 form_action_url 的指定,并给定了 paynow_action_url,因为我们希望用户点击“确认订单”后直接进入checkout_process,所以如果不指定 form_action_url,那么确认订单的表单就会直接提交到 checkout_process 页面了,而 paynow_action_url 就是 以前的 form_action_url 的值。paynow_button 函数的实现也很简单,这里只是将原先的 process_button() 函数的内容剪切过来而已,只不过我们没有使用全局的$order变量,而是使用 $order = new order($order_id),来重新构造的一个对象,这样做是为在历史订单中显示pay now按钮做准备的。paypal.php修改后的文件如下:

<span>  1</span> <span>php
</span><span>  2</span><span>/*</span><span>*
</span><span>  3</span><span> * paypal.php payment module class for PayPal Website Payments Standard (IPN) method
</span><span>  4</span><span> *
</span><span>  5</span><span> * @package paymentMethod
</span><span>  6</span><span> * @copyright Copyright 2003-2010 Zen Cart Development Team
</span><span>  7</span><span> * @copyright Portions Copyright 2003 osCommerce
</span><span>  8</span><span> * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
</span><span>  9</span><span> * @version $Id: paypal.php 15735 2010-03-29 07:13:53Z drbyte $
</span><span> 10</span><span>*/</span><span> 11</span><span> 12</span><span>define</span>('MODULE_PAYMENT_PAYPAL_TAX_OVERRIDE', 'true'<span>);
</span><span> 13</span><span> 14</span><span>/*</span><span>*
</span><span> 15</span><span> *  ensure dependencies are loaded
</span><span> 16</span><span>*/</span><span> 17</span><span>include_once</span>((IS_ADMIN_FLAG === <span>true</span> ? DIR_FS_CATALOG_MODULES : DIR_WS_MODULES) . 'payment/paypal/paypal_functions.php'<span>);
</span><span> 18</span><span> 19</span><span>/*</span><span>*
</span><span> 20</span><span> * paypal.php payment module class for PayPal Website Payments Standard (IPN) method
</span><span> 21</span><span> *
</span><span> 22</span><span>*/</span><span> 23</span><span>class</span> paypal <span>extends</span><span> base {
</span><span> 24</span><span>/*</span><span>*
</span><span> 25</span><span>   * string representing the payment method
</span><span> 26</span><span>   *
</span><span> 27</span><span>   * @var string
</span><span> 28</span><span>*/</span><span> 29</span><span>var</span><span>$code</span><span>;
</span><span> 30</span><span>/*</span><span>*
</span><span> 31</span><span>   * $title is the displayed name for this payment method
</span><span> 32</span><span>   *
</span><span> 33</span><span>   * @var string
</span><span> 34</span><span>*/</span><span> 35</span><span>var</span><span>$title</span><span>;
</span><span> 36</span><span>/*</span><span>*
</span><span> 37</span><span>   * $description is a soft name for this payment method
</span><span> 38</span><span>   *
</span><span> 39</span><span>   * @var string
</span><span> 40</span><span>*/</span><span> 41</span><span>var</span><span>$description</span><span>;
</span><span> 42</span><span>/*</span><span>*
</span><span> 43</span><span>   * $enabled determines whether this module shows or not... in catalog.
</span><span> 44</span><span>   *
</span><span> 45</span><span>   * @var boolean
</span><span> 46</span><span>*/</span><span> 47</span><span>var</span><span>$enabled</span><span>;
</span><span> 48</span><span>/*</span><span>*
</span><span> 49</span><span>    * constructor
</span><span> 50</span><span>    *
</span><span> 51</span><span>    * @param int $paypal_ipn_id
</span><span> 52</span><span>    * @return paypal
</span><span> 53</span><span>*/</span><span> 54</span><span>function</span> paypal(<span>$paypal_ipn_id</span> = ''<span>) {
</span><span> 55</span><span>global</span><span>$order</span>, <span>$messageStack</span><span>;
</span><span> 56</span><span>$this</span>->code = 'paypal'<span>;
</span><span> 57</span><span>$this</span>->codeVersion = '1.3.9'<span>;
</span><span> 58</span><span>if</span> (IS_ADMIN_FLAG === <span>true</span><span>) {
</span><span> 59</span><span>$this</span>->title = MODULE_PAYMENT_PAYPAL_TEXT_ADMIN_TITLE; <span>//</span><span> Payment Module title in Admin</span><span> 60</span><span>if</span> (IS_ADMIN_FLAG === <span>true</span> && <span>defined</span>('MODULE_PAYMENT_PAYPAL_IPN_DEBUG') && MODULE_PAYMENT_PAYPAL_IPN_DEBUG != 'Off') <span>$this</span>->title .= '<span> (debug mode active)</span>'<span>;
</span><span> 61</span><span>if</span> (IS_ADMIN_FLAG === <span>true</span> && MODULE_PAYMENT_PAYPAL_TESTING == 'Test') <span>$this</span>->title .= '<span> (dev/test mode active)</span>'<span>;
</span><span> 62</span>     } <span>else</span><span> {
</span><span> 63</span><span>$this</span>->title = MODULE_PAYMENT_PAYPAL_TEXT_CATALOG_TITLE; <span>//</span><span> Payment Module title in Catalog</span><span> 64</span><span>    }
</span><span> 65</span><span>$this</span>->description =<span> MODULE_PAYMENT_PAYPAL_TEXT_DESCRIPTION;
</span><span> 66</span><span>$this</span>->sort_order =<span> MODULE_PAYMENT_PAYPAL_SORT_ORDER;
</span><span> 67</span><span>$this</span>->enabled = ((MODULE_PAYMENT_PAYPAL_STATUS == 'True') ? <span>true</span> : <span>false</span><span>);
</span><span> 68</span><span>if</span> ((int)MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID > 0<span>) {
</span><span> 69</span><span>$this</span>->order_status =<span> MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID;
</span><span> 70</span><span>    }
</span><span> 71</span><span>if</span> (<span>is_object</span>(<span>$order</span>)) <span>$this</span>-><span>update_status();
</span><span> 72</span><span>$this</span>->paynow_action_url = 'https://' .<span> MODULE_PAYMENT_PAYPAL_HANDLER;
</span><span> 73</span><span> 74</span><span>if</span> (PROJECT_VERSION_MAJOR != '1' && <span>substr</span>(PROJECT_VERSION_MINOR, 0, 3) != '3.9') <span>$this</span>->enabled = <span>false</span><span>;
</span><span> 75</span><span> 76</span><span>//</span><span> verify table structure</span><span> 77</span><span>if</span> (IS_ADMIN_FLAG === <span>true</span>) <span>$this</span>-><span>tableCheckup();
</span><span> 78</span><span>  }
</span><span> 79</span><span>/*</span><span>*
</span><span> 80</span><span>   * calculate zone matches and flag settings to determine whether this module should display to customers or not
</span><span> 81</span><span>    *
</span><span> 82</span><span>*/</span><span> 83</span><span>function</span><span> update_status() {
</span><span> 84</span><span>global</span><span>$order</span>, <span>$db</span><span>;
</span><span> 85</span><span> 86</span><span>if</span> ( (<span>$this</span>->enabled == <span>true</span>) && ((int)MODULE_PAYMENT_PAYPAL_ZONE > 0<span>) ) {
</span><span> 87</span><span>$check_flag</span> = <span>false</span><span>;
</span><span> 88</span><span>$check_query</span> = <span>$db</span>->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PAYPAL_ZONE . "' and zone_country_id = '" . <span>$order</span>->billing['country']['id'] . "' order by zone_id"<span>);
</span><span> 89</span><span>while</span> (!<span>$check_query</span>-><span>EOF) {
</span><span> 90</span><span>if</span> (<span>$check_query</span>->fields['zone_id'] ) {
<span> 91</span><span>$check_flag</span> = <span>true</span><span>;
</span><span> 92</span><span>break</span><span>;
</span><span> 93</span>         } <span>elseif</span> (<span>$check_query</span>->fields['zone_id'] == <span>$order</span>->billing['zone_id'<span>]) {
</span><span> 94</span><span>$check_flag</span> = <span>true</span><span>;
</span><span> 95</span><span>break</span><span>;
</span><span> 96</span><span>        }
</span><span> 97</span><span>$check_query</span>-><span>MoveNext();
</span><span> 98</span><span>      }
</span><span> 99</span><span>100</span><span>if</span> (<span>$check_flag</span> == <span>false</span><span>) {
</span><span>101</span><span>$this</span>->enabled = <span>false</span><span>;
</span><span>102</span><span>      }
</span><span>103</span><span>    }
</span><span>104</span><span>  }
</span><span>105</span><span>/*</span><span>*
</span><span>106</span><span>   * JS validation which does error-checking of data-entry if this module is selected for use
</span><span>107</span><span>   * (Number, Owner, and CVV Lengths)
</span><span>108</span><span>   *
</span><span>109</span><span>   * @return string
</span><span>110</span><span>*/</span><span>111</span><span>function</span><span> javascript_validation() {
</span><span>112</span><span>return</span><span>false</span><span>;
</span><span>113</span><span>  }
</span><span>114</span><span>/*</span><span>*
</span><span>115</span><span>   * Displays payment method name along with Credit Card Information Submission Fields (if any) on the Checkout Payment Page
</span><span>116</span><span>   *
</span><span>117</span><span>   * @return array
</span><span>118</span><span>*/</span><span>119</span><span>function</span><span> selection() {
</span><span>120</span><span>return</span><span>array</span>('id' => <span>$this</span>->code,
<span>121</span>                  'module' => MODULE_PAYMENT_PAYPAL_TEXT_CATALOG_LOGO,
<span>122</span>                  'icon' =><span> MODULE_PAYMENT_PAYPAL_TEXT_CATALOG_LOGO
</span><span>123</span><span>                 );
</span><span>124</span><span>  }
</span><span>125</span><span>/*</span><span>*
</span><span>126</span><span>   * Normally evaluates the Credit Card Type for acceptance and the validity of the Credit Card Number & Expiration Date
</span><span>127</span><span>   * Since paypal module is not collecting info, it simply skips this step.
</span><span>128</span><span>   *
</span><span>129</span><span>   * @return boolean
</span><span>130</span><span>*/</span><span>131</span><span>function</span><span> pre_confirmation_check() {
</span><span>132</span><span>return</span><span>false</span><span>;
</span><span>133</span><span>  }
</span><span>134</span><span>/*</span><span>*
</span><span>135</span><span>   * Display Credit Card Information on the Checkout Confirmation Page
</span><span>136</span><span>   * Since none is collected for paypal before forwarding to paypal site, this is skipped
</span><span>137</span><span>   *
</span><span>138</span><span>   * @return boolean
</span><span>139</span><span>*/</span><span>140</span><span>function</span><span> confirmation() {
</span><span>141</span><span>return</span><span>false</span><span>;
</span><span>142</span><span>  }
</span><span>143</span><span>/*</span><span>*
</span><span>144</span><span>   * Build the data and actions to process when the "Submit" button is pressed on the order-confirmation screen.
</span><span>145</span><span>   * This sends the data to the payment gateway for processing.
</span><span>146</span><span>   * (These are hidden fields on the checkout confirmation page)
</span><span>147</span><span>   *
</span><span>148</span><span>   * @return string
</span><span>149</span><span>*/</span><span>150</span><span>function</span><span> process_button() {
</span><span>151</span><span>return</span><span>false</span><span>;
</span><span>152</span><span>  }
</span><span>153</span><span>/*</span><span>*
</span><span>154</span><span>   * Determine the language to use when visiting the PayPal site
</span><span>155</span><span>*/</span><span>156</span><span>function</span><span> getLanguageCode() {
</span><span>157</span><span>global</span><span>$order</span><span>;
</span><span>158</span><span>$lang_code</span> = ''<span>;
</span><span>159</span><span>$orderISO</span> = zen_get_countries(<span>$order</span>->customer['country']['id'], <span>true</span><span>);
</span><span>160</span><span>$storeISO</span> = zen_get_countries(STORE_COUNTRY, <span>true</span><span>);
</span><span>161</span><span>if</span> (<span>in_array</span>(<span>strtoupper</span>(<span>$orderISO</span>['countries_iso_code_2']), <span>array</span>('US', 'AU', 'DE', 'FR', 'IT', 'GB', 'ES', 'AT', 'BE', 'CA', 'CH', 'CN', 'NL', 'PL'<span>))) {
</span><span>162</span><span>$lang_code</span> = <span>strtoupper</span>(<span>$orderISO</span>['countries_iso_code_2'<span>]);
</span><span>163</span>     } <span>elseif</span> (<span>in_array</span>(<span>strtoupper</span>(<span>$storeISO</span>['countries_iso_code_2']), <span>array</span>('US', 'AU', 'DE', 'FR', 'IT', 'GB', 'ES', 'AT', 'BE', 'CA', 'CH', 'CN', 'NL', 'PL'<span>))) {
</span><span>164</span><span>$lang_code</span> = <span>strtoupper</span>(<span>$storeISO</span>['countries_iso_code_2'<span>]);
</span><span>165</span>     } <span>elseif</span> (<span>in_array</span>(<span>strtoupper</span>(<span>$_SESSION</span>['languages_code']), <span>array</span>('EN', 'US', 'AU', 'DE', 'FR', 'IT', 'GB', 'ES', 'AT', 'BE', 'CA', 'CH', 'CN', 'NL', 'PL'<span>))) {
</span><span>166</span><span>$lang_code</span> = <span>$_SESSION</span>['languages_code'<span>];
</span><span>167</span><span>if</span> (<span>strtoupper</span>(<span>$lang_code</span>) == 'EN') <span>$lang_code</span> = 'US'<span>;
</span><span>168</span><span>    }
</span><span>169</span><span>//</span><span>return $orderISO['countries_iso_code_2'];</span><span>170</span><span>return</span><span>strtoupper</span>(<span>$lang_code</span><span>);
</span><span>171</span><span>  }
</span><span>172</span><span>/*</span><span>*
</span><span>173</span><span>   * Store transaction info to the order and process any results that come back from the payment gateway
</span><span>174</span><span>*/</span><span>175</span><span>function</span><span> before_process() {
</span><span>176</span><span>return</span><span>false</span><span>;
</span><span>177</span><span>  }
</span><span>178</span><span>/*</span><span>*
</span><span>179</span><span>    * Checks referrer
</span><span>180</span><span>    *
</span><span>181</span><span>    * @param string $zf_domain
</span><span>182</span><span>    * @return boolean
</span><span>183</span><span>*/</span><span>184</span><span>function</span> check_referrer(<span>$zf_domain</span><span>) {
</span><span>185</span><span>return</span><span>true</span><span>;
</span><span>186</span><span>  }
</span><span>187</span><span>/*</span><span>*
</span><span>188</span><span>    * Build admin-page components
</span><span>189</span><span>    *
</span><span>190</span><span>    * @param int $zf_order_id
</span><span>191</span><span>    * @return string
</span><span>192</span><span>*/</span><span>193</span><span>function</span> admin_notification(<span>$zf_order_id</span><span>) {
</span><span>194</span><span>global</span><span>$db</span><span>;
</span><span>195</span><span>$output</span> = ''<span>;
</span><span>196</span><span>$sql</span> = "select * from " . TABLE_PAYPAL . " where order_id = '" . (int)<span>$zf_order_id</span> . "' order by paypal_ipn_id DESC LIMIT 1"<span>;
</span><span>197</span><span>$ipn</span> = <span>$db</span>->Execute(<span>$sql</span><span>);
</span><span>198</span><span>if</span> (<span>$ipn</span>->RecordCount() > 0 && <span>file_exists</span>(DIR_FS_CATALOG . DIR_WS_MODULES . 'payment/paypal/paypal_admin_notification.php')) <span>require</span>(DIR_FS_CATALOG . DIR_WS_MODULES . 'payment/paypal/paypal_admin_notification.php'<span>);
</span><span>199</span><span>return</span><span>$output</span><span>;
</span><span>200</span><span>  }
</span><span>201</span><span>/*</span><span>*
</span><span>202</span><span>   * Post-processing activities
</span><span>203</span><span>   * When the order returns from the processor, if PDT was successful, this stores the results in order-status-history and logs data for subsequent reference
</span><span>204</span><span>   *
</span><span>205</span><span>   * @return boolean
</span><span>206</span><span>*/</span><span>207</span><span>function</span><span> after_process() {
</span><span>208</span><span>return</span><span>false</span><span>;
</span><span>209</span><span>  }
</span><span>210</span><span>/*</span><span>*
</span><span>211</span><span>   * Used to display error message details
</span><span>212</span><span>   *
</span><span>213</span><span>   * @return boolean
</span><span>214</span><span>*/</span><span>215</span><span>function</span><span> output_error() {
</span><span>216</span><span>return</span><span>false</span><span>;
</span><span>217</span><span>  }
</span><span>218</span><span>/*</span><span>*
</span><span>219</span><span>   * Check to see whether module is installed
</span><span>220</span><span>   *
</span><span>221</span><span>   * @return boolean
</span><span>222</span><span>*/</span><span>223</span><span>function</span><span> check() {
</span><span>224</span><span>global</span><span>$db</span><span>;
</span><span>225</span><span>if</span> (IS_ADMIN_FLAG === <span>true</span><span>) {
</span><span>226</span><span>global</span><span>$sniffer</span><span>;
</span><span>227</span><span>if</span> (<span>$sniffer</span>->field_exists(TABLE_PAYPAL, 'zen_order_id'))  <span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE COLUMN zen_order_id order_id int(11) NOT NULL default '0'"<span>);
</span><span>228</span><span>    }
</span><span>229</span><span>if</span> (!<span>isset</span>(<span>$this</span>-><span>_check)) {
</span><span>230</span><span>$check_query</span> = <span>$db</span>->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYPAL_STATUS'"<span>);
</span><span>231</span><span>$this</span>->_check = <span>$check_query</span>-><span>RecordCount();
</span><span>232</span><span>    }
</span><span>233</span><span>return</span><span>$this</span>-><span>_check;
</span><span>234</span><span>  }
</span><span>235</span><span>/*</span><span>*
</span><span>236</span><span>   * Install the payment module and its configuration settings
</span><span>237</span><span>    *
</span><span>238</span><span>*/</span><span>239</span><span>function</span><span> install() {
</span><span>240</span><span>global</span><span>$db</span>, <span>$messageStack</span><span>;
</span><span>241</span><span>if</span> (<span>defined</span>('MODULE_PAYMENT_PAYPAL_STATUS'<span>)) {
</span><span>242</span><span>$messageStack</span>->add_session('PayPal Website Payments Standard module already installed.', 'error'<span>);
</span><span>243</span>       zen_redirect(zen_href_link(FILENAME_MODULES, 'set=payment&module=paypal', 'NONSSL'<span>));
</span><span>244</span><span>return</span> 'failed'<span>;
</span><span>245</span><span>    }
</span><span>246</span><span>if</span> (<span>defined</span>('MODULE_PAYMENT_PAYPALWPP_STATUS'<span>)) {
</span><span>247</span><span>$messageStack</span>->add_session('NOTE: PayPal Express Checkout module already installed. You don\'t need Standard if you have Express installed.', 'error'<span>);
</span><span>248</span>       zen_redirect(zen_href_link(FILENAME_MODULES, 'set=payment&module=paypalwpp', 'NONSSL'<span>));
</span><span>249</span><span>return</span> 'failed'<span>;
</span><span>250</span><span>    }
</span><span>251</span><span>$db</span>->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable PayPal Module', 'MODULE_PAYMENT_PAYPAL_STATUS', 'True', 'Do you want to accept PayPal payments?', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())"<span>);
</span><span>252</span><span>$db</span>->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Business ID', 'MODULE_PAYMENT_PAYPAL_BUSINESS_ID','".STORE_OWNER_EMAIL_ADDRESS."', 'Primary email address for your PayPal account.<br>NOTE: This must match <strong>EXACTLY </strong>the primary email address on your PayPal account settings.  It <strong>IS case-sensitive</strong>, so please check your PayPal profile preferences at paypal.com and be sure to enter the EXACT same primary email address here.', '6', '2', now())"<span>);
</span><span>253</span><span>$db</span>->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Currency', 'MODULE_PAYMENT_PAYPAL_CURRENCY', 'Selected Currency', 'Which currency should the order be sent to PayPal as? <br>NOTE: if an unsupported currency is sent to PayPal, it will be auto-converted to USD.', '6', '3', 'zen_cfg_select_option(array(\'Selected Currency\', \'Only USD\', \'Only AUD\', \'Only CAD\', \'Only EUR\', \'Only GBP\', \'Only CHF\', \'Only CZK\', \'Only DKK\', \'Only HKD\', \'Only HUF\', \'Only JPY\', \'Only NOK\', \'Only NZD\', \'Only PLN\', \'Only SEK\', \'Only SGD\', \'Only THB\', \'Only MXN\', \'Only ILS\', \'Only PHP\', \'Only TWD\', \'Only BRL\', \'Only MYR\'), ', now())"<span>);
</span><span>254</span><span>$db</span>->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_PAYPAL_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '4', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())"<span>);
</span><span>255</span><span>$db</span>->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Pending Notification Status', 'MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID', '" . DEFAULT_ORDERS_STATUS_ID .  "', 'Set the status of orders made with this payment module that are not yet completed to this value<br>(\'Pending\' recommended)', '6', '5', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())"<span>);
</span><span>256</span><span>$db</span>->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID', '2', 'Set the status of orders made with this payment module that have completed payment to this value<br>(\'Processing\' recommended)', '6', '6', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())"<span>);
</span><span>257</span><span>$db</span>->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Refund Order Status', 'MODULE_PAYMENT_PAYPAL_REFUND_ORDER_STATUS_ID', '1', 'Set the status of orders that have been refunded made with this payment module to this value<br>(\'Pending\' recommended)', '6', '7', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())"<span>);
</span><span>258</span><span>$db</span>->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PAYPAL_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '8', now())"<span>);
</span><span>259</span><span>$db</span>->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Address Override', 'MODULE_PAYMENT_PAYPAL_ADDRESS_OVERRIDE', '1', 'If set to 1, the customer shipping address selected in Zen Cart will override the customer PayPal-stored address book. The customer will see their address from Zen Cart, but will NOT be able to edit it at PayPal.<br>(An invalid address will be treated by PayPal as not-supplied, or override=0)<br>0=No Override<br>1=ZC address overrides PayPal address choices', '6', '18', 'zen_cfg_select_option(array(\'0\',\'1\'), ', now())"<span>);
</span><span>260</span><span>$db</span>->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Shipping Address Requirements?', 'MODULE_PAYMENT_PAYPAL_ADDRESS_REQUIRED', '2', 'The buyers shipping address. If set to 0 your customer will be prompted to include a shipping address. If set to 1 your customer will not be asked for a shipping address. If set to 2 your customer will be required to provide a shipping address.<br>0=Prompt<br>1=Not Asked<br>2=Required<br><br><strong>NOTE: If you allow your customers to enter their own shipping address, then MAKE SURE you PERSONALLY manually verify the PayPal confirmation details to verify the proper address when filling orders. When using Website Payments Standard (IPN), Zen Cart does not know if they choose an alternate shipping address at PayPal vs the one entered when placing an order.</strong>', '6', '20', 'zen_cfg_select_option(array(\'0\',\'1\',\'2\'), ', now())"<span>);
</span><span>261</span><span>$db</span>->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Detailed Line Items in Cart', 'MODULE_PAYMENT_PAYPAL_DETAILED_CART', 'No', 'Do you want to give line-item details to PayPal?  If set to True, line-item details will be shared with PayPal if no discounts apply and if tax and shipping are simple. Otherwise an Aggregate cart summary will be sent.', '6', '22', 'zen_cfg_select_option(array(\'No\',\'Yes\'), ', now())"<span>);
</span><span>262</span><span>$db</span>->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Page Style', 'MODULE_PAYMENT_PAYPAL_PAGE_STYLE', 'Primary', 'Sets the Custom Payment Page Style for payment pages. The value of page_style is the same as the Page Style Name you chose when adding or editing the page style. You can add and edit Custom Payment Page Styles from the Profile subtab of the My Account tab on the PayPal site. If you would like to always reference your Primary style, set this to \"primary.\" If you would like to reference the default PayPal page style, set this to \"paypal\".', '6', '25', now())"<span>);
</span><span>263</span><span>$db</span>->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Mode for PayPal web services<br><br>Default:<br><code>www.paypal.com/cgi-bin/webscr</code><br>or<br><code>www.paypal.com/us/cgi-bin/webscr</code><br>or for the UK,<br><code>www.paypal.com/uk/cgi-bin/webscr</code>', 'MODULE_PAYMENT_PAYPAL_HANDLER', 'www.paypal.com/cgi-bin/webscr', 'Choose the URL for PayPal live processing', '6', '73', '', now())"<span>);
</span><span>264</span><span>//</span><span> sandbox:  www.sandbox.paypal.com/cgi-bin/webscr</span><span>265</span><span>$db</span>->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function) values ('PDT Token (Payment Data Transfer)', 'MODULE_PAYMENT_PAYPAL_PDTTOKEN', '', 'Enter your PDT Token value here in order to activate transactions immediately after processing (if they pass validation).', '6', '25', now(), 'zen_cfg_password_display')"<span>);
</span><span>266</span><span>//</span><span> Paypal testing options here</span><span>267</span><span>$db</span>->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Debug Mode', 'MODULE_PAYMENT_PAYPAL_IPN_DEBUG', 'Off', 'Enable debug logging? <br>NOTE: This can REALLY clutter your email inbox!<br>Logging goes to the /includes/modules/payment/paypal/logs folder<br>Email goes to the store-owner address.<br>Email option NOT recommended.<br><strong>Leave OFF for normal operation.</strong>', '6', '71', 'zen_cfg_select_option(array(\'Off\',\'Log File\',\'Log and Email\'), ', now())"<span>);
</span><span>268</span><span>$db</span>->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Debug Email Address', 'MODULE_PAYMENT_PAYPAL_DEBUG_EMAIL_ADDRESS','".STORE_OWNER_EMAIL_ADDRESS."', 'The email address to use for PayPal debugging', '6', '72', now())"<span>);
</span><span>269</span><span>270</span><span>$this</span>->notify('NOTIFY_PAYMENT_PAYPAL_INSTALLED'<span>);
</span><span>271</span><span>  }
</span><span>272</span><span>/*</span><span>*
</span><span>273</span><span>   * Remove the module and all its settings
</span><span>274</span><span>    *
</span><span>275</span><span>*/</span><span>276</span><span>function</span><span> remove() {
</span><span>277</span><span>global</span><span>$db</span><span>;
</span><span>278</span><span>$db</span>->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key LIKE 'MODULE\_PAYMENT\_PAYPAL\_%'"<span>);
</span><span>279</span><span>$this</span>->notify('NOTIFY_PAYMENT_PAYPAL_UNINSTALLED'<span>);
</span><span>280</span><span>  }
</span><span>281</span><span>/*</span><span>*
</span><span>282</span><span>   * Internal list of configuration keys used for configuration of the module
</span><span>283</span><span>   *
</span><span>284</span><span>   * @return array
</span><span>285</span><span>*/</span><span>286</span><span>function</span><span> keys() {
</span><span>287</span><span>$keys_list</span> = <span>array</span><span>(
</span><span>288</span>                        'MODULE_PAYMENT_PAYPAL_STATUS',
<span>289</span>                        'MODULE_PAYMENT_PAYPAL_BUSINESS_ID',
<span>290</span>                        'MODULE_PAYMENT_PAYPAL_PDTTOKEN',
<span>291</span>                        'MODULE_PAYMENT_PAYPAL_CURRENCY',
<span>292</span>                        'MODULE_PAYMENT_PAYPAL_ZONE',
<span>293</span>                        'MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID',
<span>294</span>                        'MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID',
<span>295</span>                        'MODULE_PAYMENT_PAYPAL_REFUND_ORDER_STATUS_ID',
<span>296</span>                        'MODULE_PAYMENT_PAYPAL_SORT_ORDER',
<span>297</span>                        'MODULE_PAYMENT_PAYPAL_DETAILED_CART',
<span>298</span>                        'MODULE_PAYMENT_PAYPAL_ADDRESS_OVERRIDE' ,
<span>299</span>                        'MODULE_PAYMENT_PAYPAL_ADDRESS_REQUIRED' ,
<span>300</span>                        'MODULE_PAYMENT_PAYPAL_PAGE_STYLE' ,
<span>301</span>                        'MODULE_PAYMENT_PAYPAL_HANDLER',
<span>302</span>                        'MODULE_PAYMENT_PAYPAL_IPN_DEBUG',
<span>303</span><span>                        );
</span><span>304</span><span>305</span><span>//</span><span> Paypal testing/debug options go here:</span><span>306</span><span>if</span> (IS_ADMIN_FLAG === <span>true</span><span>) {
</span><span>307</span><span>if</span> (<span>isset</span>(<span>$_GET</span>['debug']) && <span>$_GET</span>['debug']=='on'<span>) {
</span><span>308</span><span>$keys_list</span>[]='MODULE_PAYMENT_PAYPAL_DEBUG_EMAIL_ADDRESS';  <span>/*</span><span> this defaults to store-owner-email-address </span><span>*/</span><span>309</span><span>      }
</span><span>310</span><span>    }
</span><span>311</span><span>return</span><span>$keys_list</span><span>;
</span><span>312</span><span>  }
</span><span>313</span><span>314</span><span>function</span> _getPDTresults(<span>$orderAmount</span>, <span>$my_currency</span>, <span>$pdtTX</span><span>) {
</span><span>315</span><span>global</span><span>$db</span><span>;
</span><span>316</span><span>$ipnData</span>  = ipn_postback('PDT', <span>$pdtTX</span><span>);
</span><span>317</span><span>$respdata</span> = <span>$ipnData</span>['info'<span>];
</span><span>318</span><span>319</span><span>//</span><span> parse the data</span><span>320</span><span>$lines</span> = <span>explode</span>("\n", <span>$respdata</span><span>);
</span><span>321</span><span>$this</span>->pdtData = <span>array</span><span>();
</span><span>322</span><span>for</span> (<span>$i</span>=1; <span>$i</span>count(<span>$lines</span>);<span>$i</span>++<span>){
</span><span>323</span><span>if</span> (!<span>strstr</span>(<span>$lines</span>[<span>$i</span>], "=")) <span>continue</span><span>;
</span><span>324</span><span>list</span>(<span>$key</span>,<span>$val</span>) = <span>explode</span>("=", <span>$lines</span>[<span>$i</span><span>]);
</span><span>325</span><span>$this</span>->pdtData[<span>urldecode</span>(<span>$key</span>)] = <span>urldecode</span>(<span>$val</span><span>);
</span><span>326</span><span>    }
</span><span>327</span><span>328</span><span>if</span> (<span>$this</span>->pdtData['txn_id'] == '' || <span>$this</span>->pdtData['payment_status'] == ''<span>) {
</span><span>329</span>       ipn_debug_email('PDT Returned INVALID Data. Must wait for IPN to process instead. ' . "\n" . <span>print_r</span>(<span>$this</span>->pdtData, <span>true</span><span>));
</span><span>330</span><span>return</span><span>FALSE</span><span>;
</span><span>331</span>     } <span>else</span><span> {
</span><span>332</span>       ipn_debug_email('PDT Returned Data ' . <span>print_r</span>(<span>$this</span>->pdtData, <span>true</span><span>));
</span><span>333</span><span>    }
</span><span>334</span><span>335</span><span>$_POST</span>['mc_gross'] = <span>$this</span>->pdtData['mc_gross'<span>];
</span><span>336</span><span>$_POST</span>['mc_currency'] = <span>$this</span>->pdtData['mc_currency'<span>];
</span><span>337</span><span>$_POST</span>['business'] = <span>$this</span>->pdtData['business'<span>];
</span><span>338</span><span>$_POST</span>['receiver_email'] = <span>$this</span>->pdtData['receiver_email'<span>];
</span><span>339</span><span>340</span><span>$PDTstatus</span> = (ipn_validate_transaction(<span>$respdata</span>, <span>$this</span>->pdtData, 'PDT') && valid_payment(<span>$orderAmount</span>, <span>$my_currency</span>, 'PDT') && <span>$this</span>->pdtData['payment_status'] == 'Completed'<span>);
</span><span>341</span><span>if</span> (<span>$this</span>->pdtData['payment_status'] != '' && <span>$this</span>->pdtData['payment_status'] != 'Completed'<span>) {
</span><span>342</span>       ipn_debug_email('PDT WARNING :: Order not marked as "Completed".  Check for Pending reasons or wait for IPN to complete.' . "\n" . '[payment_status] => ' . <span>$this</span>->pdtData['payment_status'] . "\n" . '[pending_reason] => ' . <span>$this</span>->pdtData['pending_reason'<span>]);
</span><span>343</span><span>    }
</span><span>344</span><span>345</span><span>$sql</span> = "<span>SELECT order_id, paypal_ipn_id, payment_status, txn_type, pending_reason
</span><span>346</span>                 FROM " . TABLE_PAYPAL . "
<span>347</span><span>                WHERE txn_id = :transactionID OR parent_txn_id = :transactionID
</span><span>348</span>                 ORDER BY order_id DESC  "<span>;
</span><span>349</span><span>$sql</span> = <span>$db</span>->bindVars(<span>$sql</span>, ':transactionID', <span>$this</span>->pdtData['txn_id'], 'string'<span>);
</span><span>350</span><span>$ipn_id</span> = <span>$db</span>->Execute(<span>$sql</span><span>);
</span><span>351</span><span>if</span> (<span>$ipn_id</span>->RecordCount() != 0<span>) {
</span><span>352</span>       ipn_debug_email('PDT WARNING :: Transaction already exists. Perhaps IPN already added it.  PDT processing ended.'<span>);
</span><span>353</span><span>$pdtTXN_is_unique</span> = <span>false</span><span>;
</span><span>354</span>     } <span>else</span><span> {
</span><span>355</span><span>$pdtTXN_is_unique</span> = <span>true</span><span>;
</span><span>356</span><span>    }
</span><span>357</span><span>358</span><span>$PDTstatus</span> = (<span>$pdtTXN_is_unique</span> && <span>$PDTstatus</span><span>);
</span><span>359</span><span>360</span><span>return</span><span>$PDTstatus</span><span>;
</span><span>361</span><span>  }
</span><span>362</span><span>363</span><span>364</span><span>function</span><span> tableCheckup() {
</span><span>365</span><span>global</span><span>$db</span>, <span>$sniffer</span><span>;
</span><span>366</span><span>$fieldOkay1</span> = (<span>method_exists</span>(<span>$sniffer</span>, 'field_type')) ? <span>$sniffer</span>->field_type(TABLE_PAYPAL, 'txn_id', 'varchar(20)', <span>true</span>) : -1<span>;
</span><span>367</span><span>$fieldOkay2</span> = (<span>$sniffer</span>->field_exists(TABLE_PAYPAL, 'module_name')) ? <span>true</span> : -1<span>;
</span><span>368</span><span>$fieldOkay3</span> = (<span>$sniffer</span>->field_exists(TABLE_PAYPAL, 'order_id')) ? <span>true</span> : -1<span>;
</span><span>369</span><span>370</span><span>if</span> (<span>$fieldOkay1</span> == -1<span>) {
</span><span>371</span><span>$sql</span> = "show fields from " .<span> TABLE_PAYPAL;
</span><span>372</span><span>$result</span> = <span>$db</span>->Execute(<span>$sql</span><span>);
</span><span>373</span><span>while</span> (!<span>$result</span>-><span>EOF) {
</span><span>374</span><span>if</span>  (<span>$result</span>->fields['Field'] == 'txn_id'<span>) {
</span><span>375</span><span>if</span>  (<span>$result</span>->fields['Type'] == 'varchar(20)'<span>) {
</span><span>376</span><span>$fieldOkay1</span> = <span>true</span>; <span>//</span><span> exists and matches required type, so skip to other checkup</span><span>377</span>           } <span>else</span><span> {
</span><span>378</span><span>$fieldOkay1</span> = <span>$result</span>->fields['Type']; <span>//</span><span> doesn't match, so return what it "is"</span><span>379</span><span>break</span><span>;
</span><span>380</span><span>          }
</span><span>381</span><span>        }
</span><span>382</span><span>$result</span>-><span>MoveNext();
</span><span>383</span><span>      }
</span><span>384</span><span>    }
</span><span>385</span><span>386</span><span>if</span> (<span>$fieldOkay1</span> !== <span>true</span><span>) {
</span><span>387</span><span>//</span><span> temporary fix to table structure for v1.3.7.x -- may remove in later release</span><span>388</span><span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE payment_type payment_type varchar(40) NOT NULL default ''"<span>);
</span><span>389</span><span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE txn_type txn_type varchar(40) NOT NULL default ''"<span>);
</span><span>390</span><span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE payment_status payment_status varchar(32) NOT NULL default ''"<span>);
</span><span>391</span><span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE reason_code reason_code varchar(40) default NULL"<span>);
</span><span>392</span><span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE pending_reason pending_reason varchar(32) default NULL"<span>);
</span><span>393</span><span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE invoice invoice varchar(128) default NULL"<span>);
</span><span>394</span><span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE payer_business_name payer_business_name varchar(128) default NULL"<span>);
</span><span>395</span><span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE address_name address_name varchar(64) default NULL"<span>);
</span><span>396</span><span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE address_street address_street varchar(254) default NULL"<span>);
</span><span>397</span><span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE address_city address_city varchar(120) default NULL"<span>);
</span><span>398</span><span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE address_state address_state varchar(120) default NULL"<span>);
</span><span>399</span><span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE payer_email payer_email varchar(128) NOT NULL default ''"<span>);
</span><span>400</span><span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE business business varchar(128) NOT NULL default ''"<span>);
</span><span>401</span><span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE receiver_email receiver_email varchar(128) NOT NULL default ''"<span>);
</span><span>402</span><span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE txn_id txn_id varchar(20) NOT NULL default ''"<span>);
</span><span>403</span><span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE parent_txn_id parent_txn_id varchar(20) default NULL"<span>);
</span><span>404</span><span>    }
</span><span>405</span><span>if</span> (<span>$fieldOkay2</span> !== <span>true</span><span>) {
</span><span>406</span><span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " ADD COLUMN module_name varchar(40) NOT NULL default '' after txn_type"<span>);
</span><span>407</span><span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " ADD COLUMN module_mode varchar(40) NOT NULL default '' after module_name"<span>);
</span><span>408</span><span>    }
</span><span>409</span><span>if</span> (<span>$fieldOkay3</span> !== <span>true</span><span>) {
</span><span>410</span><span>$db</span>->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE zen_order_id order_id int(11) NOT NULL default '0'"<span>);
</span><span>411</span><span>    }
</span><span>412</span><span>  }
</span><span>413</span><span>414</span><span>function</span> paynow_button(<span>$order_id</span><span>) {
</span><span>415</span><span>global</span><span>$db</span>, <span>$order</span>, <span>$currencies</span>, <span>$currency</span><span>;
</span><span>416</span><span>require_once</span>(DIR_WS_CLASSES . 'order.php'<span>);
</span><span>417</span><span>$order</span> = <span>new</span> order(<span>$order_id</span><span>);
</span><span>418</span><span>$options</span> = <span>array</span><span>();
</span><span>419</span><span>$optionsCore</span> = <span>array</span><span>();
</span><span>420</span><span>$optionsPhone</span> = <span>array</span><span>();
</span><span>421</span><span>$optionsShip</span> = <span>array</span><span>();
</span><span>422</span><span>$optionsLineItems</span> = <span>array</span><span>();
</span><span>423</span><span>$optionsAggregate</span> = <span>array</span><span>();
</span><span>424</span><span>$optionsTrans</span> = <span>array</span><span>();
</span><span>425</span><span>$buttonArray</span> = <span>array</span><span>();
</span><span>426</span><span>427</span><span>$this</span>->totalsum = <span>$order</span>->info['total'<span>];
</span><span>428</span><span>429</span><span>//</span><span> save the session stuff permanently in case paypal loses the session</span><span>430</span><span>$_SESSION</span>['ppipn_key_to_remove'] = <span>session_id</span><span>();
</span><span>431</span><span>$db</span>->Execute("delete from " . TABLE_PAYPAL_SESSION . " where session_id = '" . zen_db_input(<span>$_SESSION</span>['ppipn_key_to_remove']) . "'"<span>);
</span><span>432</span><span>433</span><span>$sql</span> = "insert into " . TABLE_PAYPAL_SESSION . "<span> (session_id, saved_session, expiry) values (
</span><span>434</span>             '" . zen_db_input(<span>$_SESSION</span>['ppipn_key_to_remove']) . "<span>',
</span><span>435</span>             '" . <span>base64_encode</span>(<span>serialize</span>(<span>$_SESSION</span>)) . "<span>',
</span><span>436</span>             '" . (<span>time</span>() + (1*60*60*24*2)) . "')"<span>;
</span><span>437</span><span>438</span><span>$db</span>->Execute(<span>$sql</span><span>);
</span><span>439</span><span>440</span><span>$my_currency</span> =<span> select_pp_currency();
</span><span>441</span><span>if</span>(!<span>empty</span>(<span>$order</span>->info['currency'<span>])){
</span><span>442</span><span>$my_currency</span>=<span>$order</span>->info['currency'<span>];
</span><span>443</span><span>      }
</span><span>444</span><span>$this</span>->transaction_currency = <span>$my_currency</span><span>;
</span><span>445</span><span>446</span><span>$this</span>->transaction_amount = (<span>$this</span>->totalsum * <span>$currencies</span>->get_value(<span>$my_currency</span><span>));
</span><span>447</span><span>448</span><span>$telephone</span> = <span>preg_replace</span>('/\D/', '', <span>$order</span>->customer['telephone'<span>]);
</span><span>449</span><span>if</span> (<span>$telephone</span> != ''<span>) {
</span><span>450</span><span>$optionsPhone</span>['H_PhoneNumber'] = <span>$telephone</span><span>;
</span><span>451</span><span>if</span> (<span>in_array</span>(<span>$order</span>->customer['country']['iso_code_2'], <span>array</span>('US','CA'<span>))) {
</span><span>452</span><span>$optionsPhone</span>['night_phone_a'] = <span>substr</span>(<span>$telephone</span>,0,3<span>);
</span><span>453</span><span>$optionsPhone</span>['night_phone_b'] = <span>substr</span>(<span>$telephone</span>,3,3<span>);
</span><span>454</span><span>$optionsPhone</span>['night_phone_c'] = <span>substr</span>(<span>$telephone</span>,6,4<span>);
</span><span>455</span><span>$optionsPhone</span>['day_phone_a'] = <span>substr</span>(<span>$telephone</span>,0,3<span>);
</span><span>456</span><span>$optionsPhone</span>['day_phone_b'] = <span>substr</span>(<span>$telephone</span>,3,3<span>);
</span><span>457</span><span>$optionsPhone</span>['day_phone_c'] = <span>substr</span>(<span>$telephone</span>,6,4<span>);
</span><span>458</span>           } <span>else</span><span> {
</span><span>459</span><span>$optionsPhone</span>['night_phone_b'] = <span>$telephone</span><span>;
</span><span>460</span><span>$optionsPhone</span>['day_phone_b'] = <span>$telephone</span><span>;
</span><span>461</span><span>          }
</span><span>462</span><span>      }
</span><span>463</span><span>464</span><span>$optionsCore</span> = <span>array</span><span>(
</span><span>465</span>           'lc' => US,
<span>466</span><span>//</span><span>'lc' => $order->customer['country']['iso_code_2'],</span><span>467</span>           'charset' => CHARSET,
<span>468</span>           'page_style' => MODULE_PAYMENT_PAYPAL_PAGE_STYLE,
<span>469</span>           'custom' => zen_session_name() . '=' . zen_session_id(),
<span>470</span>           'invoice' => <span>$order</span>->info['num'],
<span>471</span>           'business' => MODULE_PAYMENT_PAYPAL_BUSINESS_ID,
<span>472</span>           'return' => zen_href_link(FILENAME_CHECKOUT_PROCESS, 'referer=paypal', 'SSL'),
<span>473</span>           'cancel_return' => zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'),
<span>474</span>           'shopping_url' => zen_href_link(FILENAME_SHOPPING_CART, '', 'SSL'),
<span>475</span>           'notify_url' => zen_href_link('ipn_main_handler.php', '', 'SSL',<span>false</span>,<span>false</span>,<span>true</span>),
<span>476</span>           'redirect_cmd' => '_xclick','rm' => 2,'bn' => 'zencart','mrb' => 'R-6C7952342H795591R','pal' => '9E82WJBKKGPLQ',
<span>477</span><span>      );
</span><span>478</span><span>$optionsCust</span> = <span>array</span><span>(
</span><span>479</span>           'first_name' => replace_accents(<span>$order</span>->customer['firstname']),
<span>480</span>           'last_name' => replace_accents(<span>$order</span>->customer['lastname']),
<span>481</span>           'address1' => replace_accents(<span>$order</span>->customer['street_address']),
<span>482</span>           'city' => replace_accents(<span>$order</span>->customer['city']),
<span>483</span>           'state' => zen_get_zone_code(<span>$order</span>->customer['country']['id'], <span>$order</span>->customer['zone_id'], <span>$order</span>->customer['state']),
<span>484</span>           'zip' => <span>$order</span>->customer['postcode'],
<span>485</span>           'country' => <span>$order</span>->customer['country']['iso_code_2'],
<span>486</span>           'email' => <span>$order</span>->customer['email_address'],
<span>487</span><span>      );
</span><span>488</span><span>//</span><span> address line 2 is optional</span><span>489</span><span>if</span> (<span>$order</span>->customer['suburb'] != '') <span>$optionsCust</span>['address2'] = <span>$order</span>->customer['suburb'<span>];
</span><span>490</span><span>//</span><span> different format for Japanese address layout:</span><span>491</span><span>if</span> (<span>$order</span>->customer['country']['iso_code_2'] == 'JP') <span>$optionsCust</span>['zip'] = <span>substr</span>(<span>$order</span>->customer['postcode'], 0, 3) . '-' . <span>substr</span>(<span>$order</span>->customer['postcode'], 3<span>);
</span><span>492</span><span>if</span> (MODULE_PAYMENT_PAYPAL_ADDRESS_REQUIRED == 2<span>) {
</span><span>493</span><span>$optionsCust</span> = <span>array</span><span>(
</span><span>494</span>               'first_name' => replace_accents(<span>$order</span>->delivery['firstname'] != '' ? <span>$order</span>->delivery['firstname'] : <span>$order</span>->billing['firstname']),
<span>495</span>               'last_name' => replace_accents(<span>$order</span>->delivery['lastname'] != '' ? <span>$order</span>->delivery['lastname'] : <span>$order</span>->billing['lastname']),
<span>496</span>               'address1' => replace_accents(<span>$order</span>->delivery['street_address'] != '' ? <span>$order</span>->delivery['street_address'] : <span>$order</span>->billing['street_address']),
<span>497</span>               'city' => replace_accents(<span>$order</span>->delivery['city'] != '' ? <span>$order</span>->delivery['city'] : <span>$order</span>->billing['city']),
<span>498</span>               'state' => (<span>$order</span>->delivery['country']['id'] != '' ? zen_get_zone_code(<span>$order</span>->delivery['country']['id'], <span>$order</span>->delivery['zone_id'], <span>$order</span>->delivery['state']) : zen_get_zone_code(<span>$order</span>->billing['country']['id'], <span>$order</span>->billing['zone_id'], <span>$order</span>->billing['state'])),
<span>499</span>               'zip' => (<span>$order</span>->delivery['postcode'] != '' ? <span>$order</span>->delivery['postcode'] : <span>$order</span>->billing['postcode']),
<span>500</span>               'country' => (<span>$order</span>->delivery['country']['title'] != '' ? <span>$order</span>->delivery['country']['title'] : <span>$order</span>->billing['country']['title']),
<span>501</span>               'country_code' => (<span>$order</span>->delivery['country']['iso_code_2'] != '' ? <span>$order</span>->delivery['country']['iso_code_2'] : <span>$order</span>->billing['country']['iso_code_2']),
<span>502</span>               'email' => <span>$order</span>->customer['email_address'],
<span>503</span><span>          );
</span><span>504</span><span>if</span> (<span>$order</span>->delivery['suburb'] != '') <span>$optionsCust</span>['address2'] = <span>$order</span>->delivery['suburb'<span>];
</span><span>505</span><span>if</span> (<span>$order</span>->delivery['country']['iso_code_2'] == 'JP') <span>$optionsCust</span>['zip'] = <span>substr</span>(<span>$order</span>->delivery['postcode'], 0, 3) . '-' . <span>substr</span>(<span>$order</span>->delivery['postcode'], 3<span>);
</span><span>506</span><span>      }
</span><span>507</span><span>$optionsShip</span>['no_shipping'] =<span> MODULE_PAYMENT_PAYPAL_ADDRESS_REQUIRED;
</span><span>508</span><span>if</span> (MODULE_PAYMENT_PAYPAL_ADDRESS_OVERRIDE == '1') <span>$optionsShip</span>['address_override'] =<span> MODULE_PAYMENT_PAYPAL_ADDRESS_OVERRIDE;
</span><span>509</span><span>//</span><span> prepare cart contents details where possible</span><span>510</span><span>if</span> (MODULE_PAYMENT_PAYPAL_DETAILED_CART == 'Yes') <span>$optionsLineItems</span> =<span> ipn_getLineItemDetails();
</span><span>511</span><span>if</span> (<span>sizeof</span>(<span>$optionsLineItems</span>) > 0<span>) {
</span><span>512</span><span>$optionsLineItems</span>['cmd'] = '_cart'<span>;
</span><span>513</span><span>//</span><span>      $optionsLineItems['num_cart_items'] = sizeof($order->products);</span><span>514</span><span>if</span> (<span>isset</span>(<span>$optionsLineItems</span>['shipping'<span>])) {
</span><span>515</span><span>$optionsLineItems</span>['shipping_1'] = <span>$optionsLineItems</span>['shipping'<span>];
</span><span>516</span><span>unset</span>(<span>$optionsLineItems</span>['shipping'<span>]);
</span><span>517</span><span>          }
</span><span>518</span><span>unset</span>(<span>$optionsLineItems</span>['subtotal'<span>]);
</span><span>519</span><span>//</span><span> if line-item details couldn't be kept due to calculation mismatches or discounts etc, default to aggregate mode</span><span>520</span><span>if</span> (!<span>isset</span>(<span>$optionsLineItems</span>['item_name_1']) || <span>$optionsLineItems</span>['creditsExist'] == <span>TRUE</span>) <span>$optionsLineItems</span> = <span>array</span><span>();
</span><span>521</span><span>//</span><span>if ($optionsLineItems['amount'] != $this->transaction_amount) $optionsLineItems = array();
</span><span>522</span><span>          // debug:
</span><span>523</span><span>          //ipn_debug_email('Line Item Details (if blank, this means there was a data mismatch or credits applied, and thus bypassed): ' . "\n" . print_r($optionsLineItems, true));</span><span>524</span><span>unset</span>(<span>$optionsLineItems</span>['creditsExist'<span>]);
</span><span>525</span><span>      }
</span><span>526</span><span>$optionsAggregate</span> = <span>array</span><span>(
</span><span>527</span>           'cmd' => '_ext-enter',
<span>528</span>           'item_name' => MODULE_PAYMENT_PAYPAL_PURCHASE_DESCRIPTION_TITLE,
<span>529</span>           'item_number' => MODULE_PAYMENT_PAYPAL_PURCHASE_DESCRIPTION_ITEMNUM,
<span>530</span><span>//</span><span>'num_cart_items' => sizeof($order->products),</span><span>531</span>           'amount' => <span>number_format</span>(<span>$this</span>->transaction_amount, <span>$currencies</span>->get_decimal_places(<span>$my_currency</span>)),
<span>532</span>           'shipping' => '0.00',
<span>533</span><span>      );
</span><span>534</span><span>if</span> (MODULE_PAYMENT_PAYPAL_TAX_OVERRIDE == 'true') <span>$optionsAggregate</span>['tax'] = '0.00'<span>;
</span><span>535</span><span>if</span> (MODULE_PAYMENT_PAYPAL_TAX_OVERRIDE == 'true') <span>$optionsAggregate</span>['tax_cart'] = '0.00'<span>;
</span><span>536</span><span>$optionsTrans</span> = <span>array</span><span>(
</span><span>537</span>           'upload' => (int)(<span>sizeof</span>(<span>$order</span>->products) > 0),
<span>538</span>           'currency_code' => <span>$my_currency</span>,
<span>539</span><span>//</span><span>'paypal_order_id' => $paypal_order_id,
</span><span>540</span><span>          //'no_note' => '1',
</span><span>541</span><span>          //'invoice' => '',</span><span>542</span><span>      );
</span><span>543</span><span>544</span><span>//</span><span> if line-item info is invalid, use aggregate:</span><span>545</span><span>if</span> (<span>sizeof</span>(<span>$optionsLineItems</span>) > 0) <span>$optionsAggregate</span> = <span>$optionsLineItems</span><span>;
</span><span>546</span><span>547</span><span>//</span><span> prepare submission</span><span>548</span><span>$options</span> = <span>array_merge</span>(<span>$optionsCore</span>, <span>$optionsCust</span>, <span>$optionsPhone</span>, <span>$optionsShip</span>, <span>$optionsTrans</span>, <span>$optionsAggregate</span><span>);
</span><span>549</span><span>//</span><span>ipn_debug_email('Keys for submission: ' . print_r($options, true));
</span><span>550</span><span>551</span><span>      // build the button fields</span><span>552</span><span>foreach</span> (<span>$options</span><span>as</span><span>$name</span> => <span>$value</span><span>) {
</span><span>553</span><span>//</span><span> remove quotation marks</span><span>554</span><span>$value</span> = <span>str_replace</span>('"', '', <span>$value</span><span>);
</span><span>555</span><span>//</span><span> check for invalid chars</span><span>556</span><span>if</span> (<span>preg_match</span>('/[^a-zA-Z_0-9]/', <span>$name</span><span>)) {
</span><span>557</span>               ipn_debug_email('datacheck - ABORTING - preg_match found invalid submission key: ' . <span>$name</span> . ' (' . <span>$value</span> . ')'<span>);
</span><span>558</span><span>break</span><span>;
</span><span>559</span><span>          }
</span><span>560</span><span>//</span><span> do we need special handling for & and = symbols?
</span><span>561</span><span>          //if (strpos($value, '&') !== false || strpos($value, '=') !== false) $value = urlencode($value);</span><span>562</span><span>563</span><span>$bu</span>
Salin selepas log masuk
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn

Alat AI Hot

Undresser.AI Undress

Undresser.AI Undress

Apl berkuasa AI untuk mencipta foto bogel yang realistik

AI Clothes Remover

AI Clothes Remover

Alat AI dalam talian untuk mengeluarkan pakaian daripada foto.

Undress AI Tool

Undress AI Tool

Gambar buka pakaian secara percuma

Clothoff.io

Clothoff.io

Penyingkiran pakaian AI

AI Hentai Generator

AI Hentai Generator

Menjana ai hentai secara percuma.

Artikel Panas

R.E.P.O. Kristal tenaga dijelaskan dan apa yang mereka lakukan (kristal kuning)
2 minggu yang lalu By 尊渡假赌尊渡假赌尊渡假赌
Repo: Cara menghidupkan semula rakan sepasukan
1 bulan yang lalu By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: Cara mendapatkan biji gergasi
4 minggu yang lalu By 尊渡假赌尊渡假赌尊渡假赌

Alat panas

Notepad++7.3.1

Notepad++7.3.1

Editor kod yang mudah digunakan dan percuma

SublimeText3 versi Cina

SublimeText3 versi Cina

Versi Cina, sangat mudah digunakan

Hantar Studio 13.0.1

Hantar Studio 13.0.1

Persekitaran pembangunan bersepadu PHP yang berkuasa

Dreamweaver CS6

Dreamweaver CS6

Alat pembangunan web visual

SublimeText3 versi Mac

SublimeText3 versi Mac

Perisian penyuntingan kod peringkat Tuhan (SublimeText3)

Apakah perbezaan antara Huawei GT3 Pro dan GT4? Apakah perbezaan antara Huawei GT3 Pro dan GT4? Dec 29, 2023 pm 02:27 PM

Ramai pengguna akan memilih jenama Huawei apabila memilih jam tangan pintar Antaranya, Huawei GT3pro dan GT4 adalah pilihan yang sangat popular. Apakah perbezaan antara Huawei GT3pro dan GT4? 1. Rupa GT4: 46mm dan 41mm, bahan cermin kaca + badan keluli tahan karat + cangkang belakang gentian resolusi tinggi. GT3pro: 46.6mm dan 42.9mm, bahannya ialah kaca nilam + badan titanium/badan seramik + cangkerang belakang seramik 2. GT4 yang sihat: Menggunakan algoritma Huawei Truseen5.5+ terkini, hasilnya akan lebih tepat. GT3pro: Penambahan elektrokardiogram ECG dan saluran darah serta keselamatan

Betulkan: Alat snipping tidak berfungsi dalam Windows 11 Betulkan: Alat snipping tidak berfungsi dalam Windows 11 Aug 24, 2023 am 09:48 AM

Mengapa Alat Snipping Tidak Berfungsi pada Windows 11 Memahami punca masalah boleh membantu mencari penyelesaian yang betul. Berikut ialah sebab utama Alat Snipping mungkin tidak berfungsi dengan betul: Focus Assistant dihidupkan: Ini menghalang Snipping Tool daripada dibuka. Aplikasi rosak: Jika alat snipping ranap semasa pelancaran, ia mungkin rosak. Pemacu grafik lapuk: Pemacu yang tidak serasi mungkin mengganggu alat snipping. Gangguan daripada aplikasi lain: Aplikasi lain yang sedang berjalan mungkin bercanggah dengan Alat Snipping. Sijil telah tamat tempoh: Ralat semasa proses naik taraf boleh menyebabkan penyelesaian mudah ini sesuai untuk kebanyakan pengguna dan tidak memerlukan sebarang pengetahuan teknikal khusus. 1. Kemas kini apl Windows dan Microsoft Store

Cara Membetulkan Ralat Tidak Dapat Menyambung ke App Store pada iPhone Cara Membetulkan Ralat Tidak Dapat Menyambung ke App Store pada iPhone Jul 29, 2023 am 08:22 AM

Bahagian 1: Langkah Penyelesaian Masalah Awal Menyemak Status Sistem Apple: Sebelum menyelidiki penyelesaian yang rumit, mari kita mulakan dengan asas. Masalahnya mungkin tidak terletak pada peranti anda; Lawati halaman Status Sistem Apple untuk melihat sama ada AppStore berfungsi dengan betul. Jika terdapat masalah, anda hanya boleh menunggu Apple membetulkannya. Semak sambungan Internet anda: Pastikan anda mempunyai sambungan internet yang stabil kerana isu "Tidak dapat menyambung ke AppStore" kadangkala boleh dikaitkan dengan sambungan yang lemah. Cuba tukar antara Wi-Fi dan data mudah alih atau tetapkan semula tetapan rangkaian (Umum > Tetapkan Semula > Tetapkan Semula Tetapan Rangkaian > Tetapan). Kemas kini versi iOS anda:

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code

Adakah watch4pro lebih baik atau gt? Adakah watch4pro lebih baik atau gt? Sep 26, 2023 pm 02:45 PM

Watch4pro dan gt masing-masing mempunyai ciri yang berbeza dan senario yang berkenaan Jika anda menumpukan pada fungsi yang komprehensif, prestasi tinggi dan penampilan yang bergaya, dan sanggup menanggung harga yang lebih tinggi, maka Watch 4 Pro mungkin lebih sesuai. Jika anda tidak mempunyai keperluan fungsi yang tinggi dan memberi lebih perhatian kepada hayat bateri dan harga yang berpatutan, maka siri GT mungkin lebih sesuai. Pilihan terakhir harus diputuskan berdasarkan keperluan peribadi, belanjawan dan keutamaan Adalah disyorkan untuk mempertimbangkan dengan teliti keperluan anda sendiri sebelum membeli dan merujuk kepada ulasan dan perbandingan pelbagai produk untuk membuat pilihan yang lebih termaklum.

Cara mengoptimumkan hayat bateri iPad dengan iPadOS 17.4 Cara mengoptimumkan hayat bateri iPad dengan iPadOS 17.4 Mar 21, 2024 pm 10:31 PM

Cara Mengoptimumkan Hayat Bateri iPad dengan iPadOS 17.4 Memanjangkan hayat bateri adalah kunci kepada pengalaman peranti mudah alih dan iPad ialah contoh yang baik. Jika anda merasakan bateri iPad anda kehabisan terlalu cepat, jangan risau, terdapat beberapa helah dan tweak dalam iPadOS 17.4 yang boleh memanjangkan masa penggunaan peranti anda dengan ketara. Matlamat panduan mendalam ini bukan hanya untuk memberikan maklumat, tetapi untuk mengubah cara anda menggunakan iPad anda, meningkatkan pengurusan bateri anda secara keseluruhan dan memastikan anda boleh bergantung pada peranti anda lebih lama tanpa perlu mengecasnya. Dengan mengamalkan amalan yang digariskan di sini, anda mengambil langkah ke arah penggunaan teknologi yang lebih cekap dan penuh perhatian yang disesuaikan dengan keperluan dan corak penggunaan individu anda. Kenal pasti pengguna tenaga utama

Microsoft melancarkan binaan Windows 11 23H2 ke saluran Pratonton Keluaran dengan Copilot Microsoft melancarkan binaan Windows 11 23H2 ke saluran Pratonton Keluaran dengan Copilot Sep 28, 2023 pm 07:17 PM

Semua orang menantikan keluaran Windows 1123H2 hari ini. Malah, Microsoft baru sahaja melancarkan kemas kini kepada pratonton keluaran, iaitu saluran terdekat sebelum peringkat keluaran rasmi. Dikenali sebagai Build 22631, Microsoft berkata mereka sedang melancarkan aplikasi sembang penjenamaan semula baharu, pautan telefon dan memainkan bersama-sama widget yang telah diuji pada saluran dalaman lain sejak beberapa bulan lalu. "Kemas kini baharu ini akan mempunyai cawangan servis dan asas kod yang sama seperti Windows 11 versi 22H2 dan akan terkumpul dengan semua ciri yang baru diumumkan, termasuk Copilot dalam Windows (pratonton)," janji Microsoft. Pegawai Redmond selanjutnya

Guan Zeyuanjiang Shuying mengalami Huawei MateBook GT 14: gabungan teknologi dan seni yang sempurna Guan Zeyuanjiang Shuying mengalami Huawei MateBook GT 14: gabungan teknologi dan seni yang sempurna Aug 10, 2024 pm 09:51 PM

Pada 8 Ogos, Huawei Terminal secara rasmi melancarkan Huawei MateBook GT14 "Super Starlight Show". Pelakon terkenal Jiang Shuying dan pengulas rasmi Liga Profesional League of Legends Guan Zeyuan adalah tetamu di bilik siaran langsung untuk merasai sendiri Huawei MateBook GT14, komputer riba terbaru Huawei. Semasa siaran langsung, Jiang Shuying dan Guan Zeyuan penuh dengan pujian untuk Huawei MateBook GT14. CNMO menyedari bahawa semasa siaran langsung, Jiang Shuying, Guan Zeyuan dan presiden barisan produk PC Huawei menyaksikan pembongkaran Huawei MateBook GT14. Dapat dilihat reka bentuk dalaman Huawei MateBook GT14 sangat kemas dan mengamalkan reka bentuk papan induk berketumpatan tinggi Papan induk juga sebahagiannya tenggelam untuk menjarakkan dirinya daripada papan kekunci. yang ini

See all articles