X-Payments:Using X-Payments with Magento

From X-Payments Help
Revision as of 13:20, 2 November 2017 by Dohtur (talk | contribs) (Finding out the order state for X-Payments orders)
Jump to: navigation, search

A Magento store can be connected to X-Payments web-based payment application to process payments from customers and save their credit card data in a PCI DSS compliant way.

This section provides information on how to connect X-Payments to your Magento store and how to handle payments in your Magento store using X-Payments.

Video tutorials

Connecting Magento to X-Payments

Payments via X-Payments in Magento: Customer experience

Payments via X-Payments in Magento: Administrator experience

Canceling payments

Finding out the order state for X-Payments orders

Capture, Void and Refund on orders modified using Magento's default Edit feature

Sometimes you may require to make changes to an order in your store. For example, you may want to change an order if a customer asks you to add an item to their order or if some of the items in the order are out of stock.

When you need to remove an item from an X-Payments order in Magento, you use the Credit Memo feature (For more info, see the section Issuing refunds). When you need to add an item to an order, you do it using Magento's default Edit feature:

Order edit feature.png

You need to know that if you have used Magento's default Edit feature to add items to an X-Payments order, you will need to treat this order in a special way when performing payment related operations like Capture, Void or Refund.

The thing is, when you edit an order in Magento, the original order is canceled, and a new ("child") order is generated based on it. Because one or more items are added to the order, the grand total amount of the "child" order is greater than the grand total amount of the "parent" order. When your store creates a new order, it requests an authorization for the amount equal to the difference between the grand total amount of the child order and the grand total amount of the parent order:

Xp Transaction amount = Child Order (new order) — Parent order (Edited Order)

The existing authorization inherited from the parent order also keeps for the new order.

Now if you attempt to do a capture of funds on this new order through creating an invoice, you are highly likely to request a capture of an amount that does not match any of the two authorizations. This means, if you use the "Capture Online" option, you won't be able to complete the capture transaction successfully. That is why, when performing a capture on an order that has been edited using Magento's default Edit feature, you should refrain from using the "Capture Online" option. Instead, you may want to use the option "Capture Offline" or (in the event that you do not need an invoice) to perform a capture through the X-Payment Order State tab.

The same holds true for Void and Refund: when you need to perform these actions on an X-Payments order that has been edited in Magento, avoid using the "online" options of the invoice (Invoice: Cancel or Invoice: Credit Memo→Refund Online).

Example:
In our Magento store, an order was created (Order #100000110) for a single unit of "Simple product 1".

Order 110.png

The initial transaction on this order was performed in the "Auth only" mode, and the amount for which an authorization was obtained was $61 ($56 one unit of "Simple product 1" + $5 shipping):

1 auth.png

We edited the order by adding to it another unit of "Simple product 1". The order #100000110 was canceled, and, based on it, another order, Order #100000110-1, was generated. On this order, a new authorization was obtained for the difference of #100000110-1 and #100000110 grand total amounts, which was also $61 ($56 one unit of "Simple product 1" + $5 shipping).

Now if you take a look at the information in the X-Payment Order State section, you should see the authorization that Order #100000110-1 inherited from Order #100000110, as well as the new authorization that was created for the difference between the two order amounts:

2 auth.png

Please note that these are two separate authorizations ($61 + $61).

Now if we include both the units of "Simple product 1" from this order into a single invoice, the invoice total amount will be $122 ($112 two units of "Simple product 1" + $10 shipping):

Invoice two.png

If we invoice the two units of "Simple product 1" separately, the invoice totals will be $66 ($56 first unit of "Simple product 1" + $10 shipping of both the units):

Invoice 1.png

and $56 ($56 second unit of "Simple product 1", no shipping):

Invoice 2.png

In any case, neither of the above amounts equals $61, the amount for which we have two authorizations. So, if you choose the "Capture Online" option when doing a capture, the capture transaction will not be processed successfully.

Capture, Void and Refund via the X-Payment Order State tab

If your store's workflow does not involve invoicing, or you are dealing with an X-Payments order that has previously been edited using Magento's default Edit feature, you can perform Capture, Void and Refund operations via the X-Payment Order State section of the order details (The section can be accessed by clicking the X-Payment Order State tab in the Order View menu). The specific operations available to you depend on the current order state, and you can only see the buttons for the operations that you can perform. If necessary, you can edit the amount on which the operation is performed by editing the contents of the iput field in the Actions column of the table.

Important: If you have already performed a Capture, Void or Refund operation on an order via the X-Payment Order State section, you should not attempt to do any further payment related operations on this order using the online options of the invoice (like Invoice: Cancel, Invoice: Capture Online or Invoice: Credit Memo→Refund Online), as it may cause the following problems:

  • Sending a duplicate request for the current transaction;
  • Requesting a transaction for an unavailable amount (For example, by doing Invoice: Credit Memo→Refund Online you may be requesting a refund for an amount exceeding the amount that you have captured originally via the Order(s) state block in the X-Payment Order State section).

The opposite is also true: If you have used on a certain order a payment related operation based on an online option of the invoice (Invoice: Cancel, Invoice: Capture Online or Invoice: Credit Memo→Refund Online), do not attempt to perform any further payment related operations on this order via the X-Payment Order State section, as it is likely to cause similar problems.

Recurring Billing in Magento with X-Payments

Export of order information to StoneEdge Order Manager

Starting with version 1.7.0, the X-Payments connector for Magento supports export of payment information (stuff like transaction IDs, the last four digits of the credit card number, etc.) to StoneEdge Order Manager. If you use X-Payments with Magento and need to export information about payments conducted via X-Payments to StoneEdge Order Manager, contact the X-Payments team for help.