X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Creating Custome Payment Module (https://forum.x-cart.com/showthread.php?t=74160)

dharmendralko 07-04-2016 03:46 AM

Re: Creating Custome Payment Module in Xcart classic
 
Hi Alex Solovev,

hope, you are doing good,

please let me know or share any doc for how i can create a payment method for credit cart on our server not web based (i don't want redirect my customer to payment gateway site).

i have create a payment gateway but i don't know how i can add credit card form (card number, cvv, holder name etc.) on check page and process them?

please help me asap

Thanks

qualiteam 07-05-2016 12:11 AM

Re: Creating Custome Payment Module in Xcart classic
 
Hello,

Quote:

Originally Posted by dharmendralko
i have create a payment gateway but i don't know how i can add credit card form (card number, cvv, holder name etc.) on check page and process them?


I believe you should not do it as it may be against the PCI DSS rules: the cardholder data must not be processed or transmitted through regular web servers.

There is a method to display the payment form on your website, but get it submitted directly to the payment gateway's server. As far as I know PayPal Advanced API works this way, so you may install PayPal module and check how it implements the payment form for that API.

dharmendralko 07-05-2016 12:40 AM

Re: Creating Custome Payment Module in Xcart classic
 
Hi,

i know that PCI DSS rules. i will not save any cc data to my server. i will use credit card form from our server and submit data to payment gateway server by curl as like PayPal Payments Advanced.

but i don't no what functions will use to process it.

like there are a function doInitialPayment() which required for online based payment in xcart 5. but i don't know what other function will use.

so please explain me for that.

thanks

qualiteam 07-05-2016 01:31 AM

Re: Creating Custome Payment Module
 
Unfortunately, there is no other documentation for creating payment modules for X-Cart 5 except these ones:
- http://kb.x-cart.com/display/XDD/Webinar+3+-+21+Aug+2014+-+Payment+gateway+creation
- http://kb.x-cart.com/display/XDD/Creating+a+payment+method
- http://kb.x-cart.com/display/XDD/Creating+settings+page+for+payment+method

You'll have to dig into the existing code to understand how the flow is coded in payment modules similar to yours.

Ed B. 07-08-2016 01:28 AM

How to pass the order amount? Re: Creating Custome Payment Module
 
Hi, we are in a similar situation. We are trying to imitate the demo module to make a gateway module for Payplug, for which there is no readymade module is available. I have figured out that I could pass, for example, the customer's first name to the gateway by adding a line
Code:

      'first_name'    => $this->getProfile()->getBillingAddress()->getFirstname(),

in the function getFormFields(). However, I haven't found out how
I could let x-cart to pass the payment amount to the gateway.
I tried
Code:

'amount'=>round($this->transaction->getValue(),2)
Code:

'amount'=>$this->getFormattedprice($this->transaction->getValue())
with the function getFormattedprice
Code:

    protected function getFormattedPrice($price)
    {
            return number_format(
            $this->transaction->getCurrency()->roundValue($price),
            2,
            '.',
            ''
            );
    }

and
Code:

'amount'=>$this->getFormattedprice($this->getOrder()->getTotal()),
but none of these works (cache redeployment gets stuck at the step 1). Could anyone tell me how to solve this issue? Thank you very much in advance.

qualiteam 07-08-2016 09:44 AM

Re: Creating Custome Payment Module
 
What error message do you see when redeployment stops?
Also, what is $this in the above methods? Is it the \XLite\Model\Order class?

Ed B. 07-08-2016 11:15 AM

Re: Creating Custome Payment Module
 
No error message, the browser kept showing the Step 1 of redeployment.
Run the "Doctrine_Plugin_DocBlock_FakeEntities" plugin... is the last thing that
shows up.


As to $this, I have to admit that I am not familiar with OOP,
so I don't have a very good understanding of what is in the code, so I simply
try to imitate what I found in ready-made modules. So, for example, in the
AuthorizeNetSIM module, we have a class AuthorizeNetSIM extending the
WebBased class, and the function getValue() or the property "transaction" isn't declared inside the class, so I guessed that it must be defined somewhere in parent class, and didn't worry much where it came from since my class also extends WebBased :oops:. And, I am having
problems in locating where things get declared, as you can see from the other post of mine that you kindly answered.

dharmendralko 07-08-2016 11:20 PM

Re: Creating Custome Payment Module
 
Quote:

Originally Posted by qualiteam
Unfortunately, there is no other documentation for creating payment modules for X-Cart 5 except these ones:
- http://kb.x-cart.com/display/XDD/Webinar+3+-+21+Aug+2014+-+Payment+gateway+creation
- http://kb.x-cart.com/display/XDD/Creating+a+payment+method
- http://kb.x-cart.com/display/XDD/Creating+settings+page+for+payment+method

You'll have to dig into the existing code to understand how the flow is coded in payment modules similar to yours.



Hi Alex Solovev,

please just let me know flow of iframe popup based payment module. What function will be used?


Thanks

dharmendralko 07-08-2016 11:35 PM

Re: Creating Custome Payment Module
 
Hi Alex,

i want process like your team did on this module http://www.x-cart.com/extensions/addons/fastspring.html

so please let me know or share any document.

Thanks

Ed B. 07-10-2016 08:42 AM

Re: Creating Custome Payment Module
 
Quote:

Originally Posted by qualiteam
What error message do you see when redeployment stops?
Also, what is $this in the above methods? Is it the \XLite\Model\Order class?


Finally I solved the problem by changing the array key, the function was OK
(c.f. the new thread I made). Thank you very much for help anyway.


All times are GMT -8. The time now is 03:32 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.