veritrans / veritrans.github.io

Veritrans documentation
http://veritrans.github.io
7 stars 15 forks source link

Long Product name issue #62

Closed alinitjin closed 8 years ago

alinitjin commented 8 years ago

Hi, i was integrating veritrans with my client website, but they got a message with error that the product name were too long ( limit from veritrans was 50). What files did i need to change on my side so that the product name that sent to veritrans could be trim to 50? Can you guide me on this?

Thank you

harrypujianto commented 8 years ago

Hi, I'm assuming you're using php with our library. please checkout this link On that link, we show you how to build a request in php. there's a field of item e.g on line 26. There you should change it. You could cut the string into 50 digits using for example substring..

alinitjin commented 8 years ago

Hi Harry,

Thank you for the reply. i found this similar code on my magento extension files. its in app->code->community->veritrans->xxxx->controllers->payment controller actually. but i spot few folders (xxxx) :

  1. vtweb
  2. vtwebbin
  3. vtwebbni
  4. vtwebmandiri

should i change the string in all the controllers in all the folders state above? or should i just change for particular folder's controller?

Thanks

Best Regards,

Alini Tjin

On Tue, Sep 20, 2016 at 4:47 PM, Harry Pujianto notifications@github.com wrote:

Hi, I'm assuming you're using php with our library. please checkout this link https://github.com/veritrans/veritrans-php/blob/master/examples/vt-web/checkout-process.php On that link, we show you how to build a request in php. there's a field of item e.g on line 26. There you should change it. You could cut the string into 50 digits using for example substring..

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/veritrans/veritrans.github.io/issues/62#issuecomment-248254910, or mute the thread https://github.com/notifications/unsubscribe-auth/AJHP6-AfEVnPsPkXYAm1dBGv3A6vrA-xks5qr6u4gaJpZM4KBZzP .

harrypujianto commented 8 years ago

If you're using each module, you should change on each paymentController. If you're only use the full payment, just change the paymentController on vtweb module.

alinitjin commented 8 years ago

i do the it this way : foreach ($items as $each) { $item = array( 'id' => $each->getProductId(), 'price' => $each->getPrice(), 'quantity' => $each->getQtyToInvoice(), 'name' => substr($each->getName(), 0,50), ); is it right?

harrypujianto commented 8 years ago

yes. try it out, hopefully you won't got the same error anymore :)

alinitjin commented 8 years ago

Hi Harry, I had tried the script, but now i could not make any transaction. even when the product name were less than 50 char.

harrypujianto commented 8 years ago

any error you can provide? if you're using magento, on module vtweb, you could check on var/log/vtweb.log , there should be something that can help us to figure out why.

alinitjin commented 8 years ago

Hi Harry, i dont think the payment were even proceed to veritrans, it was stop on the redirect page. the error occured after i change the product name script. i included a screen shot too. veritrans_error

harrypujianto commented 8 years ago

what file did u modified? it shouldn't have happen unless you modified config.xml & model/standard.php on this line https://github.com/veritrans/vtweb-magento/blob/master/app/code/community/Veritrans/Vtweb/etc/config.xml#L50-L60

https://github.com/veritrans/vtweb-magento/blob/master/app/code/community/Veritrans/Vtweb/Model/Standard.php#L21-L22

alinitjin commented 8 years ago

Only paymentController.php for all folders. i did not do any changes on config or model files. since what i change was adding substr for product name. Thanks

harrypujianto commented 8 years ago

could you send me the paymentController.php?

alinitjin commented 8 years ago

I can't upload the file here. is there any support email that i could send over the file? Thanks

harrypujianto commented 8 years ago

send email to support@veritrans.co.id