Category Archives: OCMod

How to use Integrate third party payment gatway using xpayment?

Scenario -1

You have a payment gateway, that needs to send some datas (like total amount, API key etc) to their server and payment gateway will do all necessary things on their server and return back to your store once processing is done with payment data.

How to implement?

  1. Since it needs to redirect to payment gateway with some datas. So first select Integration type is “Redirect/Forward to Payment URL”
  2. Now enter the payment gateway URL where it need to be redirected/forwarded.
  3. Now you will have to enter all data as JSON format into Data(s) section. You can use few placeholders like {orderTotal}, {currency} etc that xpayment will handle accordingly. Xpayment also has a special placeholder {returnURL} that basically a special URL so that you can return to store from payment gateway. Most of the payment gateway, it need to supply return URL into data section OR it can be set on payment gateway control panel. Return URL denotes basically http://YOUR_DOMAIN/index.php?route=extension/payment/xpayment/confirm
  4. Now select return method type that means how your payment gateway will reply back to store. It could be GET or POST or JOSN. Normally it can be found in payment gateway manual.
  5. Finally, you will have to enter a payment successful condition. That means after returning back from Payment gateway to your store, it can be successful or failure transaction. Normally, it can be found in payment gateway manual. Most of the cases, they send some data like success==true or something like that where success is variable name that will available in their response.
  6. Now xpayment will do remaining things what to do. Either it will reject or accept depending on the data.

Scenario -2

You have a payment gateway, that needs to call their provided API URL/endpoint from your store without leaving your store. it may need to provide some data while calling that API URL.

How to implement?

1. Since it needs to call API with some datas. So first select Integration type is “API Call”
2. Now enter the payment gateway API URL that need to be called.
3. Now you will have to enter all data as JSON format into Data(s) section.
4. Now select API response type. It could be GET or POST or JOSN.
5. Finally, you will have to enter a payment successful condition.

Actually it needs some developing knowledge to integrate payment gateway.

Product rules in details in all X-Modules

 

TLDR: Please check this quick summary before dive into the following detailed explanation.

There is a total of six product rules in xshippingpro. These are:

  1. Must have selected ones
  2. Must have selected ones with other
  3. Any of the selected ones
  4. Any of the selected ones with others
  5. Except for the selected ones
  6. Except for the selected ones with others

1. Must have selected ones

All defined items must be present in the shopping cart and, the shopping cart must not contain anything from non-defined items. For example, you have chosen items AB, and C for a method. So the shipping cart must contain all A, B, and C to have the method appeared. If the cart contains any item other than A, B, and C, the method will be unavailable. In short –

 Shopping cart items should be a complete/equal set of the defined items

2. Must have selected ones with others

All chosen items must be present in the shopping cart to have appeared the method during checking out. If any of the defined items (selected items) is absent in the shopping cart, the particular method will not have appeared during checkout. Other categories might have been in the shopping cart that does not matter. For example, let’s say you have defined items A, B, and C for a method. If a customer purchase all three items A, B, and C, the method will have appeared. The main requirement is that the shopping cart must contain all defined items regardless of the presence of non-chosen items. In short –

Defined items should be a sub-set of the shopping cart items

3. Any of the selected ones

At least one of the defined items should be present in the shopping cart and non-defined items should NOT be present. For example, you have defined items AB, and C for a method. To have appeared the method, the shopping cart must contain any one of A, B, and C, and the shopping cart must not contain items apart from A or B or C . The main requirement is the cart must contain any of the chosen items BUT it can not contain other non-defined items. In short –

 Shopping cart items should be a sub-set of the defined items and it should not contain other non-defined items

4. Any of the selected ones with others

It is exactly the same as the Any of the selected ones except the shopping cart contains other non-defined items. In most cases, this is the rule you are looking for.  In short –

Shopping cart items should be a sub-set of the defined items

5. Except the selected ones

All chosen items must not be present in the shopping cart. For example, you have defined items AB, and C for a method. The method will have appeared when the shopping cart contains items other than  A, B and, C. In short –

Shopping cart ones should not be a sub-set of the defined items

6. Except the selected ones but allowed with other

It is an interesting rule. It works the same as the Except the selected ones but, if the cart contains both non-defined items and defined items together, the method will be available.

For example, you have defined items AB, and C for a method. The method will not have appeared when the cart contains A or B or C. However, if the cart contains any non-defined item like D along with A/B/C, the method will be available. In short –

 Shopping cart items should be a sub-set of the defined items and any other non-defined items must be present.