| 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="�" />'; |
| 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="�" /> |
| 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®_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="�" />'; |
| 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="�" />'; |
| 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="�" />'; |
| 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="�" />'; |
| 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 |
} |
| 675 |
|