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

X-Payments API Recharge with Cart questions

 
Reply
   X-Cart forums > X-Payments > X-Payments issues & questions
 
Thread Tools
  #1  
Old 05-16-2017, 02:34 PM
 
joestern joestern is offline
 

Senior Member
  
Join Date: Apr 2004
Posts: 185
 

Default X-Payments API Recharge with Cart questions

I'm trying to use the API for X-Payments to recharge and to create an order in the process.

So far, I have gotten the recharge to work, and I get a bare order created. It has the customer info and lists in the customer portal, but I cannot get any line items to show there. The total, however, is correct.

But I'd like to have more info in there in case a customer logs in and wants to verify their charge history.

I'm using:

Code:
<items type="cell"> <sku>misc-charge</sku> <name>Miscellaneous Charge</name> <price>75.33</price> <quantity>1</quantity> </items>

I have a product in my X-Cart with the SKU of 'misc-charge' and no set price.

I also can't get the tax to breakout.

There isn't a lot of documentation about the API so I can't really figure out what more to try.

I did finally figure out that the mechanism to tell the cart about the new order (since you are communicating with X-Payments and not X-Cart) is this line:

Code:
<callbackUrl>https://www.example.com/xcart/payment/cc_xpc.php</callbackUrl>

That doesn't exactly seem like a "callback" URL to me, but that's the way X-Payments pings your cart with the info about the new order.
__________________
X-Cart version 4.7.12
Reply With Quote
  #2  
Old 05-17-2017, 11:37 PM
 
joss joss is offline
 

X-Cart team
  
Join Date: Feb 2009
Posts: 60
 

Default Re: X-Payments API Recharge with Cart questions

Please refer to this article for the detailed description of the recharge requests:

https://www.x-payments.com/help/X-Payments:Charge_again_transaction_request_(Tokeniz ation)

You can send the information about items, shipping cost, etc in the "cart" block.

The callback request contains the information about payment, however since recharge is a direct POST request, you can use the response for that request to get the result of the transaction. It contains the payment status and information about any errors occurred.

Meanwhile, to process the callbacks you should create your script which should be accessible via internet and pass its URL. Note: information in callback request to your script is encrypted. Please refer to these articles for the detailed information:

https://www.x-payments.com/help/X-Payments:Callback_request_with_service_payment_inf ormation
https://www.x-payments.com/help/X-Payments:Detailed_payment_and_transaction_informat ion_request#Response_specification

The PHP implementation of the encryption/decryption can be found here: https://drive.google.com/drive/folders/0B6p7sehSZL8_R3dHUk1sQVYteUE
__________________
joss@x-cart.com

Last edited by kai : 05-19-2017 at 12:39 AM.
Reply With Quote

The following user thanks joss for this useful post:
ambal (05-18-2017)
  #3  
Old 05-18-2017, 09:36 AM
 
joestern joestern is offline
 

Senior Member
  
Join Date: Apr 2004
Posts: 185
 

Default Re: X-Payments API Recharge with Cart questions

Thanks.

Still working through the info, but your first and third links are broken - first needs a ")" and third had : D converted into "grin."
__________________
X-Cart version 4.7.12
Reply With Quote
  #4  
Old 05-18-2017, 09:54 AM
 
joestern joestern is offline
 

Senior Member
  
Join Date: Apr 2004
Posts: 185
 

Default Re: X-Payments API Recharge with Cart questions

To break this down into pieces - here's my first chunk.

I believe that if the customer has an account in X-Cart, the X-Payments recharge request only needs this identifying information to successfully link a new order to that customer:

Code:
<cart> <login>customer</login> <billingAddress> <email>person@domain.com</email> </billingAddress> ... </cart>
__________________
X-Cart version 4.7.12
Reply With Quote
  #5  
Old 05-18-2017, 02:31 PM
 
joestern joestern is offline
 

Senior Member
  
Join Date: Apr 2004
Posts: 185
 

Default Re: X-Payments API Recharge with Cart questions

I'm pretty sure there's a bug in this API, or in X-Payments.

I still cannot get much of the info I post from X-Payments over to X-Cart. All I get in X-Cart is a very minimal order with a total. The order is tied to the customer who made the original charge in X-Payments (the reference transaction), but there are several issues:

-No matter what address I post with the recharge XML to X-Payments, X-Cart makes the order with the default billing and shipping information from the customer's profile. So X-Cart uses the defaults in the customer's address book. X-Payments uses the information posted. I have tried this a few different ways and found this to be the pattern. I have not yet tried with a customer who doesn't have a profile.

-If I change the email address in the recharge request, it has no effect. Essentially, this information is discarded completely.

-No items in the <cart> area carry over to X-Cart or are shown in X-Payments (I don't think they could possibly be shown in X-Payments). Essentially, the cart information is also discarded.

-Same for tax and shipping costs - the information is discarded.

It feels like the only information that X-Payments successfully communicates to X-Cart is the customer and the total. All other info is lost somewhere in the process.
__________________
X-Cart version 4.7.12
Reply With Quote
  #6  
Old 05-23-2017, 08:06 AM
 
joestern joestern is offline
 

Senior Member
  
Join Date: Apr 2004
Posts: 185
 

Default Re: X-Payments API Recharge with Cart questions

I'm still working on this problem. With your example code (just changing the data fields) I cannot get a cart to show up in the X-Cart side. I've made many, many changes to the post code, and still, no progress.

Can someone at X-Cart just try the sample code on your side just to confirm that this works for you?

If it works for you, I'll keep working. But I really think there may be an issue in the code somewhere.

Thanks,

Joe
__________________
X-Cart version 4.7.12
Reply With Quote
  #7  
Old 05-24-2017, 02:28 AM
  ambal's Avatar 
ambal ambal is offline
 

X-Cart team
  
Join Date: Sep 2002
Posts: 4,119
 

Default Re: X-Payments API Recharge with Cart questions

Hi Joe,

I am really sorry we can't get back to you here. Right now we are busy with preparing our connectors for new X-Cart versions which are going to be released very soon.
__________________
Sincerely yours,
Alex Mulin
VP of Business Development for X-Cart
X-Payments product manager
Reply With Quote
Reply
   X-Cart forums > X-Payments > X-Payments issues & questions


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not 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 12:59 PM.

   

 
X-Cart forums © 2001-2020