PluginProbe
Welcart e-Commerce / 2.12.4
Welcart e-Commerce v2.12.4
2.12.4 2.12.3 2.11.35 2.12.2 2.12.1 2.11.34 2.11.33 2.11.32 2.11.31 2.11.30 1.3.16 1.3.17 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 All 292 releases
← All changes | includes/purchase_button.php +674 -1002 1.3.162.12.4 View file →
@@ -1,1002 +1,674 @@
1 -<?php
2 -if(isset($this))
3 - $usces = &$this;
4 -
5 -$payments = usces_get_payments_by_name($usces_entries['order']['payment_name']);
6 -$acting_flag = '';
7 -$rand = sprintf('%010d', mt_rand(1, 9999999999));
8 -$cart = $usces->cart->get_cart();
9 -
10 -//$purchase_disabled = ( '' != $usces->error_message ) ? ' disabled="true"' : '';
11 -$purchase_disabled = '';
12 -
13 -if( 'acting' != substr($payments['settlement'], 0, 6) || 0 == $usces_entries['order']['total_full_price'] ){
14 - $html .= '<form id="purchase_form" action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
15 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.apply_filters('usces_filter_confirm_prebutton_value', __('Back to payment method page.', 'usces')).'"' . apply_filters('usces_filter_confirm_prebutton', NULL) . ' />
16 - <input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="'.__('Checkout', 'usces').'"' . apply_filters('usces_filter_confirm_nextbutton', NULL) . $purchase_disabled . ' /></div>';
17 - $html = apply_filters('usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled);
18 - $html .= '</form>';
19 -}else{
20 - $send_item_code = apply_filters('usces_filter_settlement_item_code', $usces->getItemCode($cart[0]['post_id']));
21 - $send_item_name = apply_filters('usces_filter_settlement_item_name', $usces->getItemName($cart[0]['post_id']));
22 -
23 - $scheme = ( $usces->use_ssl ) ? 'https://' : 'http://';
24 -
25 - $acting_flag = ( 'acting' == $payments['settlement'] ) ? $payments['module'] : $payments['settlement'];
26 - switch( $acting_flag ){
27 -
28 - case 'paypal.php':
29 - require_once($usces->options['settlement_path'] . "paypal.php");
30 -//20110208ysk start
31 - $lc = ( isset($usces->options['system']['currency']) && !empty($usces->options['system']['currency']) ) ? $usces->options['system']['currency'] : '';
32 - $currency_code = $usces->get_currency_code();
33 - global $usces_settings;
34 - $country_num = $usces_settings['country_num'][$lc];
35 - $tel = ltrim(str_replace('-', '', $usces_entries['customer']['tel']), '0');
36 - $html .= '<form id="purchase_form" action="https://' . $usces_paypal_url . '/cgi-bin/webscr" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
37 - <input type="hidden" name="cmd" value="_xclick">
38 - <input type="hidden" name="business" value="' . esc_attr($usces_paypal_business) . '">
39 - <input type="hidden" name="custom" value="' . $usces->get_uscesid(false) . '">
40 - <input type="hidden" name="lc" value="'.$lc.'">
41 - <input type="hidden" name="charset" value="UTF-8">
42 - <input type="hidden" name="first_name" value="'.esc_attr($usces_entries['customer']['name2']).'">
43 - <input type="hidden" name="last_name" value="'.esc_attr($usces_entries['customer']['name1']).'">
44 - <input type="hidden" name="address1" value="'.esc_attr($usces_entries['customer']['address2']).'">
45 - <input type="hidden" name="address2" value="'.esc_attr($usces_entries['customer']['address3']).'">
46 - <input type="hidden" name="city" value="'.esc_attr($usces_entries['customer']['address1']).'">
47 - <input type="hidden" name="state" value="'.esc_attr($usces_entries['customer']['pref']).'">
48 - <input type="hidden" name="zip" value="'.esc_attr($usces_entries['customer']['zipcode']).'">
49 - <input type="hidden" name="night_phone_a" value="'.esc_attr($country_num).'">
50 - <input type="hidden" name="night_phone_b" value="'.esc_attr($tel).'">
51 - <input type="hidden" name="night_phone_c" value="">';
52 -//20110208ysk end
53 - if( 1 < count($cart) ) {
54 - $html .= '<input type="hidden" name="item_name" value="' . esc_attr($send_item_name) . ' ' . __('Others', 'usces') . '">';
55 - }else{
56 - $html .= '<input type="hidden" name="item_name" value="' . esc_attr($send_item_name) . '">';
57 - }
58 - $html .= '<input type="hidden" name="item_number" value="">
59 - <input type="hidden" name="amount" value="' . usces_crform($usces_entries['order']['total_full_price'], false, false, 'return', false) . '">';
60 -//20110208ysk start
61 - //if( USCES_JP ){
62 - //$html .= '<input type="hidden" name="currency_code" value="JPY">';
63 - $html .= '<input type="hidden" name="currency_code" value="'.$currency_code.'">';
64 - //}
65 - $html .= '<input type="hidden" name="no_note" value="1">';
66 -//20110208ysk end
67 - $html .= '<input type="hidden" name="return" value="' . apply_filters('usces_paypal_return_url', (USCES_CART_URL . $usces->delim . 'acting=paypal&acting_return=1') ) . '">
68 - <input type="hidden" name="cancel_return" value="' . USCES_CART_URL . $usces->delim . 'confirm=1">
69 - <input type="hidden" name="notify_url" value="' . USCES_PAYPAL_NOTIFY_URL . '">
70 - <input type="hidden" name="button_subtype" value="products">
71 - <input type="hidden" name="tax_rate" value="0.000">
72 - <input type="hidden" name="shipping" value="0">
73 - <input type="hidden" name="bn" value="uscons_cart_WPS_JP">
74 - <div class="send"><input type="image" src="https://www.paypal.com/' . ( USCES_JP ? 'ja_JP/JP' : 'en_US' ) . '/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal"' . apply_filters('usces_filter_confirm_nextbutton', NULL) . $purchase_disabled . ' />
75 - <img alt="" border="0" src="https://www.paypal.com/' . ( USCES_JP ? 'ja_JP' : 'en_US' ) . '/i/scr/pixel.gif" width="1" height="1"></div>';
76 - $html = apply_filters('usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled);
77 - $html .= '</form>';
78 - $html .= '<form action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
79 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"' . apply_filters('usces_filter_confirm_prebutton', NULL) . ' /></div>';
80 - $html = apply_filters('usces_filter_confirm_inform_back', $html);
81 - $html .= '</form>';
82 - break;
83 -
84 - case 'epsilon.php':
85 - $member = $usces->get_member();
86 - $memid = empty($member['ID']) ? 99999999 : $member['ID'];
87 - $html .= '<form id="purchase_form" action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
88 - <input type="hidden" name="user_id" value="' . $memid . '">
89 - <input type="hidden" name="user_name" value="' . esc_attr($usces_entries['customer']['name1'] . ' ' . $usces_entries['customer']['name2']) . '">
90 - <input type="hidden" name="user_mail_add" value="' . esc_attr($usces_entries['customer']['mailaddress1']) . '">';
91 - if( 1 < count($cart) ) {
92 - $html .= '<input type="hidden" name="item_code" value="99999999">
93 - <input type="hidden" name="item_name" value="' . esc_attr(mb_substr($send_item_name, 0, 25, 'UTF-8')) . ' ' . __('Others', 'usces') . '">';
94 - }else{
95 - $html .= '<input type="hidden" name="item_code" value="' . esc_attr($send_item_code) . '">
96 - <input type="hidden" name="item_name" value="' . esc_attr(mb_substr($send_item_name, 0, 32, 'UTF-8')) . '">';
97 - }
98 - $html .= '<input type="hidden" name="item_price" value="' . usces_crform($usces_entries['order']['total_full_price'], false, false, 'return', false) . '">
99 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"' . apply_filters('usces_filter_confirm_prebutton', NULL) . ' />
100 - <input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="'.__('Checkout', 'usces').'"' . apply_filters('usces_filter_confirm_nextbutton', NULL) . $purchase_disabled . ' /></div>';
101 - $html = apply_filters('usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled);
102 - $html .= '</form>';
103 - break;
104 -
105 - case 'acting_zeus_card':
106 - $acting_opts = $usces->options['acting_settings']['zeus'];
107 - $usces->save_order_acting_data($rand);
108 - $html .= '<form id="purchase_form" action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">';
109 - $member = $usces->get_member();
110 - $pcid = $usces->get_member_meta_value('zeus_pcid', $member['ID']);
111 - $securecode = isset($_POST['securecode']) ? $_POST['securecode'] : '';
112 - //if( 2 == $acting_opts['security'] && 'on' == $acting_opts['quickcharge'] && $pcid == '8888888888888888' && $usces->is_member_logged_in() ){
113 - if( 'on' == $acting_opts['quickcharge'] && $pcid == '8888888888888888' && $usces->is_member_logged_in() ){
114 - $html .= '<input type="hidden" name="cardnumber" value="8888888888888888">';
115 - //$html .= '<input type="hidden" name="securecode" value="' . esc_attr($_POST['securecode']) . '">';//20121119ysk 0000620
116 - $html .= '<input type="hidden" name="securecode" value="' . esc_attr($securecode) . '">';
117 - $html .= '<input type="hidden" name="expyy" value="' . esc_attr($_POST['expyy']) . '">
118 - <input type="hidden" name="expmm" value="' . esc_attr($_POST['expmm']) . '">';
119 - }else{
120 - $html .= '<input type="hidden" name="cardnumber" value="' . esc_attr($_POST['cnum1']) . '">';
121 - if( 1 == $acting_opts['security'] ){
122 - $html .= '<input type="hidden" name="securecode" value="' . esc_attr($securecode) . '">';
123 - }
124 - $html .= '<input type="hidden" name="expyy" value="' . esc_attr($_POST['expyy']) . '">
125 - <input type="hidden" name="expmm" value="' . esc_attr($_POST['expmm']) . '">';
126 - }
127 - $html .= '<input type="hidden" name="telno" value="' . esc_attr(str_replace('-', '', $usces_entries['customer']['tel'])) . '">
128 - <input type="hidden" name="email" value="' . esc_attr($usces_entries['customer']['mailaddress1']) . '">
129 - <input type="hidden" name="sendid" value="' . $member['ID'] . '">
130 - <input type="hidden" name="username" value="' . esc_attr($_POST['username_card']) . '">
131 - <input type="hidden" name="money" value="' . usces_crform($usces_entries['order']['total_full_price'], false, false, 'return', false) . '">
132 - <input type="hidden" name="sendpoint" value="' . $rand . '">
133 - <input type="hidden" name="printord" value="yes">';
134 - if( isset($usces_entries['order']['cbrand']) && isset($usces_entries['order']['howpay']) && WCUtils::is_zero($usces_entries['order']['howpay']) ){
135 - $html .= '<input type="hidden" name="howpay" value="' . $usces_entries['order']['howpay'] . '">';
136 - $html .= '<input type="hidden" name="cbrand" value="' . $usces_entries['order']['cbrand'] . '">';
137 - $div_name = 'div_' . $usces_entries['order']['cbrand'];
138 - $html .= '<input type="hidden" name="div" value="' . $usces_entries['order'][$div_name] . '">';
139 - $html .= '<input type="hidden" name="div_1" value="' . $usces_entries['order']['div_1'] . '">';
140 - $html .= '<input type="hidden" name="div_2" value="' . $usces_entries['order']['div_2'] . '">';
141 - $html .= '<input type="hidden" name="div_3" value="' . $usces_entries['order']['div_3'] . '">';
142 - }
143 - $html .= '
144 - <input type="hidden" name="cnum1" value="' . esc_attr($_POST['cnum1']) . '">
145 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"' . apply_filters('usces_filter_confirm_prebutton', NULL) . ' />
146 - <input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="'.__('Checkout', 'usces').'"' . apply_filters('usces_filter_confirm_nextbutton', NULL) . $purchase_disabled . ' /></div>
147 - <input type="hidden" name="username_card" value="' . esc_attr($_POST['username_card']) . '">';
148 - $html = apply_filters('usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled);
149 - $html .= '</form>';
150 - break;
151 -
152 - case 'acting_zeus_conv':
153 - $member = $usces->get_member();
154 - $acting_opts = $usces->options['acting_settings']['zeus'];
155 - $usces->save_order_acting_data($rand);
156 - $html .= '<form id="purchase_form" action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
157 - <input type="hidden" name="act" value="secure_order">
158 - <input type="hidden" name="money" value="' . usces_crform($usces_entries['order']['total_full_price'], false, false, 'return', false) . '">
159 - <input type="hidden" name="username" value="' . esc_attr($_POST['username_conv']) . '">
160 - <input type="hidden" name="telno" value="' . esc_attr(str_replace('-', '', $usces_entries['customer']['tel'])) . '">
161 - <input type="hidden" name="email" value="' . esc_attr($usces_entries['customer']['mailaddress1']) . '">
162 - <input type="hidden" name="pay_cvs" value="' . $usces_entries['order']['pay_cvs'] . '">
163 - <input type="hidden" name="sendid" value="' . $member['ID'] . '">
164 - <input type="hidden" name="sendpoint" value="' . $rand . '">';
165 - $html .= '
166 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"' . apply_filters('usces_filter_confirm_prebutton', NULL) . ' />
167 - <input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="'.__('Checkout', 'usces').'"' . apply_filters('usces_filter_confirm_nextbutton', NULL) . $purchase_disabled . ' /></div>
168 - <input type="hidden" name="username_conv" value="' . esc_attr($_POST['username_conv']) . '">';
169 - $html = apply_filters('usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled);
170 - $html .= '</form>';
171 - break;
172 -
173 - case 'acting_zeus_bank':
174 - $member = $usces->get_member();
175 - $acting_opts = $usces->options['acting_settings']['zeus'];
176 - $usces->save_order_acting_data($rand);
177 - $html .= '<form id="purchase_form" action="' . $acting_opts['bank_url'] . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}" accept-charset="Shift_JIS">
178 - <input type="hidden" name="clientip" value="' . esc_attr($acting_opts['clientip_bank']) . '">
179 - <input type="hidden" name="act" value="order">
180 - <input type="hidden" name="money" value="' . usces_crform($usces_entries['order']['total_full_price'], false, false, 'return', false) . '">';
181 - if( isset($acting_opts['bank_ope']) && 'test' == $acting_opts['bank_ope'] ) {
182 - $html .= '<input type="hidden" name="username" value="' . esc_attr(trim($usces_entries['customer']['name3']) . trim($usces_entries['customer']['name4']) . '_' . $acting_opts['testid_bank']) . '">';
183 - $html .= '<input type="hidden" name="telno" value="99999999999">';
184 - }else{
185 - $html .= '<input type="hidden" name="username" value="' . esc_attr(trim($usces_entries['customer']['name3']) . trim($usces_entries['customer']['name4'])) . '">';
186 - $html .= '<input type="hidden" name="telno" value="' . esc_attr(str_replace('-', '', $usces_entries['customer']['tel'])) . '">';
187 - }
188 - $html .= '<input type="hidden" name="email" value="' . esc_attr($usces_entries['customer']['mailaddress1']) . '">
189 - <input type="hidden" name="sendid" value="' . $member['ID'] . '">
190 - <input type="hidden" name="sendpoint" value="' . $rand . '">
191 - <input type="hidden" name="siteurl" value="' . get_option('home') . '">
192 - <input type="hidden" name="sitestr" value="「' . esc_attr(get_option('blogname')) . '」トップページへ">
193 - ';
194 - $html .= '<input type="hidden" name="dummy" value="&#65533;" />';
195 - $html .= '<div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="'.__('Checkout', 'usces').'"' . apply_filters('usces_filter_confirm_nextbutton', ' onClick="document.charset=\'Shift_JIS\';"') . $purchase_disabled . ' /></div>';
196 - $html = apply_filters('usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled);
197 - $html .= '</form>';
198 - $html .= '<form action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
199 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"' . apply_filters('usces_filter_confirm_prebutton', NULL) . ' /></div>';
200 - $html = apply_filters('usces_filter_confirm_inform_back', $html);
201 - $html .= '</form>'."\n";
202 - break;
203 -
204 - case 'acting_remise_card':
205 - $charging_type = $usces->getItemChargingType($cart[0]['post_id'], $cart);
206 - $frequency = $usces->getItemFrequency($cart[0]['post_id']);
207 - $chargingday = $usces->getItemChargingDay($cart[0]['post_id']);
208 - $acting_opts = $usces->options['acting_settings']['remise'];
209 - $usces->save_order_acting_data($rand);
210 - $member = $usces->get_member();
211 - $send_url = ('public' == $acting_opts['card_pc_ope']) ? $acting_opts['send_url_pc'] : $acting_opts['send_url_pc_test'];
212 - $html .= '<form id="purchase_form" name="purchase_form" action="' . $send_url . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}" accept-charset="Shift_JIS">
213 - <input type="hidden" name="SHOPCO" value="' . esc_attr($acting_opts['SHOPCO']) . '" />
214 - <input type="hidden" name="HOSTID" value="' . esc_attr($acting_opts['HOSTID']) . '" />
215 - <input type="hidden" name="REMARKS3" value="' . $acting_opts['REMARKS3'] . '" />
216 - <input type="hidden" name="S_TORIHIKI_NO" value="' . $rand . '" />
217 - <input type="hidden" name="JOB" value="' . apply_filters('usces_filter_remise_card_job', $acting_opts['card_jb']) . '" />
218 - <input type="hidden" name="MAIL" value="' . esc_attr($usces_entries['customer']['mailaddress1']) . '" />
219 - <input type="hidden" name="ITEM" value="' . apply_filters('usces_filter_remise_card_item', '0000120') . '" />
220 - <input type="hidden" name="TOTAL" value="' . usces_crform($usces_entries['order']['total_full_price'], false, false, 'return', false) . '" />
221 - <input type="hidden" name="AMOUNT" value="' . usces_crform($usces_entries['order']['total_full_price'], false, false, 'return', false) . '" />
222 - <input type="hidden" name="RETURL" value="' . USCES_CART_URL . $usces->delim . 'acting=remise_card&acting_return=1" />
223 - <input type="hidden" name="NG_RETURL" value="' . USCES_CART_URL . $usces->delim . 'acting=remise_card&acting_return=0" />
224 - <input type="hidden" name="EXITURL" value="' . USCES_CART_URL . $usces->delim . 'confirm=1" />
225 - ';
226 - if( 'on' == $acting_opts['payquick'] && $usces->is_member_logged_in() ){
227 - $pcid = $usces->get_member_meta_value('remise_pcid', $member['ID']);
228 - $html .= '<input type="hidden" name="PAYQUICK" value="1">';
229 - if( $pcid != NULL )
230 - $html .= '<input type="hidden" name="PAYQUICKID" value="' . $pcid . '">';
231 - }
232 - if( 'on' == $acting_opts['howpay'] && isset($usces_entries['order']['div']) && '0' !== $usces_entries['order']['div'] && 'continue' != $charging_type ){
233 - $html .= '<input type="hidden" name="div" value="' . $usces_entries['order']['div'] . '">';
234 - switch( $usces_entries['order']['div'] ){
235 - case '1':
236 - $html .= '<input type="hidden" name="METHOD" value="61">';
237 - $html .= '<input type="hidden" name="PTIMES" value="2">';
238 - break;
239 - case '2':
240 - $html .= '<input type="hidden" name="METHOD" value="80">';
241 - break;
242 - }
243 - }else{
244 - $html .= '<input type="hidden" name="div" value="0">';
245 - $html .= '<input type="hidden" name="METHOD" value="10">';
246 - }
247 - if( 'continue' == $charging_type ){
248 - $nextdate = current_time('mysql');
249 - $html .= '
250 - <input type="hidden" name="AUTOCHARGE" value="1">
251 - <input type="hidden" name="AC_S_KAIIN_NO" value="' . $member['ID'] . '">
252 - <input type="hidden" name="AC_NAME" value="' . esc_attr($usces_entries['customer']['name1'].$usces_entries['customer']['name2']) . '">
253 - <input type="hidden" name="AC_KANA" value="' . esc_attr($usces_entries['customer']['name3'].$usces_entries['customer']['name4']) . '">
254 - <input type="hidden" name="AC_TEL" value="' . esc_attr(str_replace('-', '', mb_convert_kana($usces_entries['customer']['tel'], 'a', 'UTF-8'))) . '">
255 - <input type="hidden" name="AC_AMOUNT" value="' . $usces_entries['order']['total_full_price'] . '">
256 - <input type="hidden" name="AC_TOTAL" value="' . $usces_entries['order']['total_full_price'] . '">
257 - <input type="hidden" name="AC_NEXT_DATE" value="' . date('Ymd', dlseller_first_charging($cart[0]['post_id'], 'time')) . '">
258 - <input type="hidden" name="AC_INTERVAL" value="' . $frequency . 'M">
259 - ';
260 - }
261 - $html .= '<input type="hidden" name="dummy" value="&#65533;" />';
262 - $html .= '<div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="'.__('Checkout', 'usces').'"' . apply_filters('usces_filter_confirm_nextbutton', ' onClick="document.charset=\'Shift_JIS\';"') . $purchase_disabled . ' /></div>';
263 - $html = apply_filters('usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled);
264 - $html .= '</form>';
265 - $html .= '<form action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
266 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"' . apply_filters('usces_filter_confirm_prebutton', NULL) . ' /></div>';
267 - $html = apply_filters('usces_filter_confirm_inform_back', $html);
268 - $html .= '</form>'."\n";
269 - break;
270 -
271 - case 'acting_remise_conv':
272 - if( function_exists('mb_strlen') ){
273 - $biko = ( 22 < mb_strlen($usces_entries['order']['note'])) ? (mb_substr($usces_entries['order']['note'], 0, 22).'...') : $usces_entries['order']['note'];
274 - }else{
275 - $biko = ( 44 < strlen($usces_entries['order']['note'])) ? (substr($usces_entries['order']['note'], 0, 44).'...') : $usces_entries['order']['note'];
276 - }
277 - $datestr = get_date_from_gmt(gmdate('Y-m-d H:i:s', time()));
278 - $acting_opts = $usces->options['acting_settings']['remise'];
279 - $usces->save_order_acting_data($rand);
280 - $send_url = ('public' == $acting_opts['conv_pc_ope']) ? $acting_opts['send_url_cvs_pc'] : $acting_opts['send_url_cvs_pc_test'];
281 - $kana1 = ( !empty($usces_entries['customer']['name3']) ) ? $usces_entries['customer']['name3'] : '';
282 - if( !empty($kana1) ) {
283 - $kana1 = str_replace( "・", "", str_replace( " ", "", mb_convert_kana( $kana1, "KVC" ) ) );
284 - $kana1 = mb_substr( $kana1, 0, 20 );
285 - if( !mb_ereg( "^[ァ-ヶー]+$", $kana1 ) ) $kana1 = '';
286 - }
287 - $kana2 = ( !empty($usces_entries['customer']['name4']) ) ? $usces_entries['customer']['name4'] : '';
288 - if( !empty($kana2) ) {
289 - $kana2 = str_replace( "・", "", str_replace( " ", "", mb_convert_kana( $kana2, "KVC" ) ) );
290 - $kana2 = mb_substr( $kana2, 0, 20 );
291 - if( !mb_ereg( "^[ァ-ヶー]+$", $kana2 ) ) $kana2 = '';
292 - }
293 - $html .= '<form id="purchase_form" name="purchase_form" action="' . $send_url . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}" accept-charset="Shift_JIS">
294 - <input type="hidden" name="SHOPCO" value="' . esc_attr($acting_opts['SHOPCO']) . '" />
295 - <input type="hidden" name="HOSTID" value="' . esc_attr($acting_opts['HOSTID']) . '" />
296 - <input type="hidden" name="REMARKS3" value="' . $acting_opts['REMARKS3'] . '" />
297 - <input type="hidden" name="S_TORIHIKI_NO" value="' . $rand . '" />
298 - <input type="hidden" name="NAME1" value="' . esc_attr(mb_substr($usces_entries['customer']['name1'], 0, 20)) . '" />
299 - <input type="hidden" name="NAME2" value="' . esc_attr(mb_substr($usces_entries['customer']['name2'], 0, 20)) . '" />
300 - <input type="hidden" name="KANA1" value="' . esc_attr($kana1) . '" />
301 - <input type="hidden" name="KANA2" value="' . esc_attr($kana2) . '" />
302 - <input type="hidden" name="YUBIN1" value="' . esc_attr(substr(str_replace('-', '', $usces_entries['customer']['zipcode']), 0, 3)) . '" />
303 - <input type="hidden" name="YUBIN2" value="' . esc_attr(substr(str_replace('-', '', $usces_entries['customer']['zipcode']), 3, 4)) . '" />
304 - <input type="hidden" name="ADD1" value="' . esc_attr($usces_entries['customer']['pref'] . $usces_entries['customer']['address1']) . '" />
305 - <input type="hidden" name="ADD2" value="' . esc_attr($usces_entries['customer']['address2']) . '" />
306 - <input type="hidden" name="ADD3" value="' . esc_attr($usces_entries['customer']['address3']) . '" />
307 - <input type="hidden" name="TEL" value="' . esc_attr(str_replace('-', '', mb_convert_kana($usces_entries['customer']['tel'], 'a', 'UTF-8'))) . '" />
308 - <input type="hidden" name="MAIL" value="' . esc_attr($usces_entries['customer']['mailaddress1']) . '" />
309 - <input type="hidden" name="TOTAL" value="' . $usces_entries['order']['total_full_price'] . '" />
310 - <input type="hidden" name="TAX" value="" />
311 - <input type="hidden" name="S_PAYDATE" value="' . date('Ymd', mktime(0,0,0,substr($datestr, 5, 2),substr($datestr, 8, 2)+$acting_opts['S_PAYDATE'],substr($datestr, 0, 4))) . '" />
312 - <input type="hidden" name="SEIYAKUDATE" value="' . date('Ymd', mktime(0,0,0,substr($datestr, 5, 2),substr($datestr, 8, 2),substr($datestr, 0, 4))) . '" />
313 - <input type="hidden" name="BIKO" value="' . esc_attr($biko) . '" />
314 - ';
315 - $mname_01 = '商品総額';
316 - $html .= '<input type="hidden" name="MNAME_01" value="' . $mname_01 . '" />
317 - <input type="hidden" name="MSUM_01" value="' . usces_crform($usces_entries['order']['total_full_price'], false, false, 'return', false) . '" />
318 - <input type="hidden" name="MNAME_02" value="" />
319 - <input type="hidden" name="MSUM_02" value="0" />
320 - <input type="hidden" name="MNAME_03" value="" />
321 - <input type="hidden" name="MSUM_03" value="0" />
322 - <input type="hidden" name="MNAME_04" value="" />
323 - <input type="hidden" name="MSUM_04" value="0" />
324 - <input type="hidden" name="MNAME_05" value="" />
325 - <input type="hidden" name="MSUM_05" value="0" />
326 - <input type="hidden" name="MNAME_06" value="" />
327 - <input type="hidden" name="MSUM_06" value="0" />
328 - <input type="hidden" name="MNAME_07" value="" />
329 - <input type="hidden" name="MSUM_07" value="0" />
330 - ';
331 - $html .= '<input type="hidden" name="RETURL" value="' . USCES_CART_URL . $usces->delim . 'acting=remise_conv&acting_return=1" />
332 - <input type="hidden" name="NG_RETURL" value="' . USCES_CART_URL . $usces->delim . 'acting=remise_conv&acting_return=0" />
333 - <input type="hidden" name="OPT" value="1" />
334 - <input type="hidden" name="EXITURL" value="' . USCES_CART_URL . $usces->delim . 'confirm=1" />
335 - ';
336 - $html .= '
337 - <input type="hidden" name="dummy" value="&#65533;" />
338 - <div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="'.__('Checkout', 'usces').'"' . apply_filters('usces_filter_confirm_nextbutton', ' onClick="document.charset=\'Shift_JIS\';"') . $purchase_disabled . ' /></div>';
339 - $html = apply_filters('usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled);
340 - $html .= '</form>';
341 - $html .= '<form action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
342 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"' . apply_filters('usces_filter_confirm_prebutton', NULL) . ' /></div>';
343 - $html = apply_filters('usces_filter_confirm_inform_back', $html);
344 - $html .= '</form>'."\n";
345 - break;
346 -
347 -//20101018ysk start
348 - case 'acting_jpayment_card'://クレジット決済(J-Payment)
349 - $acting_opts = $usces->options['acting_settings']['jpayment'];
350 - $usces->save_order_acting_data($rand);
351 -//20120823ysk start 0000547
352 - $itemName = $usces->getItemName($cart[0]['post_id']);
353 - if(1 < count($cart)) $itemName .= ','.__('Others', 'usces');
354 - if(50 < mb_strlen($itemName)) $itemName = mb_substr($itemName, 0, 50).'...';
355 - $quantity = 0;
356 - foreach($cart as $cart_row) {
357 - $quantity += $cart_row['quantity'];
358 - }
359 - $desc = $itemName.' '.__('Quantity','usces').':'.$quantity;
360 -//20120823ysk end
361 - $html .= '<form id="purchase_form" name="purchase_form" action="'.$acting_opts['send_url'].'" method="post" onKeyDown="if(event.keyCode == 13) {return false;}" >
362 - <input type="hidden" name="aid" value="'.$acting_opts['aid'].'" />
363 - <input type="hidden" name="cod" value="'.$rand.'" />
364 - <input type="hidden" name="jb" value="'.$acting_opts['card_jb'].'" />
365 - <input type="hidden" name="am" value="'.usces_crform($usces_entries['order']['total_full_price'], false, false, 'return', false).'" />
366 - <input type="hidden" name="tx" value="0" />
367 - <input type="hidden" name="sf" value="0" />
368 - <input type="hidden" name="pt" value="1" />
369 - <input type="hidden" name="inm" value="'.esc_attr($desc).'" />
370 - <input type="hidden" name="pn" value="'.esc_attr(str_replace('-', '', mb_convert_kana($usces_entries['customer']['tel'], 'a', 'UTF-8'))).'" />
371 - <input type="hidden" name="em" value="'.esc_attr($usces_entries['customer']['mailaddress1']).'" />
372 - <input type="hidden" name="acting" value="jpayment_card" />
373 - <input type="hidden" name="acting_return" value="1" />
374 - <input type="hidden" name="page_id" value="'.USCES_CART_NUMBER.'" />
375 - <input type="hidden" name="uscesid" value="' . $usces->get_uscesid(false) . '">
376 - ';
377 - $html .= '<div class="send"><input name="purchase_jpayment" type="submit" id="purchase_button" class="checkout_button" value="'.__('Checkout', 'usces').'"'.apply_filters('usces_filter_confirm_nextbutton', NULL).$purchase_disabled.' /></div>';
378 - $html = apply_filters('usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled);
379 - $html .= '</form>';
380 - $html .= '<form action="'.USCES_CART_URL.'" method="post" onKeyDown="if(event.keyCode == 13) {return false;}">
381 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"'.apply_filters('usces_filter_confirm_prebutton', NULL).' /></div>';
382 - $html = apply_filters('usces_filter_confirm_inform_back', $html);
383 - $html .= '</form>'."\n";
384 - break;
385 - case 'acting_jpayment_conv'://コンビニ・ペーパーレス決済(J-Payment)
386 - $acting_opts = $usces->options['acting_settings']['jpayment'];
387 - $usces->save_order_acting_data($rand);
388 -//20120823ysk start 0000547
389 - $itemName = $usces->getItemName($cart[0]['post_id']);
390 - if(1 < count($cart)) $itemName .= ','.__('Others', 'usces');
391 - if(50 < mb_strlen($itemName)) $itemName = mb_substr($itemName, 0, 50).'...';
392 - $quantity = 0;
393 - foreach($cart as $cart_row) {
394 - $quantity += $cart_row['quantity'];
395 - }
396 - $desc = $itemName.' '.__('Quantity','usces').':'.$quantity;
397 -//20120823ysk end
398 - $html .= '<form id="purchase_form" name="purchase_form" action="'.$acting_opts['send_url'].'" method="post" onKeyDown="if(event.keyCode == 13) {return false;}" >
399 - <input type="hidden" name="aid" value="'.$acting_opts['aid'].'" />
400 - <input type="hidden" name="cod" value="'.$rand.'" />
401 - <input type="hidden" name="jb" value="CAPTURE" />
402 - <input type="hidden" name="am" value="'.usces_crform($usces_entries['order']['total_full_price'], false, false, 'return', false).'" />
403 - <input type="hidden" name="tx" value="0" />
404 - <input type="hidden" name="sf" value="0" />
405 - <input type="hidden" name="pt" value="2" />
406 - <input type="hidden" name="inm" value="'.esc_attr($desc).'" />
407 - <input type="hidden" name="pn" value="'.esc_attr(str_replace('-', '', mb_convert_kana($usces_entries['customer']['tel'], 'a', 'UTF-8'))).'" />
408 - <input type="hidden" name="em" value="'.esc_attr($usces_entries['customer']['mailaddress1']).'" />
409 - <input type="hidden" name="acting" value="jpayment_conv" />
410 - <input type="hidden" name="acting_return" value="1" />
411 - <input type="hidden" name="page_id" value="'.USCES_CART_NUMBER.'" />
412 - <input type="hidden" name="uscesid" value="' . $usces->get_uscesid(false) . '">
413 - ';
414 - $html .= '<div class="send"><input name="purchase_jpayment" type="submit" id="purchase_button" class="checkout_button" value="'.__('Checkout', 'usces').'"'.apply_filters('usces_filter_confirm_nextbutton', NULL).$purchase_disabled.' /></div>';
415 - $html = apply_filters('usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled);
416 - $html .= '</form>';
417 - $html .= '<form action="'.USCES_CART_URL.'" method="post" onKeyDown="if(event.keyCode == 13) {return false;}">
418 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"'.apply_filters('usces_filter_confirm_prebutton', NULL).' /></div>';
419 - $html = apply_filters('usces_filter_confirm_inform_back', $html);
420 - $html .= '</form>'."\n";
421 - break;
422 - case 'acting_jpayment_bank'://バンクチェック決済(J-Payment)
423 - $acting_opts = $usces->options['acting_settings']['jpayment'];
424 - $usces->save_order_acting_data($rand);
425 -//20120823ysk start 0000547
426 - $itemName = $usces->getItemName($cart[0]['post_id']);
427 - if(1 < count($cart)) $itemName .= ','.__('Others', 'usces');
428 - if(50 < mb_strlen($itemName)) $itemName = mb_substr($itemName, 0, 50).'...';
429 - $quantity = 0;
430 - foreach($cart as $cart_row) {
431 - $quantity += $cart_row['quantity'];
432 - }
433 - $desc = $itemName.' '.__('Quantity','usces').':'.$quantity;
434 -//20120823ysk end
435 - $html .= '<form id="purchase_form" name="purchase_form" action="'.$acting_opts['send_url'].'" method="post" onKeyDown="if(event.keyCode == 13) {return false;}" >
436 - <input type="hidden" name="aid" value="'.$acting_opts['aid'].'" />
437 - <input type="hidden" name="cod" value="'.$rand.'" />
438 - <input type="hidden" name="jb" value="CAPTURE" />
439 - <input type="hidden" name="am" value="'.usces_crform($usces_entries['order']['total_full_price'], false, false, 'return', false).'" />
440 - <input type="hidden" name="tx" value="0" />
441 - <input type="hidden" name="sf" value="0" />
442 - <input type="hidden" name="pt" value="7" />
443 - <input type="hidden" name="inm" value="'.esc_attr($desc).'" />
444 - <input type="hidden" name="pn" value="'.esc_attr(str_replace('-', '', mb_convert_kana($usces_entries['customer']['tel'], 'a', 'UTF-8'))).'" />
445 - <input type="hidden" name="em" value="'.esc_attr($usces_entries['customer']['mailaddress1']).'" />
446 - <input type="hidden" name="acting" value="jpayment_bank" />
447 - <input type="hidden" name="acting_return" value="1" />
448 - <input type="hidden" name="page_id" value="'.USCES_CART_NUMBER.'" />
449 - <input type="hidden" name="uscesid" value="' . $usces->get_uscesid(false) . '">
450 - ';
451 - $html .= '<div class="send"><input name="purchase_jpayment" type="submit" id="purchase_button" class="checkout_button" value="'.__('Checkout', 'usces').'"'.apply_filters('usces_filter_confirm_nextbutton', NULL).$purchase_disabled.' /></div>';
452 - $html = apply_filters('usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled);
453 - $html .= '</form>';
454 - $html .= '<form action="'.USCES_CART_URL.'" method="post" onKeyDown="if(event.keyCode == 13) {return false;}">
455 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"'.apply_filters('usces_filter_confirm_prebutton', NULL).' /></div>';
456 - $html = apply_filters('usces_filter_confirm_inform_back', $html);
457 - $html .= '</form>'."\n";
458 - break;
459 -//20101018ysk end
460 -//20110208ysk start
461 - case 'acting_paypal_ec'://PayPal(エクスプレス・チェックアウト)
462 - $acting_opts = $usces->options['acting_settings']['paypal'];
463 - $currency_code = $usces->get_currency_code();
464 - $html .= '<form id="purchase_form" action="'.USCES_CART_URL.'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
465 - <input type="hidden" name="SOLUTIONTYPE" value="Sole">
466 - <input type="hidden" name="LANDINGPAGE" value="Billing">
467 - <input type="hidden" name="EMAIL" value="'.esc_attr( $usces_entries['customer']['mailaddress1'] ).'">
468 - <input type="hidden" name="PAYMENTREQUEST_0_CURRENCYCODE" value="'.$currency_code.'">';
469 - if( 'shipped' == $usces->getItemDivision( $cart[0]['post_id'] ) ) {
470 - $name = apply_filters( 'usces_filter_paypalec_shiptoname', esc_attr($usces_entries['delivery']['name2'].' '.$usces_entries['delivery']['name1']) );
471 - $address2 = apply_filters( 'usces_filter_paypalec_shiptostreet', esc_attr($usces_entries['delivery']['address2']) );
472 - $address3 = apply_filters( 'usces_filter_paypalec_shiptostreet2', esc_attr($usces_entries['delivery']['address3']) );
473 - $address1 = apply_filters( 'usces_filter_paypalec_shiptocity', esc_attr($usces_entries['delivery']['address1']) );
474 - $pref = apply_filters( 'usces_filter_paypalec_shiptostate', esc_attr($usces_entries['delivery']['pref']) );
475 - $country = ( !empty($usces_entries['delivery']['country']) ) ? $usces_entries['delivery']['country'] : usces_get_base_country();
476 - $country_code = apply_filters( 'usces_filter_paypalec_shiptocountrycode', $country );
477 - $zip = apply_filters( 'usces_filter_paypalec_shiptozip', $usces_entries['delivery']['zipcode'] );
478 - $tel = apply_filters( 'usces_filter_paypalec_shiptophonenum', ltrim(str_replace('-', '', $usces_entries['delivery']['tel']), '0') );
479 - $html .= '
480 - <input type="hidden" name="PAYMENTREQUEST_0_SHIPTONAME" value="'.$name.'">
481 - <input type="hidden" name="PAYMENTREQUEST_0_SHIPTOSTREET" value="'.$address2.'">
482 - <input type="hidden" name="PAYMENTREQUEST_0_SHIPTOSTREET2" value="'.$address3.'">
483 - <input type="hidden" name="PAYMENTREQUEST_0_SHIPTOCITY" value="'.$address1.'">
484 - <input type="hidden" name="PAYMENTREQUEST_0_SHIPTOSTATE" value="'.$pref.'">
485 - <input type="hidden" name="PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE" value="'.$country_code.'">
486 - <input type="hidden" name="PAYMENTREQUEST_0_SHIPTOZIP" value="'.$zip.'">
487 - <input type="hidden" name="PAYMENTREQUEST_0_SHIPTOPHONENUM" value="'.$tel.'">';
488 - }
489 -//20120629ysk start 0000520
490 - if( 'shipped' != $usces->getItemDivision( $cart[0]['post_id'] ) ) {
491 - $html .= '<input type="hidden" name="NOSHIPPING" value="1">';
492 - }
493 -//20120629ysk end
494 - $charging_type = $usces->getItemChargingType($cart[0]['post_id'], $cart);
495 - //$frequency = $usces->getItemFrequency($cart[0]['post_id']);
496 - if( 'continue' != $charging_type ) {
497 - //通常購入
498 -//20110606ysk start
499 -/* $itemName = $usces->getItemName($cart[0]['post_id']);
500 - if(1 < count($cart)) $itemName .= ','.__('Others', 'usces');
501 - if(50 < mb_strlen($itemName)) $itemName = mb_substr($itemName, 0, 50).'...';
502 - $quantity = 0;
503 - foreach($cart as $cart_row) {
504 - $quantity += $cart_row['quantity'];
505 - }
506 - $desc = $itemName.' '.__('Quantity','usces').':'.$quantity;
507 - $html .= '<input type="hidden" name="PAYMENTREQUEST_0_DESC" value="'.esc_attr($desc).'">';
508 -*/
509 - $item_total_price = 0;
510 - $i = 0;
511 - foreach( $cart as $cart_row ) {
512 - $html .= '
513 - <input type="hidden" name="L_PAYMENTREQUEST_0_NAME'.$i.'" value="'.esc_attr($usces->getItemName($cart_row['post_id'])).'">
514 - <input type="hidden" name="L_PAYMENTREQUEST_0_AMT'.$i.'" value="'.usces_crform($cart_row['price'], false, false, 'return', false).'">
515 - <input type="hidden" name="L_PAYMENTREQUEST_0_NUMBER'.$i.'" value="'.esc_attr($usces->getItemCode($cart_row['post_id'])).'">
516 - <input type="hidden" name="L_PAYMENTREQUEST_0_QTY'.$i.'" value="'.esc_attr($cart_row['quantity']).'">';
517 - $item_total_price += ( $cart_row['price'] * $cart_row['quantity'] );
518 - $i++;
519 - }
520 -//20110606ysk end
521 - //if( !empty($usces_entries['order']['discount']) ) $html .= '<input type="hidden" name="PAYMENTREQUEST_0_SHIPDISCAMT" value="'.usces_crform($usces_entries['order']['discount'], false, false, 'return', false).'">';
522 - if( !empty($usces_entries['order']['discount']) ) {
523 - $html .= '
524 - <input type="hidden" name="L_PAYMENTREQUEST_0_NAME'.$i.'" value="'.esc_attr(__('Campaign disnount', 'usces')).'">
525 - <input type="hidden" name="L_PAYMENTREQUEST_0_AMT'.$i.'" value="'.usces_crform($usces_entries['order']['discount'], false, false, 'return', false).'">';
526 - $item_total_price += $usces_entries['order']['discount'];
527 - $i++;
528 - }
529 - if( !empty($usces_entries['order']['usedpoint']) ) {
530 - $html .= '
531 - <input type="hidden" name="L_PAYMENTREQUEST_0_NAME'.$i.'" value="'.esc_attr(__('Used points', 'usces')).'">
532 - <input type="hidden" name="L_PAYMENTREQUEST_0_AMT'.$i.'" value="'.usces_crform($usces_entries['order']['usedpoint']*(-1), false, false, 'return', false).'">';
533 - $item_total_price -= $usces_entries['order']['usedpoint'];
534 - $i++;
535 - }
536 - $html .= '
537 - <input type="hidden" name="PAYMENTREQUEST_0_ITEMAMT" value="'.usces_crform($item_total_price, false, false, 'return', false).'">
538 - <input type="hidden" name="PAYMENTREQUEST_0_SHIPPINGAMT" value="'.usces_crform($usces_entries['order']['shipping_charge'], false, false, 'return', false).'">
539 - <input type="hidden" name="PAYMENTREQUEST_0_AMT" value="'.usces_crform($usces_entries['order']['total_full_price'], false, false, 'return', false).'">
540 - ';
541 - if( !empty($usces_entries['order']['cod_fee']) ) $html .= '<input type="hidden" name="PAYMENTREQUEST_0_HANDLINGAMT" value="'.usces_crform($usces_entries['order']['cod_fee'], false, false, 'return', false).'">';
542 - if( !empty($usces_entries['order']['tax']) ) $html .= '<input type="hidden" name="PAYMENTREQUEST_0_TAXAMT" value="'.usces_crform($usces_entries['order']['tax'], false, false, 'return', false).'">';
543 - } else {
544 - //定期支払い
545 - //$desc = usces_make_agreement_description($cart, $usces_entries['order']['total_items_price']);
546 - $desc = usces_make_agreement_description($cart, $usces_entries['order']['total_full_price']);//20111125ysk 0000320
547 - $html .= '<input type="hidden" name="L_BILLINGTYPE0" value="RecurringPayments">
548 - <input type="hidden" name="L_BILLINGAGREEMENTDESCRIPTION0" value="'.esc_attr($desc).'">
549 - <input type="hidden" name="AMT" value="0">';
550 - }
551 - if( !empty($acting_opts['logoimg']) ) $html .= '<input type="hidden" name="LOGOIMG" value="'.esc_attr($acting_opts['logoimg']).'">';
552 - //if( !empty($acting_opts['cartbordercolor']) and 'FFFFFF' != strtoupper($acting_opts['cartbordercolor']) ) $html .= '<input type="hidden" name="CARTBORDERCOLOR" value="'.esc_attr($acting_opts['cartbordercolor']).'">';
553 - if( !empty($acting_opts['cartbordercolor']) ) $html .= '<input type="hidden" name="CARTBORDERCOLOR" value="'.esc_attr($acting_opts['cartbordercolor']).'">';
554 - $html .= '<input type="hidden" name="purchase" value="acting_paypal_ec">';//20110502ysk
555 - $html .= '<div class="send"><input type="image" src="https://www.paypal.com/'.( USCES_JP ? 'ja_JP/JP' : 'en_US' ).'/i/btn/btn_xpressCheckout.gif" border="0" name="submit" value="submit" alt="PayPal"'.apply_filters('usces_filter_confirm_nextbutton', NULL).$purchase_disabled.' /></div>';
556 - $html = apply_filters('usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled);
557 - $html .= '</form>';
558 - $html .= '<form action="'.USCES_CART_URL.'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
559 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"'.apply_filters('usces_filter_confirm_prebutton', NULL).' /></div>';
560 - $html = apply_filters('usces_filter_confirm_inform_back', $html);
561 - $html .= '</form>';
562 - break;
563 -//20110208ysk end
564 -//20120413ysk start
565 - case 'acting_sbps_card':
566 - case 'acting_sbps_conv':
567 - case 'acting_sbps_payeasy':
568 - case 'acting_sbps_wallet':
569 - case 'acting_sbps_mobile':
570 - $charging_type = $usces->getItemChargingType($cart[0]['post_id']);
571 - $frequency = $usces->getItemFrequency($cart[0]['post_id']);
572 - $chargingday = $usces->getItemChargingDay($cart[0]['post_id']);
573 - $acting_opts = $usces->options['acting_settings']['sbps'];
574 - $usces->save_order_acting_data($rand);
575 - $member = $usces->get_member();
576 - $cust_code = ( empty($member['ID']) ) ? str_replace('-', '', mb_convert_kana($usces_entries['customer']['tel'], 'a', 'UTF-8')) : $member['ID'];
577 - if( 'public' == $acting_opts['ope'] ) {
578 - $send_url = $acting_opts['send_url'];
579 - } elseif( 'test' == $acting_opts['ope'] ) {
580 - $send_url = $acting_opts['send_url_test'];
581 - } else {
582 - $send_url = $acting_opts['send_url_check'];
583 - }
584 - $sbps_cust_no = '';
585 - $sbps_payment_no = '';
586 - switch( $acting_flag ) {
587 - case 'acting_sbps_card':
588 - //if( 'on' == $acting_opts['cust'] ) {
589 - // $sbps_cust_no = $usces->get_member_meta_value( 'sbps_cust_no', $member['ID'] );
590 - // $sbps_payment_no = $usces->get_member_meta_value( 'sbps_payment_no', $member['ID'] );
591 - //}
592 - $pay_method = ( 'on' == $acting_opts['3d_secure'] ) ? "credit3d" : "credit";
593 - $acting = "sbps_card";
594 - $free_csv = "";
595 - break;
596 - case 'acting_sbps_conv':
597 - $pay_method = "webcvs";
598 - $acting = "sbps_conv";
599 - $free_csv = usces_set_free_csv( $usces_entries['customer'] );
600 - break;
601 - case 'acting_sbps_payeasy':
602 - $pay_method = "payeasy";
603 - $acting = "sbps_payeasy";
604 - $free_csv = usces_set_free_csv( $usces_entries['customer'] );
605 - break;
606 - case 'acting_sbps_wallet':
607 - $pay_method = "";
608 - if( 'on' == $acting_opts['wallet_yahoowallet'] ) $pay_method .= ",yahoowallet";
609 - if( 'on' == $acting_opts['wallet_rakuten'] ) $pay_method .= ",rakuten";
610 - if( 'on' == $acting_opts['wallet_paypal'] ) $pay_method .= ",paypal";
611 - if( 'on' == $acting_opts['wallet_netmile'] ) $pay_method .= ",netmile";
612 - if( 'on' == $acting_opts['wallet_alipay'] ) $pay_method .= ",alipay";
613 - $pay_method = ltrim( $pay_method, "," );
614 - $acting = "sbps_wallet";
615 - $free_csv = "";
616 - break;
617 - case 'acting_sbps_mobile':
618 - $pay_method = "";
619 - if( 'on' == $acting_opts['mobile_docomo'] ) $pay_method .= ",docomo";
620 - if( 'on' == $acting_opts['mobile_softbank'] ) $pay_method .= ",softbank";
621 - if( 'on' == $acting_opts['mobile_auone'] ) $pay_method .= ",auone";
622 - if( 'on' == $acting_opts['mobile_mysoftbank'] ) $pay_method .= ",mysoftbank";
623 - if( 'on' == $acting_opts['mobile_softbank2'] ) $pay_method .= ",softbank2";
624 - $pay_method = ltrim( $pay_method, "," );
625 - $acting = "sbps_mobile";
626 - $free_csv = "";
627 - break;
628 - }
629 - $item_id = $cart[0]['post_id'];
630 - $item_name = $usces->getItemName($cart[0]['post_id']);
631 - if(1 < count($cart)) $item_name .= ' '.__('Others', 'usces');
632 - if(36 < mb_strlen($item_name)) $item_name = mb_substr($item_name, 0, 36).'...';
633 - $item_name = esc_attr( $item_name );
634 - $amount = usces_crform($usces_entries['order']['total_full_price'], false, false, 'return', false);
635 - $pay_type = "0";
636 - $auto_charge_type = "";
637 - $service_type = "0";
638 - $div_settle = "";
639 - $last_charge_month = "";
640 - $camp_type = "";
641 - $terminal_type = "0";
642 - $success_url = USCES_CART_URL.$usces->delim."acting=".$acting."&acting_return=1";
643 - $cancel_url = USCES_CART_URL.$usces->delim."acting=".$acting."&confirm=1";
644 - $error_url = USCES_CART_URL.$usces->delim."acting=".$acting."&acting_return=0";
645 - $pagecon_url = USCES_CART_URL;
646 - $free1 = $acting_flag;
647 - $request_date = date('YmdHis', current_time('timestamp'));
648 - $limit_second = "600";
649 - $sps_hashcode = $pay_method.$acting_opts['merchant_id'].$acting_opts['service_id'].$cust_code.$sbps_cust_no.$sbps_payment_no.$rand.$item_id.$item_name.$amount.$pay_type.$auto_charge_type.$service_type.$div_settle.$last_charge_month.$camp_type.$terminal_type.$success_url.$cancel_url.$error_url.$pagecon_url.$free1.$free_csv.$request_date.$limit_second.$acting_opts['hash_key'];
650 - $sps_hashcode = sha1( $sps_hashcode );
651 - $html .= '<form id="purchase_form" name="purchase_form" action="'.$send_url.'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}" accept-charset="Shift_JIS">
652 - <input type="hidden" name="pay_method" value="'.$pay_method.'" />
653 - <input type="hidden" name="merchant_id" value="'.$acting_opts['merchant_id'].'" />
654 - <input type="hidden" name="service_id" value="'.$acting_opts['service_id'].'" />
655 - <input type="hidden" name="cust_code" value="'.$cust_code.'" />
656 - <input type="hidden" name="sps_cust_no" value="'.$sbps_cust_no.'" />
657 - <input type="hidden" name="sps_payment_no" value="'.$sbps_payment_no.'" />
658 - <input type="hidden" name="order_id" value="'.$rand.'" />
659 - <input type="hidden" name="item_id" value="'.$item_id.'" />
660 - <input type="hidden" name="pay_item_id" value="" />
661 - <input type="hidden" name="item_name" value="'.$item_name.'" />
662 - <input type="hidden" name="tax" value="" />
663 - <input type="hidden" name="amount" value="'.$amount.'" />
664 - <input type="hidden" name="pay_type" value="'.$pay_type.'" />
665 - <input type="hidden" name="auto_charge_type" value="'.$auto_charge_type.'" />
666 - <input type="hidden" name="service_type" value="'.$service_type.'" />
667 - <input type="hidden" name="div_settle" value="'.$div_settle.'" />
668 - <input type="hidden" name="last_charge_month" value="'.$last_charge_month.'" />
669 - <input type="hidden" name="camp_type" value="'.$camp_type.'" />
670 - <input type="hidden" name="terminal_type" value="'.$terminal_type.'" />
671 - <input type="hidden" name="success_url" value="'.$success_url.'" />
672 - <input type="hidden" name="cancel_url" value="'.$cancel_url.'" />
673 - <input type="hidden" name="error_url" value="'.$error_url.'" />
674 - <input type="hidden" name="pagecon_url" value="'.$pagecon_url.'" />
675 - <input type="hidden" name="free1" value="'.$free1.'" />
676 - <input type="hidden" name="free2" value="" />
677 - <input type="hidden" name="free3" value="" />
678 - <input type="hidden" name="free_csv" value="'.$free_csv.'" />
679 - <input type="hidden" name="request_date" value="'.$request_date.'" />
680 - <input type="hidden" name="limit_second" value="'.$limit_second.'" />
681 - <input type="hidden" name="sps_hashcode" value="'.$sps_hashcode.'" />
682 - ';
683 - $html .= '<input type="hidden" name="dummy" value="&#65533;" />';
684 - $html .= '<div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="'.apply_filters('usces_filter_confirm_nextbutton_value', __('Checkout', 'usces')).'"' . apply_filters('usces_filter_confirm_nextbutton', ' onClick="document.charset=\'Shift_JIS\';"') . $purchase_disabled . ' /></div>';
685 - $html = apply_filters('usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled);
686 - $html .= '</form>';
687 - $html .= '<form action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
688 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"' . apply_filters('usces_filter_confirm_prebutton', NULL) . ' /></div>';
689 - $html = apply_filters('usces_filter_confirm_inform_back', $html);
690 - $html .= '</form>'."\n";
691 - break;
692 -//20120413ysk end
693 -//20120618ysk start
694 - case 'acting_telecom_card'://テレコムクレジット
695 - $acting_opts = $usces->options['acting_settings']['telecom'];
696 - $member = $usces->get_member();
697 - $memid = empty($member['ID']) ? 99999999 : $member['ID'];
698 - $send_url = $acting_opts['send_url'];
699 - $money = ( '$' == usces_get_cr_symbol() ) ? '$' : '';
700 - $money .= usces_crform( $usces_entries['order']['total_full_price'], false, false, 'return', false );
701 - $tel = str_replace('-', '', $usces_entries['customer']['tel']);
702 - $redirect_url = USCES_CART_URL.$usces->delim.'acting=telecom_card&acting_return=1&result=1';
703 - $redirect_back_url = USCES_CART_URL.$usces->delim.'confirm=1';
704 - $html .= '<form id="purchase_form" action="'.$send_url.'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
705 - <input type="hidden" name="clientip" value="'.$acting_opts['clientip'].'">
706 - <input type="hidden" name="money" value="'.apply_filters( 'usces_filter_acting_amount', $money, $acting_flag ).'">
707 - <input type="hidden" name="sendid" value="'.$memid.'">
708 - <input type="hidden" name="usrtel" value="'.$tel.'">
709 - <input type="hidden" name="usrmail" value="'.esc_attr($usces_entries['customer']['mailaddress1']).'">
710 - <input type="hidden" name="redirect_url" value="'.$redirect_url.'">
711 - <input type="hidden" name="redirect_back_url" value="'.$redirect_back_url.'">
712 - <input type="hidden" name="option" value="'.$rand.'">
713 - ';
714 - $html .= '<div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="'.__('Checkout', 'usces').'"'.apply_filters('usces_filter_confirm_nextbutton', NULL).$purchase_disabled.' /></div>';
715 - $html = apply_filters('usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled);
716 - $html .= '</form>';
717 - $html .= '<form action="'.USCES_CART_URL.'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
718 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"'.apply_filters('usces_filter_confirm_prebutton', NULL).' /></div>';
719 - $html = apply_filters('usces_filter_confirm_inform_back', $html);
720 - $html .= '</form>';
721 - break;
722 -//20120618ysk end
723 -//20121030ysk start
724 - case 'acting_telecom_edy'://Edy決済(テレコムクレジット)
725 - $acting_opts = $usces->options['acting_settings']['telecom'];
726 - $member = $usces->get_member();
727 - $memid = empty($member['ID']) ? 99999999 : $member['ID'];
728 - $money = ( '$' == usces_get_cr_symbol() ) ? '$' : '';
729 - $money .= usces_crform( $usces_entries['order']['total_full_price'], false, false, 'return', false );
730 - $redirect_back_url = USCES_CART_URL.$usces->delim.'acting=telecom_edy&acting_return=1&reg_order=1';
731 - $html .= '<form id="purchase_form" action="'.USCES_CART_URL.'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
732 - <input type="hidden" name="clientip" value="'.$acting_opts['clientip'].'">
733 - <input type="hidden" name="sendid" value="'.$memid.'">
734 - <input type="hidden" name="money" value="'.apply_filters( 'usces_filter_acting_amount', $money, $acting_flag ).'">
735 - <input type="hidden" name="redirect_back_url" value="'.$redirect_back_url.'">
736 - <input type="hidden" name="option" value="'.$rand.'">
737 - ';
738 - $html .= '<div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="'.__('Checkout', 'usces').'"'.apply_filters('usces_filter_confirm_nextbutton', NULL).$purchase_disabled.' /></div>';
739 - $html = apply_filters('usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled);
740 - $html .= '</form>';
741 - $html .= '<form action="'.USCES_CART_URL.'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
742 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"'.apply_filters('usces_filter_confirm_prebutton', NULL).' /></div>';
743 - $html = apply_filters('usces_filter_confirm_inform_back', $html);
744 - $html .= '</form>';
745 - break;
746 -//20121030ysk end
747 -//20121206ysk start
748 - case 'acting_digitalcheck_card'://カード決済(ペイデザイン)
749 - $acting_opts = $usces->options['acting_settings']['digitalcheck'];
750 - $sid = uniqid();
751 - $usces->save_order_acting_data($sid);
752 - $member = $usces->get_member();
753 - if( 'on' == $acting_opts['card_user_id'] && $usces->is_member_logged_in() ) {
754 - $ip_user_id = $usces->get_member_meta_value( 'digitalcheck_ip_user_id', $member['ID'] );
755 - if( empty($ip_user_id) ) {
756 - $ip_user_id = $member['ID'];
757 - $send_url = $acting_opts['send_url_card'];
758 - $fuka = $acting_flag.$ip_user_id;
759 - } else {
760 - $send_url = USCES_CART_URL;
761 - $fuka = $acting_flag;
762 - }
763 - } else {
764 - $ip_user_id = false;
765 - $send_url = $acting_opts['send_url_card'];
766 - $fuka = $acting_flag;
767 - }
768 - $item_name = $usces->getItemName($cart[0]['post_id']);
769 - if( 1 < count($cart) ) $item_name .= ','.__('Others', 'usces');
770 - if( 46 < strlen($item_name) ) $item_name = mb_strimwidth( $item_name, 0, 50, '...' );
771 - $kakutei = ( empty($acting_opts['card_kakutei']) ) ? '0' : $acting_opts['card_kakutei'];
772 - $html .= '<form id="purchase_form" name="purchase_form" action="'.$send_url.'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}" accept-charset="Shift_JIS">
773 - <input type="hidden" name="IP" value="'.$acting_opts['card_ip'].'" />
774 - <input type="hidden" name="SID" value="'.$sid.'" />
775 - <input type="hidden" name="N1" value="'.$item_name.'">
776 - <input type="hidden" name="K1" value="'.usces_crform($usces_entries['order']['total_full_price'], false, false, 'return', false).'">
777 - <input type="hidden" name="STORE" value="51" />
778 - <input type="hidden" name="KAKUTEI" value="'.$kakutei.'" />
779 - <input type="hidden" name="FUKA" value="'.$fuka.'" />
780 - <input type="hidden" name="NAME1" value="'.esc_attr(mb_strimwidth($usces_entries['customer']['name1'], 0, 20)).'" />
781 - <input type="hidden" name="NAME2" value="'.esc_attr(mb_strimwidth($usces_entries['customer']['name2'], 0, 20)).'" />
782 - <input type="hidden" name="KANA1" value="'.esc_attr(mb_strimwidth($usces_entries['customer']['name3'], 0, 20)).'" />
783 - <input type="hidden" name="KANA2" value="'.esc_attr(mb_strimwidth($usces_entries['customer']['name4'], 0, 20)).'" />
784 - <input type="hidden" name="YUBIN1" value="'.esc_attr(substr(str_replace('-', '', mb_convert_kana($usces_entries['customer']['zipcode'], 'a', 'UTF-8')), 0, 7)).'" />
785 - <input type="hidden" name="TEL" value="'.esc_attr(substr(str_replace('-', '', mb_convert_kana($usces_entries['customer']['tel'], 'a', 'UTF-8')), 0, 11)).'" />
786 - <input type="hidden" name="ADR1" value="'.esc_attr(mb_strimwidth($usces_entries['customer']['pref'].$usces_entries['customer']['address1'].$usces_entries['customer']['address2'], 0, 50)).'" />
787 - <input type="hidden" name="ADR2" value="'.esc_attr(mb_strimwidth($usces_entries['customer']['address3'], 0, 50)).'" />
788 - <input type="hidden" name="MAIL" value="'.esc_attr($usces_entries['customer']['mailaddress1']).'" />
789 - ';
790 - if( $ip_user_id ) {
791 - $html .= '<input type="hidden" name="PASS" value="'.$acting_opts['card_pass'].'">
792 - <input type="hidden" name="IP_USER_ID" value="'.$ip_user_id.'">
793 - ';
794 - }
795 - if( $usces->use_ssl ) {
796 - $ssl_url = $usces->options['ssl_url'].'/?page_id='.USCES_CART_NUMBER;
797 - $html .= '<input type="hidden" name="OKURL" value="'.$ssl_url.$usces->delim.'acting=digitalcheck_card&acting_return=1" />
798 - <input type="hidden" name="RT" value="'.$ssl_url.$usces->delim.'acting=digitalcheck_card&confirm=1" />
799 - ';
800 - } else {
801 - $html .= '<input type="hidden" name="OKURL" value="'.USCES_CART_URL.$usces->delim.'acting=digitalcheck_card&acting_return=1" />
802 - <input type="hidden" name="RT" value="'.USCES_CART_URL.$usces->delim.'acting=digitalcheck_card&confirm=1" />
803 - ';
804 - }
805 - $html .= '<input type="hidden" name="dummy" value="&#65533;" />';
806 - $html .= '<div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="'.__('Checkout', 'usces').'"'.apply_filters('usces_filter_confirm_nextbutton', ' onClick="document.charset=\'Shift_JIS\';"').$purchase_disabled.' /></div>';
807 - $html = apply_filters('usces_filter_confirm_inform', $html, $payments, $acting_flag, $sid, $purchase_disabled);
808 - $html .= '</form>';
809 - $html .= '<form action="'.USCES_CART_URL.'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
810 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"'.apply_filters('usces_filter_confirm_prebutton', NULL).' /></div>';
811 - $html = apply_filters('usces_filter_confirm_inform_back', $html);
812 - $html .= '</form>'."\n";
813 - break;
814 - case 'acting_digitalcheck_conv'://コンビニ決済(ペイデザイン)
815 - $acting_opts = $usces->options['acting_settings']['digitalcheck'];
816 - $sid = uniqid();
817 - $usces->save_order_acting_data($sid);
818 - $item_name = $usces->getItemName($cart[0]['post_id']);
819 - if( 1 < count($cart) ) $item_name .= ','.__('Others', 'usces');
820 - if( 46 < strlen($item_name) ) $item_name = mb_strimwidth( $item_name, 0, 50, '...' );
821 - $today = date( 'Y-m-d', current_time('timestamp') );
822 - list( $year, $month, $day ) = explode( '-', $today );
823 - $kigen = date( 'Ymd', mktime(0, 0, 0, (int)$month, (int)$day + (int)$acting_opts['conv_kigen'], (int)$year) );
824 - $store = ( 1 < count($acting_opts['conv_store']) ) ? '99' : $acting_opts['conv_store'][0];
825 - //$html .= '<form id="purchase_form" name="purchase_form" action="'.$acting_opts['send_url_conv'].'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}" accept-charset="Shift_JIS">
826 - $html .= '<form id="purchase_form" name="purchase_form" action="'.USCES_CART_URL.'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}" accept-charset="Shift_JIS">
827 - <input type="hidden" name="IP" value="'.$acting_opts['conv_ip'].'" />
828 - <input type="hidden" name="SID" value="'.$sid.'" />
829 - <input type="hidden" name="N1" value="'.esc_attr($item_name).'">
830 - <input type="hidden" name="K1" value="'.usces_crform($usces_entries['order']['total_full_price'], false, false, 'return', false).'">
831 - <input type="hidden" name="STORE" value="'.$store.'" />
832 - <input type="hidden" name="FUKA" value="'.$acting_flag.'" />
833 - <input type="hidden" name="KIGEN" value="'.$kigen.'" />
834 - <input type="hidden" name="NAME1" value="'.esc_attr(mb_strimwidth($usces_entries['customer']['name1'], 0, 20)).'" />
835 - <input type="hidden" name="NAME2" value="'.esc_attr(mb_strimwidth($usces_entries['customer']['name2'], 0, 20)).'" />
836 - <input type="hidden" name="KANA1" value="'.esc_attr(mb_strimwidth($usces_entries['customer']['name3'], 0, 20)).'" />
837 - <input type="hidden" name="KANA2" value="'.esc_attr(mb_strimwidth($usces_entries['customer']['name4'], 0, 20)).'" />
838 - <input type="hidden" name="YUBIN1" value="'.esc_attr(substr(str_replace('-', '', mb_convert_kana($usces_entries['customer']['zipcode'], 'a', 'UTF-8')), 0, 7)).'" />
839 - <input type="hidden" name="TEL" value="'.esc_attr(substr(str_replace('-', '', mb_convert_kana($usces_entries['customer']['tel'], 'a', 'UTF-8')), 0, 11)).'" />
840 - <input type="hidden" name="ADR1" value="'.esc_attr(mb_strimwidth($usces_entries['customer']['pref'].$usces_entries['customer']['address1'].$usces_entries['customer']['address2'], 0, 50)).'" />
841 - <input type="hidden" name="ADR2" value="'.esc_attr(mb_strimwidth($usces_entries['customer']['address3'], 0, 50)).'" />
842 - <input type="hidden" name="MAIL" value="'.esc_attr($usces_entries['customer']['mailaddress1']).'" />
843 - ';
844 - if( $usces->use_ssl ) {
845 - $ssl_url = $usces->options['ssl_url'].'/?page_id='.USCES_CART_NUMBER;
846 - $html .= '<input type="hidden" name="OKURL" value="'.$ssl_url.$usces->delim.'acting=digitalcheck_conv&acting_return=1" />
847 - <input type="hidden" name="RT" value="'.$ssl_url.$usces->delim.'acting=digitalcheck_conv&confirm=1" />
848 - ';
849 - } else {
850 - $html .= '<input type="hidden" name="OKURL" value="'.USCES_CART_URL.$usces->delim.'acting=digitalcheck_conv&acting_return=1" />
851 - <input type="hidden" name="RT" value="'.USCES_CART_URL.$usces->delim.'acting=digitalcheck_conv&confirm=1" />
852 - ';
853 - }
854 - $html .= '<input type="hidden" name="dummy" value="&#65533;" />';
855 - $html .= '<div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="'.__('Checkout', 'usces').'"'.apply_filters('usces_filter_confirm_nextbutton', ' onClick="document.charset=\'Shift_JIS\';"').$purchase_disabled.' /></div>';
856 - $html = apply_filters('usces_filter_confirm_inform', $html, $payments, $acting_flag, $sid, $purchase_disabled);
857 - $html .= '</form>';
858 - $html .= '<form action="'.USCES_CART_URL.'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
859 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"'.apply_filters('usces_filter_confirm_prebutton', NULL).' /></div>';
860 - $html = apply_filters('usces_filter_confirm_inform_back', $html);
861 - $html .= '</form>'."\n";
862 - break;
863 -//20121206ysk end
864 -//20130225ysk start
865 - case 'acting_mizuho_card'://カード決済(みずほファクター)
866 - $acting_opts = $usces->options['acting_settings']['mizuho'];
867 - $send_url = ( 'public' == $acting_opts['ope'] ) ? $acting_opts['send_url'] : $acting_opts['send_url_test'];
868 - $p_ver = '0200';
869 - $stdate = date( 'Ymd' );
870 - $stran = sprintf( '%06d', mt_rand(1, 999999) );
871 - $bkcode = 'bg01';
872 - $amount = apply_filters( 'usces_filter_acting_amount', usces_crform($usces_entries['order']['total_full_price'], false, false, 'return', false), $acting_flag );
873 - $schksum = $p_ver.$stdate.$stran.$bkcode.$acting_opts['shopid'].$acting_opts['cshopid'].$amount.$acting_opts['hash_pass'];
874 - $schksum = htmlspecialchars( md5( $schksum ) );
875 - $html .= '<form id="purchase_form" action="'.$send_url.'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}" accept-charset="Shift_JIS">
876 - <input type="hidden" name="p_ver" value="'.$p_ver.'">
877 - <input type="hidden" name="stdate" value="'.$stdate.'">
878 - <input type="hidden" name="stran" value="'.$stran.'">
879 - <input type="hidden" name="bkcode" value="'.$bkcode.'">
880 - <input type="hidden" name="shopid" value="'.$acting_opts['shopid'].'">
881 - <input type="hidden" name="cshopid" value="'.$acting_opts['cshopid'].'">
882 - <input type="hidden" name="amount" value="'.$amount.'">
883 - <input type="hidden" name="schksum" value="'.$schksum.'">
884 - ';
885 - $html .= '<input type="hidden" name="dummy" value="&#65533;" />';
886 - $html .= '<div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="'.__('Checkout', 'usces').'"'.apply_filters('usces_filter_confirm_nextbutton', ' onClick="document.charset=\'Shift_JIS\';"').$purchase_disabled.' /></div>';
887 - $html = apply_filters( 'usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled );
888 - $html .= '</form>';
889 - $html .= '<form action="'.USCES_CART_URL.'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
890 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"'.apply_filters('usces_filter_confirm_prebutton', NULL).' /></div>';
891 - $html = apply_filters( 'usces_filter_confirm_inform_back', $html );
892 - $html .= '</form>';
893 - break;
894 - case 'acting_mizuho_conv1'://コンビニ・ウェルネット決済(みずほファクター)
895 - case 'acting_mizuho_conv2'://コンビニ・セブンイレブン決済(みずほファクター)
896 - $acting_opts = $usces->options['acting_settings']['mizuho'];
897 - $send_url = ( 'public' == $acting_opts['ope'] ) ? $acting_opts['send_url'] : $acting_opts['send_url_test'];
898 - $p_ver = '0200';
899 - $stdate = date( 'Ymd' );
900 - $stran = sprintf( '%06d', mt_rand(1, 999999) );
901 - $bkcode = 'cv0'.substr( $acting_flag, -1 );
902 - $amount = apply_filters( 'usces_filter_acting_amount', usces_crform($usces_entries['order']['total_full_price'], false, false, 'return', false), $acting_flag );
903 - $custmKanji = mb_strimwidth( $usces_entries['customer']['name1'].$usces_entries['customer']['name2'], 0, 40 );
904 - $mailaddr = esc_attr( $usces_entries['customer']['mailaddress1'] );
905 - $tel = str_replace( '-', '', $usces_entries['customer']['tel'] );
906 - $schksum = $p_ver.$stdate.$stran.$bkcode.$acting_opts['shopid'].$acting_opts['cshopid'].$amount.mb_convert_encoding($custmKanji, 'SJIS', 'UTF-8').$mailaddr.$tel.$acting_opts['hash_pass'];
907 - $schksum = htmlspecialchars( md5( $schksum ) );
908 - $html .= '<form id="purchase_form" action="'.$send_url.'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
909 - <input type="hidden" name="p_ver" value="'.$p_ver.'">
910 - <input type="hidden" name="stdate" value="'.$stdate.'">
911 - <input type="hidden" name="stran" value="'.$stran.'">
912 - <input type="hidden" name="bkcode" value="'.$bkcode.'">
913 - <input type="hidden" name="shopid" value="'.$acting_opts['shopid'].'">
914 - <input type="hidden" name="cshopid" value="'.$acting_opts['cshopid'].'">
915 - <input type="hidden" name="amount" value="'.$amount.'">
916 - <input type="hidden" name="custmKanji" value="'.$custmKanji.'">
917 - <input type="hidden" name="mailaddr" value="'.$mailaddr.'">
918 - <input type="hidden" name="tel" value="'.$tel.'">
919 - <input type="hidden" name="schksum" value="'.$schksum.'">
920 - ';
921 - $html .= '<input type="hidden" name="dummy" value="&#65533;" />';
922 - $html .= '<div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="'.__('Checkout', 'usces').'"'.apply_filters('usces_filter_confirm_nextbutton', ' onClick="document.charset=\'Shift_JIS\';"').$purchase_disabled.' /></div>';
923 - $html = apply_filters( 'usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled );
924 - $html .= '</form>';
925 - $html .= '<form action="'.USCES_CART_URL.'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
926 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"'.apply_filters('usces_filter_confirm_prebutton', NULL).' /></div>';
927 - $html = apply_filters( 'usces_filter_confirm_inform_back', $html );
928 - $html .= '</form>';
929 - break;
930 -//20130225ysk end
931 -//20131220ysk start
932 - case 'acting_anotherlane_card'://カード決済(アナザーレーン)
933 - $usces->save_order_acting_data( $rand );
934 - $acting_opts = $usces->options['acting_settings']['anotherlane'];
935 - $amount = apply_filters( 'usces_filter_acting_amount', usces_crform( $usces_entries['order']['total_full_price'], false, false, 'return', false), $acting_flag );
936 - $note = ( 46 < mb_strlen($usces_entries['order']['note']) ) ? mb_substr( $usces_entries['order']['note'], 0, 46 ).'...' : $usces_entries['order']['note'];
937 - $html .= '<form id="purchase_form" name="purchase_form" action="'.$acting_opts['send_url'].'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}" accept-charset="UTF-8">
938 - <input type="hidden" name="SiteId" value="'.$acting_opts['siteid'].'">
939 - <input type="hidden" name="SitePass" value="'.$acting_opts['sitepass'].'">
940 - <input type="hidden" name="Amount" value="'.$amount.'">
941 - <input type="hidden" name="TransactionId" value="">
942 - <input type="hidden" name="zip" value="'.esc_attr( str_replace( '-', '', $usces_entries['customer']['zipcode'] ) ).'">
943 - <input type="hidden" name="capital" value="'.esc_attr( $usces_entries['customer']['pref'] ).'">
944 - <input type="hidden" name="adr1" value="'.esc_attr( $usces_entries['customer']['address1'] ).'">
945 - <input type="hidden" name="adr2" value="'.esc_attr( $usces_entries['customer']['address2'] ).'">
946 - <input type="hidden" name="adr3" value="'.esc_attr( $usces_entries['customer']['address3'] ).'">
947 - <input type="hidden" name="name" value="'.esc_attr( mb_substr( $usces_entries['customer']['name1'].$usces_entries['customer']['name2'], 0, 25 ) ).'" />
948 - <input type="hidden" name="tel" value="'.esc_attr( str_replace( '-', '', $usces_entries['customer']['tel'] ) ).'" />
949 - <input type="hidden" name="mail" value="'.esc_attr( $usces_entries['customer']['mailaddress1'] ).'">
950 - <input type="hidden" name="note" value="'.esc_attr( $note ).'">
951 - <input type="hidden" name="rand" value="'.$rand.'">
952 - ';
953 - if( 'on' == $acting_opts['quickcharge'] && $usces->is_member_logged_in() ) {
954 - $member = $usces->get_member();
955 - $html .= '<input type="hidden" name="CustomerId" value="'.esc_attr($member['ID']).'">';
956 - }
957 - $html .= '<div class="send"><input name="purchase_ali" type="submit" id="purchase_button" class="checkout_button" value="'.__('Checkout', 'usces').'"'.apply_filters('usces_filter_confirm_nextbutton', ' onClick="document.charset=\'Shift_JIS\';"').$purchase_disabled.' /></div>';
958 - $html = apply_filters( 'usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled );
959 - $html .= '</form>';
960 - $html .= '<form action="'.USCES_CART_URL.'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
961 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"'.apply_filters('usces_filter_confirm_prebutton', NULL).' /></div>';
962 - $html = apply_filters( 'usces_filter_confirm_inform_back', $html );
963 - $html .= '</form>';
964 - break;
965 -//20131220ysk end
966 -//20140206ysk start
967 - case 'acting_veritrans_card'://カード決済(ベリトランス)
968 - case 'acting_veritrans_conv'://コンビニ決済(ベリトランス)
969 - $acting_opts = $usces->options['acting_settings']['veritrans'];
970 - $usces->save_order_acting_data( $rand );
971 - $settlement_type = ( 'acting_veritrans_card' == $acting_flag ) ? '01' : '02';
972 - $amount = apply_filters( 'usces_filter_acting_amount', usces_crform( $usces_entries['order']['total_full_price'], false, false, 'return', false), $acting_flag );
973 - $ctx = hash_init( 'sha512' );
974 - $str = $acting_opts['merchanthash'].",".$acting_opts['merchant_id'].",".$settlement_type.",".$rand.",".$amount;
975 - hash_update( $ctx, $str );
976 - $hash = hash_final( $ctx, true );
977 - $merchanthash = bin2hex( $hash );
978 - $html .= '<form id="purchase_form" name="purchase_form" action="'.USCES_CART_URL.'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
979 - <input type="hidden" name="MERCHANTHASH" value="'.esc_attr( $merchanthash ).'">
980 - <input type="hidden" name="SETTLEMENT_TYPE" value="'.esc_attr( $settlement_type ).'">
981 - <input type="hidden" name="ORDER_ID" value="'.esc_attr( $rand ).'">
982 - <input type="hidden" name="AMOUNT" value="'.esc_attr( $amount ).'">
983 - ';
984 - $html .= '<div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="'.__('Checkout', 'usces').'"'.apply_filters('usces_filter_confirm_nextbutton', '').$purchase_disabled.' /></div>';
985 - $html = apply_filters( 'usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled );
986 - $html .= '</form>';
987 - $html .= '<form action="'.USCES_CART_URL.'" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
988 - <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="'.__('Back', 'usces').'"'.apply_filters('usces_filter_confirm_prebutton', NULL).' /></div>';
989 - $html = apply_filters( 'usces_filter_confirm_inform_back', $html );
990 - $html .= '</form>';
991 - break;
992 -//20140206ysk end
993 -
994 - default:
995 - $html .= '<form id="purchase_form" action="' . apply_filters('usces_filter_acting_url', USCES_CART_URL) . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
996 - <div class="send"><input name="backDelivery" type="submit" id="back_button" value="'.__('Back', 'usces').'"'.apply_filters('usces_filter_confirm_prebutton', NULL).' />
997 - <input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="'.__('Checkout', 'usces').'"'.$purchase_disabled.' /></div>';
998 - $html = apply_filters('usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled);
999 - $html .= '</form>';
1000 - }
1001 -}
1002 -?>
1 +<?php
2 +/**
3 + * Processing of the “Purchase” button
4 + *
5 + * @package Welcart
6 + */
7 +
8 +if ( isset( $this ) ) {
9 + $usces = &$this;
10 +}
11 +
12 +$payments = usces_get_payments_by_name( $usces_entries['order']['payment_name'] );
13 +$acting_flag = '';
14 +$rand = usces_acting_key();
15 +$cart = $usces->cart->get_cart();
16 +$cart_count = ( $cart && is_array( $cart ) ) ? count( $cart ) : 0;
17 +
18 +$purchase_disabled = '';
19 +$purchase_html = '';
20 +$checkout_button_value = apply_filters( 'usces_filter_confirm_checkout_button_value', __( 'Checkout', 'usces' ) );
21 +$payment_settlement = $payments['settlement'] ?? '';
22 +
23 +if ( 'acting' != substr( $payment_settlement, 0, 6 ) || 0 === (int) $usces_entries['order']['total_full_price'] ) {
24 + $purchase_html = '<form id="purchase_form" action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
25 + ' . wp_nonce_field( 'wc_purchase_nonce', 'wc_purchase_nonce', true, false ) . '
26 + <div class="send">
27 + ' . apply_filters( 'usces_filter_confirm_before_backbutton', null, $payments, $acting_flag, $rand ) . '
28 + <input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="' . apply_filters( 'usces_filter_confirm_prebutton_value', __( 'Back', 'usces' ) ) . '"' . apply_filters( 'usces_filter_confirm_prebutton', null ) . ' />
29 + <input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="' . $checkout_button_value . '"' . apply_filters( 'usces_filter_confirm_nextbutton', null ) . $purchase_disabled . ' /></div>';
30 + $html .= apply_filters( 'usces_filter_confirm_inform', $purchase_html, $payments, $acting_flag, $rand, $purchase_disabled );
31 + $html .= '</form>';
32 +} else {
33 + $send_item_code = apply_filters( 'usces_filter_settlement_item_code', $usces->getItemCode( $cart[0]['post_id'] ) );
34 + $send_item_name = apply_filters( 'usces_filter_settlement_item_name', $usces->getItemName( $cart[0]['post_id'] ) );
35 +
36 + $acting_flag = ( 'acting' == $payment_settlement ) ? $payments['module'] : $payment_settlement;
37 + switch ( $acting_flag ) {
38 +
39 + case 'paypal.php':
40 + break;
41 + case 'epsilon.php':
42 + break;
43 +
44 + case 'acting_remise_card': /* ルミーズ クレジットカード決済 */
45 + $have_continue_charge = usces_have_continue_charge( $cart );
46 + $acting_opts = $usces->options['acting_settings']['remise'];
47 + $usces->save_order_acting_data( $rand );
48 + usces_save_order_acting_data( $rand );
49 + $member = $usces->get_member();
50 + $send_url = ( 'public' == $acting_opts['card_pc_ope'] ) ? $acting_opts['send_url_pc'] : $acting_opts['send_url_pc_test'];
51 + $html .= '<form id="purchase_form" name="purchase_form" action="' . $send_url . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}" accept-charset="Shift_JIS">
52 + <input type="hidden" name="SHOPCO" value="' . esc_attr( $acting_opts['SHOPCO'] ) . '" />
53 + <input type="hidden" name="HOSTID" value="' . esc_attr( $acting_opts['HOSTID'] ) . '" />
54 + <input type="hidden" name="REMARKS3" value="' . $acting_opts['REMARKS3'] . '" />
55 + <input type="hidden" name="S_TORIHIKI_NO" value="' . $rand . '" />
56 + <input type="hidden" name="JOB" value="' . apply_filters( 'usces_filter_remise_card_job', $acting_opts['card_jb'] ) . '" />
57 + <input type="hidden" name="MAIL" value="' . esc_attr( $usces_entries['customer']['mailaddress1'] ) . '" />
58 + <input type="hidden" name="ITEM" value="' . apply_filters( 'usces_filter_remise_card_item', '0000120' ) . '" />
59 + <input type="hidden" name="TOTAL" value="' . usces_crform( $usces_entries['order']['total_full_price'], false, false, 'return', false ) . '" />
60 + <input type="hidden" name="AMOUNT" value="' . usces_crform( $usces_entries['order']['total_full_price'], false, false, 'return', false ) . '" />
61 + <input type="hidden" name="RETURL" value="' . USCES_CART_URL . $usces->delim . 'acting=remise_card&acting_return=1" />
62 + <input type="hidden" name="NG_RETURL" value="' . USCES_CART_URL . $usces->delim . 'acting=remise_card&acting_return=0" />
63 + <input type="hidden" name="EXITURL" value="' . USCES_CART_URL . $usces->delim . 'confirm=1" />';
64 + if ( 'on' == $acting_opts['payquick'] && $usces->is_member_logged_in() ) {
65 + $pcid = $usces->get_member_meta_value( 'remise_pcid', $member['ID'] );
66 + $html .= '<input type="hidden" name="PAYQUICK" value="1">';
67 + if ( null != $pcid ) {
68 + $html .= '<input type="hidden" name="PAYQUICKID" value="' . $pcid . '">';
69 + }
70 + }
71 + if ( 'on' == $acting_opts['howpay'] && isset( $usces_entries['order']['div'] ) && '0' !== $usces_entries['order']['div'] && ! $have_continue_charge ) {
72 + $html .= '<input type="hidden" name="div" value="' . $usces_entries['order']['div'] . '">';
73 + switch ( $usces_entries['order']['div'] ) {
74 + case '1':
75 + $html .= '<input type="hidden" name="METHOD" value="61">';
76 + $html .= '<input type="hidden" name="PTIMES" value="2">';
77 + break;
78 + case '2':
79 + $html .= '<input type="hidden" name="METHOD" value="80">';
80 + break;
81 + }
82 + } else {
83 + $html .= '<input type="hidden" name="div" value="0">';
84 + $html .= '<input type="hidden" name="METHOD" value="10">';
85 + }
86 + if ( $have_continue_charge ) {
87 + $frequency = $usces->getItemFrequency( $cart[0]['post_id'] );
88 + $nextdate = current_time( 'mysql' );
89 + $kana = ( ! empty( $usces_entries['customer']['name3'] ) ) ? $usces_entries['customer']['name3'] : '';
90 + if ( ! empty( $usces_entries['customer']['name4'] ) ) {
91 + $kana .= $usces_entries['customer']['name4'];
92 + }
93 + if ( ! empty( $kana ) ) {
94 + $kana = str_replace( '・', '', str_replace( ' ', '', mb_convert_kana( $kana, 'KVC', 'UTF-8' ) ) );
95 + $kana = mb_substr( $kana, 0, 20, 'UTF-8' );
96 + mb_regex_encoding( 'UTF-8' );
97 + if ( ! mb_ereg( '^[ァ-ヶー]+$', $kana ) ) {
98 + $kana = '';
99 + }
100 + }
101 + $html .= '
102 + <input type="hidden" name="AUTOCHARGE" value="1">
103 + <input type="hidden" name="AC_S_KAIIN_NO" value="' . $member['ID'] . '">
104 + <input type="hidden" name="AC_NAME" value="">
105 + <input type="hidden" name="AC_KANA" value="' . esc_attr( $kana ) . '">
106 + <input type="hidden" name="AC_TEL" value="' . esc_attr( str_replace( '-', '', mb_convert_kana( $usces_entries['customer']['tel'], 'a', 'UTF-8' ) ) ) . '">
107 + <input type="hidden" name="AC_AMOUNT" value="' . $usces_entries['order']['total_full_price'] . '">
108 + <input type="hidden" name="AC_TOTAL" value="' . $usces_entries['order']['total_full_price'] . '">
109 + <input type="hidden" name="AC_NEXT_DATE" value="' . date( 'Ymd', dlseller_first_charging( $cart[0]['post_id'], 'time' ) ) . '">
110 + <input type="hidden" name="AC_INTERVAL" value="' . $frequency . 'M">';
111 + }
112 + $html .= '<input type="hidden" name="dummy" value="&#65533;" />';
113 + $html .= '<div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="' . $checkout_button_value . '"' . apply_filters( 'usces_filter_confirm_nextbutton', ' onClick="document.charset=\'Shift_JIS\';"' ) . $purchase_disabled . ' /></div>';
114 + $html = apply_filters( 'usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled );
115 + $html .= '</form>';
116 + $html .= '<form action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
117 + <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="' . __( 'Back', 'usces' ) . '"' . apply_filters( 'usces_filter_confirm_prebutton', null ) . ' /></div>';
118 + $html = apply_filters( 'usces_filter_confirm_inform_back', $html );
119 + $html .= '</form>';
120 + break;
121 +
122 + case 'acting_remise_conv': /* ルミーズ マルチ決済 */
123 + if ( function_exists( 'mb_strlen' ) ) {
124 + $biko = ( 22 < mb_strlen( $usces_entries['order']['note'], 'UTF-8' ) ) ? ( mb_substr( $usces_entries['order']['note'], 0, 22, 'UTF-8' ) . '...' ) : $usces_entries['order']['note'];
125 + } else {
126 + $biko = ( 44 < strlen( $usces_entries['order']['note'] ) ) ? ( substr( $usces_entries['order']['note'], 0, 44 ) . '...' ) : $usces_entries['order']['note'];
127 + }
128 + $datestr = get_date_from_gmt( gmdate( 'Y-m-d H:i:s', time() ) );
129 + $acting_opts = $usces->options['acting_settings']['remise'];
130 + $usces->save_order_acting_data( $rand );
131 + usces_save_order_acting_data( $rand );
132 + $send_url = ( 'public' == $acting_opts['conv_pc_ope'] ) ? $acting_opts['send_url_cvs_pc'] : $acting_opts['send_url_cvs_pc_test'];
133 + $kana1 = ( ! empty( $usces_entries['customer']['name3'] ) ) ? $usces_entries['customer']['name3'] : '';
134 + if ( ! empty( $kana1 ) ) {
135 + $kana1 = str_replace( '・', '', str_replace( ' ', '', mb_convert_kana( $kana1, 'KVC', 'UTF-8' ) ) );
136 + $kana1 = mb_substr( $kana1, 0, 20, 'UTF-8' );
137 + mb_regex_encoding( 'UTF-8' );
138 + if ( ! mb_ereg( '^[ァ-ヶー]+$', $kana1 ) ) {
139 + $kana1 = '';
140 + }
141 + }
142 + $kana2 = ( ! empty( $usces_entries['customer']['name4'] ) ) ? $usces_entries['customer']['name4'] : '';
143 + if ( ! empty( $kana2 ) ) {
144 + $kana2 = str_replace( '・', '', str_replace( ' ', '', mb_convert_kana( $kana2, 'KVC', 'UTF-8' ) ) );
145 + $kana2 = mb_substr( $kana2, 0, 20, 'UTF-8' );
146 + mb_regex_encoding( 'UTF-8' );
147 + if ( ! mb_ereg( '^[ァ-ヶー]+$', $kana2 ) ) {
148 + $kana2 = '';
149 + }
150 + }
151 + $html .= '<form id="purchase_form" name="purchase_form" action="' . $send_url . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}" accept-charset="Shift_JIS">
152 + <input type="hidden" name="SHOPCO" value="' . esc_attr( $acting_opts['SHOPCO'] ) . '" />
153 + <input type="hidden" name="HOSTID" value="' . esc_attr( $acting_opts['HOSTID'] ) . '" />
154 + <input type="hidden" name="REMARKS3" value="' . $acting_opts['REMARKS3'] . '" />
155 + <input type="hidden" name="S_TORIHIKI_NO" value="' . $rand . '" />
156 + <input type="hidden" name="NAME1" value="' . esc_attr( mb_substr( $usces_entries['customer']['name1'], 0, 20, 'UTF-8' ) ) . '" />
157 + <input type="hidden" name="NAME2" value="' . esc_attr( mb_substr( $usces_entries['customer']['name2'], 0, 20, 'UTF-8' ) ) . '" />
158 + <input type="hidden" name="KANA1" value="' . esc_attr( $kana1 ) . '" />
159 + <input type="hidden" name="KANA2" value="' . esc_attr( $kana2 ) . '" />
160 + <input type="hidden" name="YUBIN1" value="' . esc_attr( substr( str_replace( '-', '', $usces_entries['customer']['zipcode'] ), 0, 3 ) ) . '" />
161 + <input type="hidden" name="YUBIN2" value="' . esc_attr( substr( str_replace( '-', '', $usces_entries['customer']['zipcode'] ), 3, 4 ) ) . '" />
162 + <input type="hidden" name="ADD1" value="' . esc_attr( $usces_entries['customer']['pref'] . $usces_entries['customer']['address1'] ) . '" />
163 + <input type="hidden" name="ADD2" value="' . esc_attr( $usces_entries['customer']['address2'] ) . '" />
164 + <input type="hidden" name="ADD3" value="' . esc_attr( $usces_entries['customer']['address3'] ) . '" />
165 + <input type="hidden" name="TEL" value="' . esc_attr( str_replace( '-', '', mb_convert_kana( $usces_entries['customer']['tel'], 'a', 'UTF-8' ) ) ) . '" />
166 + <input type="hidden" name="MAIL" value="' . esc_attr( $usces_entries['customer']['mailaddress1'] ) . '" />
167 + <input type="hidden" name="TOTAL" value="' . $usces_entries['order']['total_full_price'] . '" />
168 + <input type="hidden" name="TAX" value="" />
169 + <input type="hidden" name="S_PAYDATE" value="' . date( 'Ymd', mktime( 0, 0, 0, (int) substr( $datestr, 5, 2 ), (int) substr( $datestr, 8, 2 ) + (int) $acting_opts['S_PAYDATE'], (int) substr( $datestr, 0, 4 ) ) ) . '" />
170 + <input type="hidden" name="SEIYAKUDATE" value="' . date( 'Ymd', mktime( 0, 0, 0, (int) substr( $datestr, 5, 2 ), (int) substr( $datestr, 8, 2 ), (int) substr( $datestr, 0, 4 ) ) ) . '" />
171 + <input type="hidden" name="BIKO" value="' . esc_attr( $biko ) . '" />';
172 +
173 + $mname_01 = '商品総額';
174 + $html .= '<input type="hidden" name="MNAME_01" value="' . $mname_01 . '" />
175 + <input type="hidden" name="MSUM_01" value="' . usces_crform( $usces_entries['order']['total_full_price'], false, false, 'return', false ) . '" />
176 + <input type="hidden" name="MNAME_02" value="" />
177 + <input type="hidden" name="MSUM_02" value="0" />
178 + <input type="hidden" name="MNAME_03" value="" />
179 + <input type="hidden" name="MSUM_03" value="0" />
180 + <input type="hidden" name="MNAME_04" value="" />
181 + <input type="hidden" name="MSUM_04" value="0" />
182 + <input type="hidden" name="MNAME_05" value="" />
183 + <input type="hidden" name="MSUM_05" value="0" />
184 + <input type="hidden" name="MNAME_06" value="" />
185 + <input type="hidden" name="MSUM_06" value="0" />
186 + <input type="hidden" name="MNAME_07" value="" />
187 + <input type="hidden" name="MSUM_07" value="0" />';
188 +
189 + $html .= '<input type="hidden" name="RETURL" value="' . USCES_CART_URL . $usces->delim . 'acting=remise_conv&acting_return=1" />
190 + <input type="hidden" name="NG_RETURL" value="' . USCES_CART_URL . $usces->delim . 'acting=remise_conv&acting_return=0" />
191 + <input type="hidden" name="OPT" value="1" />
192 + <input type="hidden" name="EXITURL" value="' . USCES_CART_URL . $usces->delim . 'confirm=1" />';
193 + $html .= '
194 + <input type="hidden" name="dummy" value="&#65533;" />
195 + <div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="' . $checkout_button_value . '"' . apply_filters( 'usces_filter_confirm_nextbutton', ' onClick="document.charset=\'Shift_JIS\';"' ) . $purchase_disabled . ' /></div>';
196 + $html = apply_filters( 'usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled );
197 + $html .= '</form>';
198 + $html .= '<form action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
199 + <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="' . __( 'Back', 'usces' ) . '"' . apply_filters( 'usces_filter_confirm_prebutton', null ) . ' /></div>';
200 + $html = apply_filters( 'usces_filter_confirm_inform_back', $html );
201 + $html .= '</form>';
202 + break;
203 +
204 + case 'acting_jpayment_card': /* ROBOT PAYMENT クレジット決済(旧J-Payment、旧クラウドペイメント) */
205 + $acting_opts = $usces->options['acting_settings']['jpayment'];
206 + $usces->save_order_acting_data( $rand );
207 + usces_save_order_acting_data( $rand );
208 + $itemname = $usces->getItemName( $cart[0]['post_id'] );
209 + if ( 1 < $cart_count ) {
210 + $itemname .= ',' . __( 'Others', 'usces' );
211 + }
212 + if ( 50 < mb_strlen( $itemname, 'UTF-8' ) ) {
213 + $itemname = mb_substr( $itemname, 0, 50, 'UTF-8' ) . '...';
214 + }
215 + $quantity = 0;
216 + foreach ( $cart as $cart_row ) {
217 + $quantity += $cart_row['quantity'];
218 + }
219 + $desc = $itemname . ' ' . __( 'Quantity', 'usces' ) . ':' . $quantity;
220 +
221 + $tx = ( 'exclude' == $usces->options['tax_mode'] ) ? $usces_entries['order']['tax'] : 0;
222 + $sf = ( ! empty( $usces_entries['order']['shipping_charge'] ) ) ? $usces_entries['order']['shipping_charge'] : 0;
223 + $am = $usces_entries['order']['total_full_price'] - $tx - $sf;
224 + if ( 0 > $am ) {
225 + $tx = 0;
226 + $sf = 0;
227 + $am = $usces_entries['order']['total_full_price'];
228 + }
229 +
230 + $purchase_html = '<form id="purchase_form" name="purchase_form" action="' . $acting_opts['send_url'] . '" method="post" onKeyDown="if(event.keyCode == 13) {return false;}" >
231 + <input type="hidden" name="aid" value="' . $acting_opts['aid'] . '" />
232 + <input type="hidden" name="cod" value="' . $rand . '" />
233 + <input type="hidden" name="jb" value="' . $acting_opts['card_jb'] . '" />
234 + <input type="hidden" name="am" value="' . $am . '" />
235 + <input type="hidden" name="tx" value="' . $tx . '" />
236 + <input type="hidden" name="sf" value="' . $sf . '" />
237 + <input type="hidden" name="pt" value="1" />
238 + <input type="hidden" name="inm" value="' . esc_attr( $desc ) . '" />
239 + <input type="hidden" name="pn" value="' . esc_attr( str_replace( '-', '', mb_convert_kana( $usces_entries['customer']['tel'], 'a', 'UTF-8' ) ) ) . '" />
240 + <input type="hidden" name="em" value="' . esc_attr( $usces_entries['customer']['mailaddress1'] ) . '" />
241 + <input type="hidden" name="acting" value="jpayment_card" />
242 + <input type="hidden" name="acting_return" value="1" />
243 + <input type="hidden" name="page_id" value="' . USCES_CART_NUMBER . '" />
244 + ';
245 + $purchase_html .= '<div class="send"><input name="purchase_jpayment" type="submit" id="purchase_button" class="checkout_button" value="' . $checkout_button_value . '"' . apply_filters( 'usces_filter_confirm_nextbutton', null ) . $purchase_disabled . ' /></div>';
246 + $html .= apply_filters( 'usces_filter_confirm_inform', $purchase_html, $payments, $acting_flag, $rand, $purchase_disabled );
247 + $html .= '</form>';
248 + $purchase_html = '<form action="' . USCES_CART_URL . '" method="post" onKeyDown="if(event.keyCode == 13) {return false;}">
249 + <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="' . __( 'Back', 'usces' ) . '"' . apply_filters( 'usces_filter_confirm_prebutton', null ) . ' /></div>';
250 + $html .= apply_filters( 'usces_filter_confirm_inform_back', $purchase_html );
251 + $html .= '</form>';
252 + break;
253 +
254 + case 'acting_jpayment_conv': /* ROBOT PAYMENT コンビニ・ペーパーレス決済(旧J-Payment、旧クラウドペイメント) */
255 + $acting_opts = $usces->options['acting_settings']['jpayment'];
256 + $usces->save_order_acting_data( $rand );
257 + usces_save_order_acting_data( $rand );
258 + $itemname = $usces->getItemName( $cart[0]['post_id'] );
259 + if ( 1 < $cart_count ) {
260 + $itemname .= ',' . __( 'Others', 'usces' );
261 + }
262 + if ( 50 < mb_strlen( $itemname, 'UTF-8' ) ) {
263 + $itemname = mb_substr( $itemname, 0, 50, 'UTF-8' ) . '...';
264 + }
265 + $quantity = 0;
266 + foreach ( $cart as $cart_row ) {
267 + $quantity += $cart_row['quantity'];
268 + }
269 + $desc = $itemname . ' ' . __( 'Quantity', 'usces' ) . ':' . $quantity;
270 +
271 + $tx = ( 'exclude' == $usces->options['tax_mode'] ) ? $usces_entries['order']['tax'] : 0;
272 + $sf = ( ! empty( $usces_entries['order']['shipping_charge'] ) ) ? $usces_entries['order']['shipping_charge'] : 0;
273 + $am = $usces_entries['order']['total_full_price'] - $tx - $sf;
274 + if ( 0 > $am ) {
275 + $tx = 0;
276 + $sf = 0;
277 + $am = $usces_entries['order']['total_full_price'];
278 + }
279 +
280 + $html .= '<form id="purchase_form" name="purchase_form" action="' . $acting_opts['send_url'] . '" method="post" onKeyDown="if(event.keyCode == 13) {return false;}" >
281 + <input type="hidden" name="aid" value="' . $acting_opts['aid'] . '" />
282 + <input type="hidden" name="cod" value="' . $rand . '" />
283 + <input type="hidden" name="jb" value="CAPTURE" />
284 + <input type="hidden" name="am" value="' . $am . '" />
285 + <input type="hidden" name="tx" value="' . $tx . '" />
286 + <input type="hidden" name="sf" value="' . $sf . '" />
287 + <input type="hidden" name="pt" value="2" />
288 + <input type="hidden" name="inm" value="' . esc_attr( $desc ) . '" />
289 + <input type="hidden" name="pn" value="' . esc_attr( str_replace( '-', '', mb_convert_kana( $usces_entries['customer']['tel'], 'a', 'UTF-8' ) ) ) . '" />
290 + <input type="hidden" name="em" value="' . esc_attr( $usces_entries['customer']['mailaddress1'] ) . '" />
291 + <input type="hidden" name="acting" value="jpayment_conv" />
292 + <input type="hidden" name="acting_return" value="1" />
293 + <input type="hidden" name="page_id" value="' . USCES_CART_NUMBER . '" />
294 + ';
295 + $html .= '<div class="send"><input name="purchase_jpayment" type="submit" id="purchase_button" class="checkout_button" value="' . $checkout_button_value . '"' . apply_filters( 'usces_filter_confirm_nextbutton', null ) . $purchase_disabled . ' /></div>';
296 + $html = apply_filters( 'usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled );
297 + $html .= '</form>';
298 + $html .= '<form action="' . USCES_CART_URL . '" method="post" onKeyDown="if(event.keyCode == 13) {return false;}">
299 + <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="' . __( 'Back', 'usces' ) . '"' . apply_filters( 'usces_filter_confirm_prebutton', null ) . ' /></div>';
300 + $html = apply_filters( 'usces_filter_confirm_inform_back', $html );
301 + $html .= '</form>';
302 + break;
303 +
304 + case 'acting_jpayment_bank': /* ROBOT PAYMENT バンクチェック決済(旧J-Payment、旧クラウドペイメント) */
305 + $acting_opts = $usces->options['acting_settings']['jpayment'];
306 + $usces->save_order_acting_data( $rand );
307 + usces_save_order_acting_data( $rand );
308 + $itemname = $usces->getItemName( $cart[0]['post_id'] );
309 + if ( 1 < $cart_count ) {
310 + $itemname .= ',' . __( 'Others', 'usces' );
311 + }
312 + if ( 50 < mb_strlen( $itemname, 'UTF-8' ) ) {
313 + $itemname = mb_substr( $itemname, 0, 50, 'UTF-8' ) . '...';
314 + }
315 + $quantity = 0;
316 + foreach ( $cart as $cart_row ) {
317 + $quantity += $cart_row['quantity'];
318 + }
319 + $desc = $itemname . ' ' . __( 'Quantity', 'usces' ) . ':' . $quantity;
320 +
321 + $tx = ( 'exclude' == $usces->options['tax_mode'] ) ? $usces_entries['order']['tax'] : 0;
322 + $sf = ( ! empty( $usces_entries['order']['shipping_charge'] ) ) ? $usces_entries['order']['shipping_charge'] : 0;
323 + $am = $usces_entries['order']['total_full_price'] - $tx - $sf;
324 + if ( 0 > $am ) {
325 + $tx = 0;
326 + $sf = 0;
327 + $am = $usces_entries['order']['total_full_price'];
328 + }
329 +
330 + $html .= '<form id="purchase_form" name="purchase_form" action="' . $acting_opts['send_url'] . '" method="post" onKeyDown="if(event.keyCode == 13) {return false;}" >
331 + <input type="hidden" name="aid" value="' . $acting_opts['aid'] . '" />
332 + <input type="hidden" name="cod" value="' . $rand . '" />
333 + <input type="hidden" name="jb" value="CAPTURE" />
334 + <input type="hidden" name="am" value="' . $am . '" />
335 + <input type="hidden" name="tx" value="' . $tx . '" />
336 + <input type="hidden" name="sf" value="' . $sf . '" />
337 + <input type="hidden" name="pt" value="7" />
338 + <input type="hidden" name="inm" value="' . esc_attr( $desc ) . '" />
339 + <input type="hidden" name="pn" value="' . esc_attr( str_replace( '-', '', mb_convert_kana( $usces_entries['customer']['tel'], 'a', 'UTF-8' ) ) ) . '" />
340 + <input type="hidden" name="em" value="' . esc_attr( $usces_entries['customer']['mailaddress1'] ) . '" />
341 + <input type="hidden" name="acting" value="jpayment_bank" />
342 + <input type="hidden" name="acting_return" value="1" />
343 + <input type="hidden" name="page_id" value="' . USCES_CART_NUMBER . '" />
344 + ';
345 + $html .= '<div class="send"><input name="purchase_jpayment" type="submit" id="purchase_button" class="checkout_button" value="' . $checkout_button_value . '"' . apply_filters( 'usces_filter_confirm_nextbutton', null ) . $purchase_disabled . ' /></div>';
346 + $html = apply_filters( 'usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled );
347 + $html .= '</form>';
348 + $html .= '<form action="' . USCES_CART_URL . '" method="post" onKeyDown="if(event.keyCode == 13) {return false;}">
349 + <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="' . __( 'Back', 'usces' ) . '"' . apply_filters( 'usces_filter_confirm_prebutton', null ) . ' /></div>';
350 + $html = apply_filters( 'usces_filter_confirm_inform_back', $html );
351 + $html .= '</form>';
352 + break;
353 +
354 + case 'acting_telecom_card': /* テレコムクレジット カード決済 */
355 + usces_save_order_acting_data( $rand );
356 + $acting_opts = $usces->options['acting_settings']['telecom'];
357 + $member = $usces->get_member();
358 + if ( empty( $member['ID'] ) || 'on' != $acting_opts['oneclick'] ) {
359 + $memid = ( ! empty( $member['ID'] ) ) ? $member['ID'] : 99999999;
360 + $send_url = $acting_opts['send_url'];
361 + } else {
362 + $memid = $member['ID'];
363 + $oneclick = $usces->get_member_meta_value( 'telecom_oneclick', $member['ID'] );
364 + if ( null != $oneclick ) {
365 + $send_url = $acting_opts['oneclick_send_url'];
366 + } else {
367 + $send_url = $acting_opts['send_url'];
368 + }
369 + }
370 + $money = ( '$' == usces_get_cr_symbol() ) ? '$' : '';
371 + $money .= usces_crform( $usces_entries['order']['total_full_price'], false, false, 'return', false );
372 + $tel = str_replace( '-', '', $usces_entries['customer']['tel'] );
373 + $redirect_url = USCES_CART_URL . $usces->delim . 'acting=telecom_card&acting_return=1&result=1&option=' . $rand;
374 + $redirect_back_url = USCES_CART_URL . $usces->delim . 'confirm=1';
375 + $html .= '<form id="purchase_form" action="' . $send_url . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
376 + <input type="hidden" name="clientip" value="' . $acting_opts['clientip'] . '">
377 + <input type="hidden" name="money" value="' . apply_filters( 'usces_filter_acting_amount', $money, $acting_flag ) . '">
378 + <input type="hidden" name="sendid" value="' . $memid . '">
379 + <input type="hidden" name="usrtel" value="' . $tel . '">
380 + <input type="hidden" name="usrmail" value="' . esc_attr( $usces_entries['customer']['mailaddress1'] ) . '">
381 + <input type="hidden" name="redirect_url" value="' . $redirect_url . '">
382 + <input type="hidden" name="redirect_back_url" value="' . $redirect_back_url . '">
383 + <input type="hidden" name="option" value="' . $rand . '">';
384 +
385 + $html .= '<div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="' . $checkout_button_value . '"' . apply_filters( 'usces_filter_confirm_nextbutton', null ) . $purchase_disabled . ' /></div>';
386 + $html = apply_filters( 'usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled );
387 + $html .= '</form>';
388 + $html .= '<form action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
389 + <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="' . __( 'Back', 'usces' ) . '"' . apply_filters( 'usces_filter_confirm_prebutton', null ) . ' /></div>';
390 + $html = apply_filters( 'usces_filter_confirm_inform_back', $html );
391 + $html .= '</form>';
392 + break;
393 +
394 + case 'acting_telecom_edy': /* テレコムクレジット Edy決済 */
395 + usces_save_order_acting_data( $rand );
396 + $acting_opts = $usces->options['acting_settings']['telecom'];
397 + $member = $usces->get_member();
398 + $memid = empty( $member['ID'] ) ? 99999999 : $member['ID'];
399 + $money = ( '$' == usces_get_cr_symbol() ) ? '$' : '';
400 + $money .= usces_crform( $usces_entries['order']['total_full_price'], false, false, 'return', false );
401 + $redirect_back_url = USCES_CART_URL . $usces->delim . 'acting=telecom_edy&acting_return=1&reg_order=1';
402 + $html .= '<form id="purchase_form" action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
403 + <input type="hidden" name="clientip" value="' . $acting_opts['clientip'] . '">
404 + <input type="hidden" name="sendid" value="' . $memid . '">
405 + <input type="hidden" name="money" value="' . apply_filters( 'usces_filter_acting_amount', $money, $acting_flag ) . '">
406 + <input type="hidden" name="redirect_back_url" value="' . $redirect_back_url . '">
407 + <input type="hidden" name="option" value="' . $rand . '">';
408 +
409 + $html .= '<div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="' . $checkout_button_value . '"' . apply_filters( 'usces_filter_confirm_nextbutton', null ) . $purchase_disabled . ' /></div>';
410 + $html = apply_filters( 'usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled );
411 + $html .= '</form>';
412 + $html .= '<form action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
413 + <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="' . __( 'Back', 'usces' ) . '"' . apply_filters( 'usces_filter_confirm_prebutton', null ) . ' /></div>';
414 + $html = apply_filters( 'usces_filter_confirm_inform_back', $html );
415 + $html .= '</form>';
416 + break;
417 +
418 + case 'acting_digitalcheck_card': /* ペイメントフォー カード決済(旧メタップスペイメント、旧デジタルチェック、旧ペイデザイン) */
419 + $acting_opts = $usces->options['acting_settings']['digitalcheck'];
420 + $sid = uniqid();
421 + $usces->save_order_acting_data( $sid );
422 + usces_save_order_acting_data( $sid );
423 + $member = $usces->get_member();
424 + if ( 'on' == $acting_opts['card_user_id'] && $usces->is_member_logged_in() ) {
425 + $ip_user_id = $usces->get_member_meta_value( 'digitalcheck_ip_user_id', $member['ID'] );
426 + if ( empty( $ip_user_id ) ) {
427 + $ip_user_id = $member['ID'];
428 + $send_url = $acting_opts['send_url_card'];
429 + $fuka = $acting_flag . $ip_user_id;
430 + } else {
431 + $send_url = USCES_CART_URL;
432 + $fuka = $acting_flag;
433 + }
434 + } else {
435 + $ip_user_id = false;
436 + $send_url = $acting_opts['send_url_card'];
437 + $fuka = $acting_flag;
438 + }
439 + $item_name = $usces->getItemName( $cart[0]['post_id'] );
440 + if ( 1 < $cart_count ) {
441 + $item_name .= ',' . __( 'Others', 'usces' );
442 + }
443 + if ( 22 < mb_strlen( $item_name ) ) {
444 + $item_name = mb_strimwidth( $item_name, 0, 44, '...', 'UTF-8' );
445 + }
446 + $kakutei = ( empty( $acting_opts['card_kakutei'] ) ) ? '0' : $acting_opts['card_kakutei'];
447 + $html .= '<form id="purchase_form" name="purchase_form" action="' . $send_url . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}" accept-charset="Shift_JIS">
448 + <input type="hidden" name="IP" value="' . $acting_opts['card_ip'] . '" />
449 + <input type="hidden" name="SID" value="' . $sid . '" />
450 + <input type="hidden" name="N1" value="' . esc_attr( $item_name ) . '">
451 + <input type="hidden" name="K1" value="' . usces_crform( $usces_entries['order']['total_full_price'], false, false, 'return', false ) . '">
452 + <input type="hidden" name="FUKA" value="' . $fuka . '" />
453 + <input type="hidden" name="KAKUTEI" value="' . $kakutei . '" />
454 + <input type="hidden" name="STORE" value="51" />
455 + <input type="hidden" name="NAME1" value="' . esc_attr( mb_strimwidth( $usces_entries['customer']['name1'], 0, 20, '', 'UTF-8' ) ) . '" />
456 + <input type="hidden" name="NAME2" value="' . esc_attr( mb_strimwidth( $usces_entries['customer']['name2'], 0, 20, '', 'UTF-8' ) ) . '" />
457 + <input type="hidden" name="KANA1" value="' . esc_attr( mb_strimwidth( $usces_entries['customer']['name3'], 0, 20, '', 'UTF-8' ) ) . '" />
458 + <input type="hidden" name="KANA2" value="' . esc_attr( mb_strimwidth( $usces_entries['customer']['name4'], 0, 20, '', 'UTF-8' ) ) . '" />
459 + <input type="hidden" name="YUBIN1" value="' . esc_attr( substr( str_replace( '-', '', mb_convert_kana( $usces_entries['customer']['zipcode'], 'a', 'UTF-8' ) ), 0, 7 ) ) . '" />
460 + <input type="hidden" name="TEL" value="' . esc_attr( substr( str_replace( '-', '', mb_convert_kana( $usces_entries['customer']['tel'], 'a', 'UTF-8' ) ), 0, 11 ) ) . '" />
461 + <input type="hidden" name="ADR1" value="' . esc_attr( mb_strimwidth( $usces_entries['customer']['pref'] . $usces_entries['customer']['address1'] . $usces_entries['customer']['address2'], 0, 50, '', 'UTF-8' ) ) . '" />
462 + <input type="hidden" name="ADR2" value="' . esc_attr( mb_strimwidth( $usces_entries['customer']['address3'], 0, 50, '', 'UTF-8' ) ) . '" />
463 + <input type="hidden" name="MAIL" value="' . esc_attr( $usces_entries['customer']['mailaddress1'] ) . '" />';
464 + if ( $ip_user_id ) {
465 + $html .= '<input type="hidden" name="PASS" value="' . $acting_opts['card_pass'] . '">
466 + <input type="hidden" name="IP_USER_ID" value="' . $ip_user_id . '">';
467 + }
468 + if ( $usces->use_ssl ) {
469 + $ssl_url = $usces->options['ssl_url'] . '/?page_id=' . USCES_CART_NUMBER;
470 + $html .= '<input type="hidden" name="OKURL" value="' . $ssl_url . $usces->delim . 'acting=digitalcheck_card&acting_return=1" />
471 + <input type="hidden" name="RT" value="' . $ssl_url . $usces->delim . 'acting=digitalcheck_card&confirm=1" />';
472 + } else {
473 + $html .= '<input type="hidden" name="OKURL" value="' . USCES_CART_URL . $usces->delim . 'acting=digitalcheck_card&acting_return=1" />
474 + <input type="hidden" name="RT" value="' . USCES_CART_URL . $usces->delim . 'acting=digitalcheck_card&confirm=1" />';
475 + }
476 + $html .= '<input type="hidden" name="dummy" value="&#65533;" />';
477 + $html .= '<div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="' . $checkout_button_value . '"' . apply_filters( 'usces_filter_confirm_nextbutton', ' onClick="document.charset=\'Shift_JIS\';"' ) . $purchase_disabled . ' /></div>';
478 + $html = apply_filters( 'usces_filter_confirm_inform', $html, $payments, $acting_flag, $sid, $purchase_disabled );
479 + $html .= '</form>';
480 + $html .= '<form action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
481 + <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="' . __( 'Back', 'usces' ) . '"' . apply_filters( 'usces_filter_confirm_prebutton', null ) . ' /></div>';
482 + $html = apply_filters( 'usces_filter_confirm_inform_back', $html );
483 + $html .= '</form>';
484 + break;
485 +
486 + case 'acting_digitalcheck_conv': /* ペイメントフォー コンビニ決済(旧メタップスペイメント、旧デジタルチェック、旧ペイデザイン) */
487 + $acting_opts = $usces->options['acting_settings']['digitalcheck'];
488 + $sid = uniqid();
489 + $usces->save_order_acting_data( $sid );
490 + usces_save_order_acting_data( $sid );
491 + $item_name = $usces->getItemName( $cart[0]['post_id'] );
492 + if ( 1 < $cart_count ) {
493 + $item_name .= ',' . __( 'Others', 'usces' );
494 + }
495 + if ( 22 < mb_strlen( $item_name ) ) {
496 + $item_name = mb_strimwidth( $item_name, 0, 44, '...', 'UTF-8' );
497 + }
498 + $today = wp_date( 'Y-m-d' );
499 + list( $year, $month, $day ) = explode( '-', $today );
500 + $kigen = date( 'Ymd', mktime( 0, 0, 0, (int) $month, (int) $day + (int) $acting_opts['conv_kigen'], (int) $year ) );
501 + $conv_store = ( isset( $acting_opts['conv_store'] ) && is_array( $acting_opts['conv_store'] ) ) ? $acting_opts['conv_store'] : array();
502 + $store = ( 1 == count( $conv_store ) ) ? $conv_store[0] : '99';
503 + $html .= '<form id="purchase_form" name="purchase_form" action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}" accept-charset="Shift_JIS">
504 + <input type="hidden" name="IP" value="' . $acting_opts['conv_ip'] . '" />
505 + <input type="hidden" name="SID" value="' . $sid . '" />
506 + <input type="hidden" name="N1" value="' . esc_attr( $item_name ) . '">
507 + <input type="hidden" name="K1" value="' . usces_crform( $usces_entries['order']['total_full_price'], false, false, 'return', false ) . '">
508 + <input type="hidden" name="STORE" value="' . $store . '" />
509 + <input type="hidden" name="FUKA" value="' . $acting_flag . '" />
510 + <input type="hidden" name="KIGEN" value="' . $kigen . '" />
511 + <input type="hidden" name="NAME1" value="' . esc_attr( mb_strimwidth( $usces_entries['customer']['name1'], 0, 20, '', 'UTF-8' ) ) . '" />
512 + <input type="hidden" name="NAME2" value="' . esc_attr( mb_strimwidth( $usces_entries['customer']['name2'], 0, 20, '', 'UTF-8' ) ) . '" />
513 + <input type="hidden" name="KANA1" value="' . esc_attr( mb_strimwidth( $usces_entries['customer']['name3'], 0, 20, '', 'UTF-8' ) ) . '" />
514 + <input type="hidden" name="KANA2" value="' . esc_attr( mb_strimwidth( $usces_entries['customer']['name4'], 0, 20, '', 'UTF-8' ) ) . '" />
515 + <input type="hidden" name="YUBIN1" value="' . esc_attr( substr( str_replace( '-', '', mb_convert_kana( $usces_entries['customer']['zipcode'], 'a', 'UTF-8' ) ), 0, 7 ) ) . '" />
516 + <input type="hidden" name="TEL" value="' . esc_attr( substr( str_replace( '-', '', mb_convert_kana( $usces_entries['customer']['tel'], 'a', 'UTF-8' ) ), 0, 11 ) ) . '" />
517 + <input type="hidden" name="ADR1" value="' . esc_attr( mb_strimwidth( $usces_entries['customer']['pref'] . $usces_entries['customer']['address1'] . $usces_entries['customer']['address2'], 0, 50, '', 'UTF-8' ) ) . '" />
518 + <input type="hidden" name="ADR2" value="' . esc_attr( mb_strimwidth( $usces_entries['customer']['address3'], 0, 50, '', 'UTF-8' ) ) . '" />
519 + <input type="hidden" name="MAIL" value="' . esc_attr( $usces_entries['customer']['mailaddress1'] ) . '" />';
520 + if ( $usces->use_ssl ) {
521 + $ssl_url = $usces->options['ssl_url'] . '/?page_id=' . USCES_CART_NUMBER;
522 + $html .= '<input type="hidden" name="OKURL" value="' . $ssl_url . $usces->delim . 'acting=digitalcheck_conv&acting_return=1" />
523 + <input type="hidden" name="RT" value="' . $ssl_url . $usces->delim . 'acting=digitalcheck_conv&confirm=1" />';
524 + } else {
525 + $html .= '<input type="hidden" name="OKURL" value="' . USCES_CART_URL . $usces->delim . 'acting=digitalcheck_conv&acting_return=1" />
526 + <input type="hidden" name="RT" value="' . USCES_CART_URL . $usces->delim . 'acting=digitalcheck_conv&confirm=1" />';
527 + }
528 + $html .= '<input type="hidden" name="dummy" value="&#65533;" />';
529 + $html .= '<div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="' . $checkout_button_value . '"' . apply_filters( 'usces_filter_confirm_nextbutton', ' onClick="document.charset=\'Shift_JIS\';"' ) . $purchase_disabled . ' /></div>';
530 + $html = apply_filters( 'usces_filter_confirm_inform', $html, $payments, $acting_flag, $sid, $purchase_disabled );
531 + $html .= '</form>';
532 + $html .= '<form action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
533 + <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="' . __( 'Back', 'usces' ) . '"' . apply_filters( 'usces_filter_confirm_prebutton', null ) . ' /></div>';
534 + $html = apply_filters( 'usces_filter_confirm_inform_back', $html );
535 + $html .= '</form>';
536 + break;
537 +
538 + case 'acting_mizuho_card': /* みずほファクター カード決済 */
539 + $acting_opts = $usces->options['acting_settings']['mizuho'];
540 + $send_url = ( 'public' == $acting_opts['ope'] ) ? $acting_opts['send_url'] : $acting_opts['send_url_test'];
541 + $p_ver = '0200';
542 + $stdate = wp_date( 'Ymd' );
543 + $stran = usces_rand( 6 );
544 + usces_save_order_acting_data( $stran );
545 + $bkcode = 'bg01';
546 + $amount = apply_filters( 'usces_filter_acting_amount', usces_crform( $usces_entries['order']['total_full_price'], false, false, 'return', false ), $acting_flag );
547 + $schksum = $p_ver . $stdate . $stran . $bkcode . $acting_opts['shopid'] . $acting_opts['cshopid'] . $amount . $acting_opts['hash_pass'];
548 + $schksum = htmlspecialchars( md5( $schksum ), ENT_COMPAT );
549 + $html .= '<form id="purchase_form" action="' . $send_url . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}" accept-charset="Shift_JIS">
550 + <input type="hidden" name="p_ver" value="' . $p_ver . '">
551 + <input type="hidden" name="stdate" value="' . $stdate . '">
552 + <input type="hidden" name="stran" value="' . $stran . '">
553 + <input type="hidden" name="bkcode" value="' . $bkcode . '">
554 + <input type="hidden" name="shopid" value="' . $acting_opts['shopid'] . '">
555 + <input type="hidden" name="cshopid" value="' . $acting_opts['cshopid'] . '">
556 + <input type="hidden" name="amount" value="' . $amount . '">
557 + <input type="hidden" name="schksum" value="' . $schksum . '">';
558 + $html .= '<input type="hidden" name="dummy" value="&#65533;" />';
559 + $html .= '<div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="' . $checkout_button_value . '"' . apply_filters( 'usces_filter_confirm_nextbutton', ' onClick="document.charset=\'Shift_JIS\';"' ) . $purchase_disabled . ' /></div>';
560 + $html = apply_filters( 'usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled );
561 + $html .= '</form>';
562 + $html .= '<form action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
563 + <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="' . __( 'Back', 'usces' ) . '"' . apply_filters( 'usces_filter_confirm_prebutton', null ) . ' /></div>';
564 + $html = apply_filters( 'usces_filter_confirm_inform_back', $html );
565 + $html .= '</form>';
566 + break;
567 +
568 + case 'acting_mizuho_conv1': /* みずほファクター コンビニ・ウェルネット決済 */
569 + case 'acting_mizuho_conv2': /* みずほファクター コンビニ・セブンイレブン決済 */
570 + $acting_opts = $usces->options['acting_settings']['mizuho'];
571 + $send_url = ( 'public' == $acting_opts['ope'] ) ? $acting_opts['send_url'] : $acting_opts['send_url_test'];
572 + $p_ver = '0200';
573 + $stdate = wp_date( 'Ymd' );
574 + $stran = usces_rand( 6 );
575 + usces_save_order_acting_data( $stran );
576 + $bkcode = 'cv0' . substr( $acting_flag, -1 );
577 + $amount = apply_filters( 'usces_filter_acting_amount', usces_crform( $usces_entries['order']['total_full_price'], false, false, 'return', false ), $acting_flag );
578 + $custmkanji = mb_strimwidth( $usces_entries['customer']['name1'] . $usces_entries['customer']['name2'], 0, 40, '', 'UTF-8' );
579 + $mailaddr = esc_attr( $usces_entries['customer']['mailaddress1'] );
580 + $tel = str_replace( '-', '', $usces_entries['customer']['tel'] );
581 + $schksum = $p_ver . $stdate . $stran . $bkcode . $acting_opts['shopid'] . $acting_opts['cshopid'] . $amount . mb_convert_encoding( $custmkanji, 'SJIS', 'UTF-8' ) . $mailaddr . $tel . $acting_opts['hash_pass'];
582 + $schksum = htmlspecialchars( md5( $schksum ), ENT_COMPAT );
583 + $html .= '<form id="purchase_form" action="' . $send_url . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
584 + <input type="hidden" name="p_ver" value="' . $p_ver . '">
585 + <input type="hidden" name="stdate" value="' . $stdate . '">
586 + <input type="hidden" name="stran" value="' . $stran . '">
587 + <input type="hidden" name="bkcode" value="' . $bkcode . '">
588 + <input type="hidden" name="shopid" value="' . $acting_opts['shopid'] . '">
589 + <input type="hidden" name="cshopid" value="' . $acting_opts['cshopid'] . '">
590 + <input type="hidden" name="amount" value="' . $amount . '">
591 + <input type="hidden" name="custmKanji" value="' . $custmkanji . '">
592 + <input type="hidden" name="mailaddr" value="' . $mailaddr . '">
593 + <input type="hidden" name="tel" value="' . $tel . '">
594 + <input type="hidden" name="schksum" value="' . $schksum . '">';
595 + $html .= '<input type="hidden" name="dummy" value="&#65533;" />';
596 + $html .= '<div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="' . $checkout_button_value . '"' . apply_filters( 'usces_filter_confirm_nextbutton', ' onClick="document.charset=\'Shift_JIS\';"' ) . $purchase_disabled . ' /></div>';
597 + $html = apply_filters( 'usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled );
598 + $html .= '</form>';
599 + $html .= '<form action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
600 + <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="' . __( 'Back', 'usces' ) . '"' . apply_filters( 'usces_filter_confirm_prebutton', null ) . ' /></div>';
601 + $html = apply_filters( 'usces_filter_confirm_inform_back', $html );
602 + $html .= '</form>';
603 + break;
604 +
605 + case 'acting_anotherlane_card': /* アナザーレーン カード決済 */
606 + $usces->save_order_acting_data( $rand );
607 + usces_save_order_acting_data( $rand );
608 + $acting_opts = $usces->options['acting_settings']['anotherlane'];
609 + $amount = apply_filters( 'usces_filter_acting_amount', usces_crform( $usces_entries['order']['total_full_price'], false, false, 'return', false ), $acting_flag );
610 + $html .= '<form id="purchase_form" name="purchase_form" action="' . $acting_opts['send_url'] . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}" accept-charset="UTF-8">
611 + <input type="hidden" name="SiteId" value="' . $acting_opts['siteid'] . '">
612 + <input type="hidden" name="SitePass" value="' . $acting_opts['sitepass'] . '">
613 + <input type="hidden" name="Amount" value="' . $amount . '">
614 + <input type="hidden" name="TransactionId" value="">
615 + <input type="hidden" name="zip" value="' . esc_attr( str_replace( '-', '', $usces_entries['customer']['zipcode'] ) ) . '">
616 + <input type="hidden" name="capital" value="' . esc_attr( $usces_entries['customer']['pref'] ) . '">
617 + <input type="hidden" name="adr1" value="' . esc_attr( $usces_entries['customer']['address1'] ) . '">
618 + <input type="hidden" name="adr2" value="' . esc_attr( $usces_entries['customer']['address2'] ) . '">
619 + <input type="hidden" name="adr3" value="' . esc_attr( $usces_entries['customer']['address3'] ) . '">
620 + <input type="hidden" name="name" value="' . esc_attr( mb_substr( $usces_entries['customer']['name1'] . $usces_entries['customer']['name2'], 0, 25, 'UTF-8' ) ) . '" />
621 + <input type="hidden" name="tel" value="' . esc_attr( str_replace( '-', '', $usces_entries['customer']['tel'] ) ) . '" />
622 + <input type="hidden" name="mail" value="' . esc_attr( $usces_entries['customer']['mailaddress1'] ) . '">
623 + <input type="hidden" name="rand" value="' . $rand . '">
624 + <input type="hidden" name="note" value="' . $rand . '">';
625 + if ( 'on' == $acting_opts['quickcharge'] && $usces->is_member_logged_in() ) {
626 + $member = $usces->get_member();
627 + $html .= '<input type="hidden" name="CustomerId" value="' . esc_attr( $member['ID'] ) . '">';
628 + }
629 + $html .= '<div class="send"><input name="purchase_ali" type="submit" id="purchase_button" class="checkout_button" value="' . $checkout_button_value . '"' . apply_filters( 'usces_filter_confirm_nextbutton', ' onClick="document.charset=\'Shift_JIS\';"' ) . $purchase_disabled . ' /></div>';
630 + $html = apply_filters( 'usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled );
631 + $html .= '</form>';
632 + $html .= '<form action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
633 + <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="' . __( 'Back', 'usces' ) . '"' . apply_filters( 'usces_filter_confirm_prebutton', null ) . ' /></div>';
634 + $html = apply_filters( 'usces_filter_confirm_inform_back', $html );
635 + $html .= '</form>';
636 + break;
637 +
638 + case 'acting_veritrans_card': /* ベリトランス カード決済 */
639 + case 'acting_veritrans_conv': /* ベリトランス コンビニ決済 */
640 + $acting_opts = $usces->options['acting_settings']['veritrans'];
641 + $usces->save_order_acting_data( $rand );
642 + usces_save_order_acting_data( $rand );
643 + $settlement_type = ( 'acting_veritrans_card' == $acting_flag ) ? '01' : '02';
644 + $amount = apply_filters( 'usces_filter_acting_amount', usces_crform( $usces_entries['order']['total_full_price'], false, false, 'return', false ), $acting_flag );
645 + $ctx = hash_init( 'sha512' );
646 + $str = $acting_opts['merchanthash'] . ',' . $acting_opts['merchant_id'] . ',' . $settlement_type . ',' . $rand . ',' . $amount;
647 + hash_update( $ctx, $str );
648 + $hash = hash_final( $ctx, true );
649 + $merchanthash = bin2hex( $hash );
650 + $html .= '<form id="purchase_form" name="purchase_form" action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
651 + <input type="hidden" name="MERCHANTHASH" value="' . esc_attr( $merchanthash ) . '">
652 + <input type="hidden" name="SETTLEMENT_TYPE" value="' . esc_attr( $settlement_type ) . '">
653 + <input type="hidden" name="ORDER_ID" value="' . esc_attr( $rand ) . '">
654 + <input type="hidden" name="AMOUNT" value="' . esc_attr( $amount ) . '">';
655 + $html .= '<div class="send"><input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="' . $checkout_button_value . '"' . apply_filters( 'usces_filter_confirm_nextbutton', '' ) . $purchase_disabled . ' /></div>';
656 + $html = apply_filters( 'usces_filter_confirm_inform', $html, $payments, $acting_flag, $rand, $purchase_disabled );
657 + $html .= '</form>';
658 + $html .= '<form action="' . USCES_CART_URL . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
659 + <div class="send"><input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="' . __( 'Back', 'usces' ) . '"' . apply_filters( 'usces_filter_confirm_prebutton', null ) . ' /></div>';
660 + $html = apply_filters( 'usces_filter_confirm_inform_back', $html );
661 + $html .= '</form>';
662 + break;
663 +
664 + default:
665 + $purchase_html .= '<form id="purchase_form" action="' . apply_filters( 'usces_filter_acting_url', USCES_CART_URL ) . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}">
666 + ' . wp_nonce_field( 'wc_purchase_nonce', 'wc_purchase_nonce', true, false ) . '
667 + <div class="send">
668 + ' . apply_filters( 'usces_filter_confirm_before_backbutton', null, $payments, $acting_flag, $rand ) . '
669 + <input name="backDelivery" type="submit" id="back_button" class="back_to_delivery_button" value="' . __( 'Back', 'usces' ) . '"' . apply_filters( 'usces_filter_confirm_prebutton', null ) . ' />
670 + <input name="purchase" type="submit" id="purchase_button" class="checkout_button" value="' . $checkout_button_value . '"' . $purchase_disabled . ' /></div>';
671 + $html .= apply_filters( 'usces_filter_confirm_inform', $purchase_html, $payments, $acting_flag, $rand, $purchase_disabled );
672 + $html .= '</form>';
673 + }
674 +}