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

Creating Custome Payment Module

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 07-04-2016, 03:46 AM
 
dharmendralko dharmendralko is offline
 

Member
  
Join Date: Jun 2015
Location: Lucknow, India
Posts: 21
 

Default 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
__________________
Dharmendra Rao
PHP Developer
Lucknow, India
Reply With Quote

The following user thanks dharmendralko for this useful post:
Ed B. (07-08-2016)
  #2  
Old 07-05-2016, 12:11 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default 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.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #3  
Old 07-05-2016, 12:40 AM
 
dharmendralko dharmendralko is offline
 

Member
  
Join Date: Jun 2015
Location: Lucknow, India
Posts: 21
 

Default 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
__________________
Dharmendra Rao
PHP Developer
Lucknow, India
Reply With Quote
  #4  
Old 07-05-2016, 01:31 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default 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.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #5  
Old 07-08-2016, 01:28 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default 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.
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote
  #6  
Old 07-08-2016, 09:44 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default 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?
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #7  
Old 07-08-2016, 11:15 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default 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 . 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.
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote
  #8  
Old 07-08-2016, 11:20 PM
 
dharmendralko dharmendralko is offline
 

Member
  
Join Date: Jun 2015
Location: Lucknow, India
Posts: 21
 

Default 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
__________________
Dharmendra Rao
PHP Developer
Lucknow, India
Reply With Quote
  #9  
Old 07-08-2016, 11:35 PM
 
dharmendralko dharmendralko is offline
 

Member
  
Join Date: Jun 2015
Location: Lucknow, India
Posts: 21
 

Default 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
__________________
Dharmendra Rao
PHP Developer
Lucknow, India
Reply With Quote
  #10  
Old 07-10-2016, 08:42 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default 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.
__________________
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)



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 09:09 PM.

   

 
X-Cart forums © 2001-2020