Merhabalar, çözemediğim bir problem için sizden yardım talep ediyorum.
Sitemde bir form var. Kişinin ismini adresini telefon numarasını alıyoruz. Formun altında da iki buton bulunuyor. Birincisi "kapıda ödeme" butonu. Bu butona tıklayınca kullanıcının forma doldurduğu bilgiler bize ulaşıyor ve kişiyi teşekkürler sayfasına atıyor. Hemen altında kişinin kredi kartı bilgilerini aldığımız küçük bir form ve onun altında da ikinci butonumuz olan "kredi kartı ile öde" butonu yer almaktadır. Bu butona tıklayınca ise kişinin ismini telefonunu adresini yazdığı formdaki bilgiler bize ulaşmıyor ama kişiden ödemeyi alıp teşekkür sayfasına atıyor.
Birinci butonda nasıl ki form bilgileri bize ulaşıyorsa ikinci butonda da bize ulaşsın istemekteyim.
Kodlar aşağıdadır.
<?php
defined( 'ABSPATH' ) || exit;
if ( ! is_ajax() ) {
do_action( 'woocommerce_review_order_before_payment' );
}
?>
<div id="payment" class="woocommerce-checkout-payment">
<?php if ( WC()->cart->needs_payment() ) : ?>
<ul class="wc_payment_methods payment_methods methods">
<?php
if ( ! empty( $available_gateways ) ) {
foreach ( $available_gateways as $gateway ) {
wc_get_template( 'checkout/payment-method.php', array( 'gateway' => $gateway ) );
}
} else {
echo '<li class="woocommerce-notice woocommerce-notice--info woocommerce-info">' . apply_filters( 'woocommerce_no_available_payment_methods_message', WC()->customer->get_billing_country() ? esc_html__( 'Sorry, it seems that there are no available payment methods for your state. Please contact us if you require assistance or wish to make alternate arrangements.', 'woocommerce' ) : esc_html__( 'Please fill in your details above to see available payment methods.', 'woocommerce' ) ) . '</li>'; // @codingStandardsIgnoreLine
}
?>
</ul>
<?php endif; ?>
<div class="form-row place-order">
<noscript>
<?php
/* translators: $1 and $2 opening and closing emphasis tags respectively */
printf( esc_html__( 'Since your browser does not support JavaScript, or it is disabled, please ensure you click the %1$sUpdate Totals%2$s button before placing your order. You may be charged more than the amount stated above if you fail to do so.', 'woocommerce' ), '<em>', '</em>' );
?>
<br/><button type="submit" class="button alt" name="woocommerce_checkout_update_totals" value="<?php esc_attr_e( 'Update totals', 'woocommerce' ); ?>"><?php esc_html_e( 'Update totals', 'woocommerce' ); ?></button>
</noscript>
<?php wc_get_template( 'checkout/terms.php' ); ?>
<?php do_action( 'woocommerce_review_order_before_submit' ); ?>
<?php echo apply_filters( 'woocommerce_order_button_html', '<button type="submit" class="button alt" name="woocommerce_checkout_place_order" id="place_order" value="' . esc_attr( $order_button_text ) . '" data-value="' . esc_attr( $order_button_text ) . '">' . esc_html( $order_button_text ) . '</button>' ); // @codingStandardsIgnoreLine ?>
<?php do_action( 'woocommerce_review_order_after_submit' ); ?>
<?php wp_nonce_field( 'woocommerce-process_checkout', 'woocommerce-process-checkout-nonce' ); ?>
<?php
$OkUrl="https://www.ronaxhome.com/index.php/odeme/"; //Language_OkUrl
$FailUrl="https://vpos.qnbfinansbank.com//Payfor.UI//PayforScripts//5//093900000023473//php//Payfor3DPayPayment.php"; //Language_FailUrl
$OrderId=""; //Siparis Numarasi
$OrgOrderId=""; //Orijinal Islem Siparis Numarasi
$PurchAmount="1"; //Tutar
$Lang="TR"; //Language_Lang
$rnd = microtime();
$hashstr = $MbrId . $OrderId . $PurchAmount . $OkUrl . $FailUrl . $TxnType . $InstallmentCount . $rnd . $MerchantPass;
$hash = base64_encode(pack('H*',sha1($hashstr)));
?>
<center>
<form method="post" action="https://vpos.qnbfinansbank.com/Gateway/Default.aspx">
<table class="tableClass">
<tr>
<td colspan='2'>
<h1>
Kredi Kartı İle Ödeme
</h1>
</td>
</tr>
<tr>
<td style="text-align: left">
Kart Sahibinin Adı :
</td>
<td style="text-align: left">
<input type="text" name="CardHolderName" maxlength="CloumnLength_CardHolderName" class="inputClass" value="" />
</tr>
<tr>
<td style="text-align: left">
Kredi Kart Numarasi :
</td>
<td style="text-align: left">
<input type="text" name="Pan" maxlength="19" class="inputClass" value="" />
</tr>
<tr>
<td style="text-align: left">
Guvenlik Kodu (Cvv) :
</td>
<td style="text-align: left">
<input type="text" name="Cvv2" maxlength="3" class="inputClass" value="" />
</tr>
<tr>
<td style="text-align: left">
Son Kullanma Tarihi (MMYY) :
</td>
<td style="text-align: left">
<input type="text" name="Expiry" maxlength="4" class="inputClass" value="" />
</tr>
<tr>
<td align='center' colspan='2'>
<input type='submit' value='Gonder' class='buttonClass'>
</td>
</tr>
</table>
<input type="hidden" name="MbrId" value="<?php echo $MbrId ?>">
<input type="hidden" name="MerchantID" value="<?php echo $MerchantID ?>">
<input type="hidden" name="UserCode" value="<?php echo $UserCode ?>">
<input type="hidden" name="SecureType" value="<?php echo $SecureType ?>">
<input type="hidden" name="TxnType" value="<?php echo $TxnType ?>">
<input type="hidden" name="InstallmentCount" value="<?php echo $InstallmentCount ?>">
<input type="hidden" name="Currency" value="<?php echo $Currency ?>">
<input type="hidden" name="OkUrl" value="<?php echo $OkUrl ?>">
<input type="hidden" name="FailUrl" value="<?php echo $FailUrl ?>">
<input type="hidden" name="OrderId" value="<?php echo $OrderId ?>">
<input type="hidden" name="OrgOrderId" value="<?php echo $OrgOrderId ?>">
<input type="hidden" name="PurchAmount" value="<?php echo $PurchAmount ?>">
<input type="hidden" name="Lang" value="<?php echo $Lang ?>">
<input type="hidden" name="Rnd" value="<?php echo $rnd?>">
<input type="hidden" name="Hash" value="<?php echo $hash?>">
</form>
</center>
<?php
if ( ! is_ajax() ) {
do_action( 'woocommerce_review_order_after_payment' );
}