IP_CAM wrote: ↑Sat Dec 28, 2019 9:28 am
Well, below are all the Variables, as they exist in a default OC .1.5.6.4
twocheckout.tpl File,
but most (failed one's) of those shown in your Posting do not exist. You seem to use another Extension
(or Module) for this in your Custom Theme, as it looks.
Ernie
Code: Select all
<input type="hidden" name="sid" value="<?php echo $sid; ?>">
<input type="hidden" name="total" value="<?php echo $total; ?>">
<input type="hidden" name="cart_order_id" value="<?php echo $cart_order_id; ?>">
<input type="hidden" name="card_holder_name" value="<?php echo $card_holder_name; ?>">
<input type="hidden" name="street_address" value="<?php echo $street_address; ?>">
<input type="hidden" name="city" value="<?php echo $city; ?>">
<input type="hidden" name="state" value="<?php echo $state; ?>">
<input type="hidden" name="zip" value="<?php echo $zip; ?>">
<input type="hidden" name="country" value="<?php echo $country; ?>">
<input type="hidden" name="email" value="<?php echo $email; ?>">
<input type="hidden" name="phone" value="<?php echo $phone; ?>">
<input type="hidden" name="ship_street_address" value="<?php echo $ship_street_address; ?>">
<input type="hidden" name="ship_city" value="<?php echo $ship_city; ?>">
<input type="hidden" name="ship_state" value="<?php echo $ship_state; ?>">
<input type="hidden" name="ship_zip" value="<?php echo $ship_zip; ?>">
<input type="hidden" name="ship_country" value="<?php echo $ship_country; ?>">
<?php $i = 0; ?>
<?php foreach ($products as $product) { ?>
<input type="hidden" name="c_prod_<?php echo $i; ?>" value="<?php echo $product['product_id']; ?>,<?php echo $product['quantity']; ?>">
<input type="hidden" name="c_name_<?php echo $i; ?>" value="<?php echo $product['name']; ?>">
<input type="hidden" name="c_description_<?php echo $i; ?>" value="<?php echo $product['description']; ?>">
<input type="hidden" name="c_price_<?php echo $i; ?>" value="<?php echo $product['price']; ?>">
<?php $i++; ?>
Controller file:
Code: Select all
$this->data['sid'] = $this->config->get('twocheckout_account');
$this->data['total'] = $this->currency->format($order_info['total'], $order_info['currency_code'], $order_info['currency_value'], false);
$this->data['cart_order_id'] = $this->session->data['order_id'];
$this->data['card_holder_name'] = $order_info['payment_firstname'] . ' ' . $order_info['payment_lastname'];
$this->data['street_address'] = $order_info['payment_address_1'];
$this->data['city'] = $order_info['payment_city'];
if ($order_info['payment_iso_code_2'] == 'US' || $order_info['payment_iso_code_2'] == 'CA') {
$this->data['state'] = $order_info['payment_zone'];
} else {
$this->data['state'] = 'XX';
}
$this->data['zip'] = $order_info['payment_postcode'];
$this->data['country'] = $order_info['payment_country'];
$this->data['email'] = $order_info['email'];
$this->data['phone'] = $order_info['telephone'];
if ($this->cart->hasShipping()) {
$this->data['ship_street_address'] = $order_info['shipping_address_1'];
$this->data['ship_city'] = $order_info['shipping_city'];
$this->data['ship_state'] = $order_info['shipping_zone'];
$this->data['ship_zip'] = $order_info['shipping_postcode'];
$this->data['ship_country'] = $order_info['shipping_country'];
} else {
$this->data['ship_street_address'] = $order_info['payment_address_1'];
$this->data['ship_city'] = $order_info['payment_city'];
$this->data['ship_state'] = $order_info['payment_zone'];
$this->data['ship_zip'] = $order_info['payment_postcode'];
$this->data['ship_country'] = $order_info['payment_country'];
}
Thanks IP_CAM for your reply, appreciated.
Actually, I tried with opencart default module payment come with 1.5.6.4, so it does not work for me, after I tried with this module on github :
https://github.com/craigchristenson/opencart-2checkout
But all of them, after I pay, instead of redirect me to success page, it redirect me to blank page with message :
The response from 2checkout.com can't be parsed. Contact site administrator, please!
URL:
Code: Select all
https://mystore.com/payment/twocheckout/callback?middle_initial=&sid=326584598547&fixed=Y&cart_weight=0&key=AE3275C1E2154AD512049D7986DAEE82&state=Hauts+de+Seine&last_name=Doe&email=johndoe%40yahoo.com&city=Le+Plessis&street_address=9+Avenue+Denis&cart_order_id=263&order_number=250266293682&ip_country=France&country=FRA&merchant_order_id=&cart_id=263¤cy_code=USD&lang=en&demo=Y&invoice_id=250266293681&pay_method=CC&cart_tangible=N&total=0.40&phone=%2B33752365425+&credit_card_processed=Y&zip=92350&street_address2=&x_receipt_link_url=https%3A%2F%2Fmystore.com%2Fpayment%2Ftwocheckout%2Fcallback&first_name=John&card_holder_name=John+Doe
Please advice, it look like the md5 can not be verified, because when I tried to remove this part on my /catalog/controller/payment/twocheckout.php
Code: Select all
if (strtoupper(md5($this->config->get('twocheckout_secret') . $this->config->get('twocheckout_account') . $order_number . $this->request->request['total'])) == $this->request->request['key']) {
Successfully redirected me back my shop, so I think the problem is that 2checkout script can't bypass the md5 hash .. I double check my secret word and account id and it's correct.
Please help me to fix the issue ??
Thanks so much!!