Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Dynamic Payment Surcharge Problem Rate Topic   - - - - -

 
  • teosu
  • Senior Member
  • Members
  • Join Date: 09-Oct 14
  • 265 posts

Posted 04 December 2017 - 02:41 PM #1

hi i am try to build my bank payment gateway.

i have installments

i am checking installmens from bank api. and turn me differend  installments values

i calculate installmens with :

Tygh::$app['session']['cart']['payment_surcharge'] = $turned_Value;
    Tygh::$app['session']['cart']['payment_surcharge_title'] = 'Commission';
    fn_calculate_payment_taxes(Tygh::$app['session']['cart'], $auth);

but when payment fnishing with :

fn_finish_payment($_REQUEST['order_id'], $pp_response, false);
fn_order_placement_routines('route', $_REQUEST['order_id']);

turn default values. please i need advice how can fix this ?



 
  • teosu
  • Senior Member
  • Members
  • Join Date: 09-Oct 14
  • 265 posts

Posted 04 December 2017 - 04:17 PM #2

i have to set under fn_update_payment_surcharge

payment_surcharge hook

 

than worked. anyone know different way without edit core files ?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17136 posts

Posted 05 December 2017 - 05:59 AM #3

I suggest you to use hooks in the fn_calculate_cart_content. If payment surcharge is to 0 for the payment, it will not be overriden 


DISCOUNTS UNTIL APRIL, 27! GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 305     Multi-Vendor              USD 1150    CS-Cart RU                         21500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 505      CS-Cart RU + UniTheme    33000 руб.


 
  • teosu
  • Senior Member
  • Members
  • Join Date: 09-Oct 14
  • 265 posts

Posted 05 December 2017 - 12:56 PM #4

itry fn_calculate_cart_content hook. its doenst work. resetting after calculating



 
  • teosu
  • Senior Member
  • Members
  • Join Date: 09-Oct 14
  • 265 posts

Posted 05 December 2017 - 01:00 PM #5

its working with this way. and second problem ....

i added another payment method working similar paypal.

turn me payment surcharge value

 

how can i update before  success payment ? before fn_finish_payment

 

?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17136 posts

Posted 05 December 2017 - 01:03 PM #6

how can i update before  success payment ? before fn_finish_payment

 

?

 

It is not clear what do you mean. Please clarify


DISCOUNTS UNTIL APRIL, 27! GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 305     Multi-Vendor              USD 1150    CS-Cart RU                         21500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 505      CS-Cart RU + UniTheme    33000 руб.


 
  • teosu
  • Senior Member
  • Members
  • Join Date: 09-Oct 14
  • 265 posts

Posted 05 December 2017 - 01:06 PM #7

$auth = Tygh::$app['session']['auth'];
$cart = Tygh::$app['session']['cart'];
fn_calculate_cart_content($cart,$auth);
fn_save_cart_content($cart, $auth['user_id']);
fn_update_order_data($_REQUEST['order_id'], $cart);

i try before fn_finish_payment

 

nothing ?


i want recalculate and update order before succes order placement. coz i am getting dynamic payment surcharge. i am adding this with private hook



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17136 posts

Posted 05 December 2017 - 01:07 PM #8

What is purpose of this code? If you user hooks correctly, surcharge should exist in the session


DISCOUNTS UNTIL APRIL, 27! GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 305     Multi-Vendor              USD 1150    CS-Cart RU                         21500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 505      CS-Cart RU + UniTheme    33000 руб.


 
  • teosu
  • Senior Member
  • Members
  • Join Date: 09-Oct 14
  • 265 posts

Posted 05 December 2017 - 01:12 PM #9

check first post mate i am adding surcharge with private hook



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17136 posts

Posted 05 December 2017 - 01:13 PM #10

Sorry, I thought you used hooks in the fn_calculate_cart_content function.


DISCOUNTS UNTIL APRIL, 27! GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 305     Multi-Vendor              USD 1150    CS-Cart RU                         21500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 505      CS-Cart RU + UniTheme    33000 руб.


 
  • teosu
  • Senior Member
  • Members
  • Join Date: 09-Oct 14
  • 265 posts

Posted 05 December 2017 - 01:13 PM #11

look i am getting  response commission

$pp_response['reason_text'] .= 'Commission: ' . $raw_result['merchantCommissionRateAmount'];

i have to update exsist order surcharge with this i am try this



 
  • teosu
  • Senior Member
  • Members
  • Join Date: 09-Oct 14
  • 265 posts

Posted 05 December 2017 - 01:16 PM #12

i checked now fn_calculate_cart_content  doesnt call any surcharge



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10481 posts

Posted 05 December 2017 - 10:11 PM #13

Payment surcharge is not applied until checkout and is based on what payment method is selected.

If you're wanting this to show as a fee and shown before checkout then you can add the data to the cart and then handle it using the PHP hook for 'calculate_cart_taxes_pre' and make the appropriate subtotal adjustment there.  But you won't know what payment method the customer is using in the cart, only in checkout.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • teosu
  • Senior Member
  • Members
  • Join Date: 09-Oct 14
  • 265 posts

Posted 06 December 2017 - 06:31 AM #14

i sold the problem with fn_update_order before placing order. thanks for all