Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Exception when placing order with custom payment method

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 02-20-2021, 02:31 AM
 
hieudm hieudm is offline
    
Join Date: Feb 2021
Posts: 1
 

Default Exception when placing order with custom payment method

I'm working on a custom payment method on X-cart 5, when placing order I got this exception in log file:


Code:
[20-Feb-2021 10:05:05] Error (code: 0): Serialization of 'SimpleXMLElement' is not allowed Server API: apache2handler; Request method: POST; URI: /?; Backtrace: #0 /public_html/var/run/classes/XLite/Model/Payment/TransactionAbstract.php(952): serialize() #1 /public_html/var/run/classes/XLite/Model/Payment/TransactionAbstract.php(443): registerTransactionInOrderHistory() #2 /public_html/var/run/classes/XLite/Controller/Customer/CheckoutAbstract.php(389): handleCheckoutAction() #3 /public_html/var/run/classes/XLite/Module/CDev/Paypal/Controller/Customer/Checkout.php(297): doPayment() #4 /public_html/var/run/classes/XLite/Module/XC/NotFinishedOrders/Controller/Customer/Checkout.php(70): doPayment() #5 /public_html/var/run/classes/XLite/Module/XC/MailChimp/Controller/Customer/Checkout.php(41): doPayment() #6 /public_html/var/run/classes/XLite/Controller/Customer/CheckoutAbstract.php(325): doPayment() #7 /public_html/var/run/classes/XLite/Module/CDev/Paypal/Controller/Customer/Checkout.php(411): doActionCheckout() #8 /public_html/var/run/classes/XLite/Controller/AControllerAbstract.php(1639): doActionCheckout() #9 /public_html/var/run/classes/XLite/Controller/Customer/CartAbstract.php(54): callAction() #10 /public_html/var/run/classes/XLite/Module/XC/MailChimp/Controller/Customer/Checkout.php(31): callAction() #11 /public_html/var/run/classes/XLite/Controller/AControllerAbstract.php(1658): callAction() #12 /public_html/var/run/classes/XLite/Module/XC/MailChimp/Controller/AController.php(21): run() #13 /public_html/var/run/classes/XLite/Controller/AControllerAbstract.php(611): run() #14 /public_html/var/run/classes/XLite/Module/QSL/CloudSearch/Controller/AController.php(48): handleRequest() #15 /public_html/var/run/classes/XLite/Controller/Customer/ACustomerAbstract.php(413): handleRequest() #16 /public_html/var/run/classes/XLite/Module/XC/CustomerAttachments/Controller/Customer/ACustomer.php(29): handleRequest() #17 /public_html/var/run/classes/XLite/Module/QSL/CallForPrice/Controller/Customer/Cart.php(66): handleRequest() #18 /public_html/var/run/classes/XLite/Controller/Customer/CheckoutAbstract.php(89): handleRequest() #19 /public_html/var/run/classes/XLiteAbstract.php(624): handleRequest() #20 /public_html/var/run/classes/XLiteAbstract.php(653): runController() #21 /public_html/var/run/classes/XLite/Module/XC/MailChimp/XLite.php(21): processRequest() #22 /public_html/var/run/classes/XLiteAbstract.php(671): processRequest() #23 /public_html/cart.php(16): runCustomerZone()


This exception happens when transaction is sucess.



Here is the simplified version of the processor:


Code:
<?php class NabXML extends \XLite\Model\Payment\Base\CreditCard { protected function doInitialPayment() { $txnID = time(); $this->transaction->setStatus($this->transaction::STATUS_SUCCESS); $this->setDetail('transId', $txnID, 'Transaction ID'); return static::COMPLETED; } }


install.yaml file:


Code:
XLite\Model\Payment\Method: - service_name: Nab XML class: Module\SydneyEcommerce\NabXML\Model\Payment\Processor\NabXML type: C ...


I have multiple questions:
- Where can I find a document about developing a custom payment method?
- How can I debug and fix above exception?
- Is there a way for dev like me get full X-Cart code for self-hosting and developing stuffs?
__________________
X-Cart version 5.4.1.23
Reply With Quote
  #2  
Old 03-11-2021, 01:51 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default Re: Exception when placing order with custom payment method

First point: links like https://devs.x-cart.com/webinars_and_video_tutorials/webinar_3_-_21_aug_2014_-_payment_gateway_creation.html and https://devs.x-cart.com/changing_store_logic/creating_a_settings_page_for_a_payment_method.html can help, maybe?


Second: try to dump any relevant variables.




Third: x-cart's source code used to be downloadable...
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:57 AM.

   

 
X-Cart forums © 2001-2020