Hii community,
Hope you all are doing well. I'm using an external Payment gateway in my ecommerce setup ,and I'm able to place orders using an external gateway.. My question is, I'm struggling to call the refund api if the user cancels an order line in an order. I have configured the custom_method entity as well.. let me know if I'm missing something.. Thanks & Regards Madhi Krishnan |
Hello Madhi,
Not sure but can you check if you have associated your custom method with the right ProductStorePaymentSetting? <ProductStorePaymentSetting productStoreId="${productStoreId}" paymentMethodTypeId="CREDIT_CARD" paymentServiceTypeEnumId="PRDS_PAY_REFUND" paymentService="testCCRefund" paymentCustomMethodId="CC_REFUND_TEST"/> You can either put your payment gateway service name in paymentService of the custom method ID in paymentCustomMethodId field. It will be good if you can post the error log here if this is not a case. Kind Regards, -- Pritam Kute On Thu, Sep 10, 2020 at 4:42 AM Madhi Krishnan < [hidden email]> wrote: > Hii community, > Hope you all are doing well. > > I'm using an external Payment gateway in my ecommerce setup ,and I'm able > to place orders using an external gateway.. > My question is, I'm struggling to call the refund api if the user cancels > an order line in an order. > I have configured the custom_method entity as well.. > let me know if I'm missing something.. > > Thanks & Regards > Madhi Krishnan > |
In reply to this post by Madhi Krishnan
From which sie you have placed an order?
-- Sent from: http://ofbiz.135035.n4.nabble.com/OFBiz-User-f135036.html |
In reply to this post by Pritam Kute
Hey pritam ..
Thanks for your response ,I appreciate it. I checked the entities that you mentioned above and it looks ok to me. i'm getting a warning in the console saying no payment preference was found.. Below are the logs that were generated. |I| Running Service ECA Service: releaseOrderPayments, triggered by rule on Service: changeOrderStatus 2020-09-10 13:48:54,303 |jsse-nio-8443-exec-3 |PaymentGatewayServices |W| No OrderPaymentPreference records available for release 2020-09-10 13:48:54,304 |jsse-nio-8443-exec-3 |ServiceDispatcher |T| Sync service [order/releaseOrderPayments] finished in [2] milliseconds other than that everything looks good in the logs.. I tried to debug ..and i'm getting the warning from the service called " *releaseOrderPayments*" Service Implementation Location ofbiz-framework/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java At line 772. Thanks and regards Madhi Krishnan On Thu, Sep 10, 2020 at 12:56 PM Pritam Kute <[hidden email]> wrote: > Hello Madhi, > > Not sure but can you check if you have associated your custom method with > the right ProductStorePaymentSetting? > > <ProductStorePaymentSetting productStoreId="${productStoreId}" > paymentMethodTypeId="CREDIT_CARD" > paymentServiceTypeEnumId="PRDS_PAY_REFUND" paymentService="testCCRefund" > paymentCustomMethodId="CC_REFUND_TEST"/> > > You can either put your payment gateway service name in paymentService of > the custom method ID in paymentCustomMethodId field. > > It will be good if you can post the error log here if this is not a case. > > Kind Regards, > -- > Pritam Kute > > > On Thu, Sep 10, 2020 at 4:42 AM Madhi Krishnan < > [hidden email]> wrote: > > > Hii community, > > Hope you all are doing well. > > > > I'm using an external Payment gateway in my ecommerce setup ,and I'm able > > to place orders using an external gateway.. > > My question is, I'm struggling to call the refund api if the user cancels > > an order line in an order. > > I have configured the custom_method entity as well.. > > let me know if I'm missing something.. > > > > Thanks & Regards > > Madhi Krishnan > > > |
Administrator
|
In reply to this post by sadiqrehan
Hi sadiqrehan,
Your message has been moderated, else it would not have reached this Mailing List. Please subscribe to the user ML for such questions and then use your email client. See why here http://ofbiz.apache.org/mailing-lists.html. You will get a better support, people can answer you on the ML. The wider the audience the better the answers you might get. Also it's more work for moderators who have to accept your messages as long as you have not subscribed. I'll personally no longer accept them (other moderators still could). Thanks Jacques Le 10/09/2020 à 09:58, sadiqrehan a écrit : > >From which sie you have placed an order? > > > > -- > Sent from: http://ofbiz.135035.n4.nabble.com/OFBiz-User-f135036.html |
In reply to this post by Madhi Krishnan
Hello Madhi,
Now based on the logs which you have shared, I suspect either orderPaymentPreferenceId passed to the custom service is wrong or the orderPaymentPreference status is not PAYMENT_AUTHORISED. I hope you have done payment authorization while placing the order. If you have done a direct sale transaction, then this might not work. Kind Regards, -- Pritam Kute On Thu, Sep 10, 2020 at 2:10 PM Madhi Krishnan < [hidden email]> wrote: > Hey pritam .. > Thanks for your response ,I appreciate it. > > I checked the entities that you mentioned above and it looks ok to me. > i'm getting a warning in the console saying no payment preference was > found.. > > Below are the logs that were generated. > |I| Running Service ECA Service: releaseOrderPayments, triggered by rule on > Service: changeOrderStatus > 2020-09-10 13:48:54,303 |jsse-nio-8443-exec-3 |PaymentGatewayServices > |W| No OrderPaymentPreference records available for release > 2020-09-10 13:48:54,304 |jsse-nio-8443-exec-3 |ServiceDispatcher > |T| Sync service [order/releaseOrderPayments] finished in [2] > milliseconds > > other than that everything looks good in the logs.. > I tried to debug ..and i'm getting the warning from the service called " > *releaseOrderPayments*" > Service Implementation Location > > ofbiz-framework/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java > At line 772. > > Thanks and regards > Madhi Krishnan > > On Thu, Sep 10, 2020 at 12:56 PM Pritam Kute < > [hidden email]> > wrote: > > > Hello Madhi, > > > > Not sure but can you check if you have associated your custom method with > > the right ProductStorePaymentSetting? > > > > <ProductStorePaymentSetting productStoreId="${productStoreId}" > > paymentMethodTypeId="CREDIT_CARD" > > paymentServiceTypeEnumId="PRDS_PAY_REFUND" paymentService="testCCRefund" > > paymentCustomMethodId="CC_REFUND_TEST"/> > > > > You can either put your payment gateway service name in paymentService of > > the custom method ID in paymentCustomMethodId field. > > > > It will be good if you can post the error log here if this is not a case. > > > > Kind Regards, > > -- > > Pritam Kute > > > > > > On Thu, Sep 10, 2020 at 4:42 AM Madhi Krishnan < > > [hidden email]> wrote: > > > > > Hii community, > > > Hope you all are doing well. > > > > > > I'm using an external Payment gateway in my ecommerce setup ,and I'm > able > > > to place orders using an external gateway.. > > > My question is, I'm struggling to call the refund api if the user > cancels > > > an order line in an order. > > > I have configured the custom_method entity as well.. > > > let me know if I'm missing something.. > > > > > > Thanks & Regards > > > Madhi Krishnan > > > > > > |
Hey pritam
Thanks man.. I was missing the payment_authorization thing.. I did a direct sales_transaction.That's why my status on OrderPaymentPreference was PAYMENT_RECIVED. Do I have to explicitly call the *authOrderPayments* service before calling the gateway? If you can share any documentation links about transactions in ofbiz will be helpful.. Thanks Once again Madhi Krishnan On Thu, Sep 10, 2020 at 2:55 PM Pritam Kute <[hidden email]> wrote: > Hello Madhi, > > Now based on the logs which you have shared, I suspect either > orderPaymentPreferenceId passed to the custom service is wrong or the > orderPaymentPreference status is not PAYMENT_AUTHORISED. I hope you have > done payment authorization while placing the order. If you have done a > direct sale transaction, then this might not work. > > Kind Regards, > -- > Pritam Kute > > > On Thu, Sep 10, 2020 at 2:10 PM Madhi Krishnan < > [hidden email]> wrote: > > > Hey pritam .. > > Thanks for your response ,I appreciate it. > > > > I checked the entities that you mentioned above and it looks ok to me. > > i'm getting a warning in the console saying no payment preference was > > found.. > > > > Below are the logs that were generated. > > |I| Running Service ECA Service: releaseOrderPayments, triggered by rule > on > > Service: changeOrderStatus > > 2020-09-10 13:48:54,303 |jsse-nio-8443-exec-3 |PaymentGatewayServices > > |W| No OrderPaymentPreference records available for release > > 2020-09-10 13:48:54,304 |jsse-nio-8443-exec-3 |ServiceDispatcher > > |T| Sync service [order/releaseOrderPayments] finished in [2] > > milliseconds > > > > other than that everything looks good in the logs.. > > I tried to debug ..and i'm getting the warning from the service called > " > > *releaseOrderPayments*" > > Service Implementation Location > > > > > ofbiz-framework/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java > > At line 772. > > > > Thanks and regards > > Madhi Krishnan > > > > On Thu, Sep 10, 2020 at 12:56 PM Pritam Kute < > > [hidden email]> > > wrote: > > > > > Hello Madhi, > > > > > > Not sure but can you check if you have associated your custom method > with > > > the right ProductStorePaymentSetting? > > > > > > <ProductStorePaymentSetting productStoreId="${productStoreId}" > > > paymentMethodTypeId="CREDIT_CARD" > > > paymentServiceTypeEnumId="PRDS_PAY_REFUND" > paymentService="testCCRefund" > > > paymentCustomMethodId="CC_REFUND_TEST"/> > > > > > > You can either put your payment gateway service name in paymentService > of > > > the custom method ID in paymentCustomMethodId field. > > > > > > It will be good if you can post the error log here if this is not a > case. > > > > > > Kind Regards, > > > -- > > > Pritam Kute > > > > > > > > > On Thu, Sep 10, 2020 at 4:42 AM Madhi Krishnan < > > > [hidden email]> wrote: > > > > > > > Hii community, > > > > Hope you all are doing well. > > > > > > > > I'm using an external Payment gateway in my ecommerce setup ,and I'm > > able > > > > to place orders using an external gateway.. > > > > My question is, I'm struggling to call the refund api if the user > > cancels > > > > an order line in an order. > > > > I have configured the custom_method entity as well.. > > > > let me know if I'm missing something.. > > > > > > > > Thanks & Regards > > > > Madhi Krishnan > > > > > > > > > > |
Hello Madhi,
Happy to know that it helped you. In payment integration, the process to get payment done depends on lots of things like rules in-country, the payment gateway which you are using, etc. In OFBiz OOTB, the expected payment cycle should be like 1. Payment authorisation when order is placed into the system by the user. 2. If an order gets cancelled, payment authorisation is released 3. If an order is edited, payment is released and re-authorised. 3. If an order is approved/completed in the system, it captures the amount. 4. If an order is returned after fulfilment, the payment is refunded. For direct sale transaction, your payment is already settled/captured in the gateway. So using releaseOrderPayment is not recommended. You should use refundPayment instead. releaseOrderPayment should only be used when the payment is in authorised status, not captured/received. Kind Regards, -- Pritam Kute On Thu, Sep 10, 2020 at 5:23 PM Madhi Krishnan < [hidden email]> wrote: > Hey pritam > > Thanks man.. > I was missing the payment_authorization thing.. > I did a direct sales_transaction.That's why my status on > OrderPaymentPreference was PAYMENT_RECIVED. > > Do I have to explicitly call the *authOrderPayments* service before calling > the gateway? > If you can share any documentation links about transactions in ofbiz will > be helpful.. > > Thanks Once again > Madhi Krishnan > > > On Thu, Sep 10, 2020 at 2:55 PM Pritam Kute <[hidden email] > > > wrote: > > > Hello Madhi, > > > > Now based on the logs which you have shared, I suspect either > > orderPaymentPreferenceId passed to the custom service is wrong or the > > orderPaymentPreference status is not PAYMENT_AUTHORISED. I hope you have > > done payment authorization while placing the order. If you have done a > > direct sale transaction, then this might not work. > > > > Kind Regards, > > -- > > Pritam Kute > > > > > > On Thu, Sep 10, 2020 at 2:10 PM Madhi Krishnan < > > [hidden email]> wrote: > > > > > Hey pritam .. > > > Thanks for your response ,I appreciate it. > > > > > > I checked the entities that you mentioned above and it looks ok to me. > > > i'm getting a warning in the console saying no payment preference was > > > found.. > > > > > > Below are the logs that were generated. > > > |I| Running Service ECA Service: releaseOrderPayments, triggered by > rule > > on > > > Service: changeOrderStatus > > > 2020-09-10 13:48:54,303 |jsse-nio-8443-exec-3 |PaymentGatewayServices > > > |W| No OrderPaymentPreference records available for release > > > 2020-09-10 13:48:54,304 |jsse-nio-8443-exec-3 |ServiceDispatcher > > > |T| Sync service [order/releaseOrderPayments] finished in [2] > > > milliseconds > > > > > > other than that everything looks good in the logs.. > > > I tried to debug ..and i'm getting the warning from the service called > > " > > > *releaseOrderPayments*" > > > Service Implementation Location > > > > > > > > > ofbiz-framework/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java > > > At line 772. > > > > > > Thanks and regards > > > Madhi Krishnan > > > > > > On Thu, Sep 10, 2020 at 12:56 PM Pritam Kute < > > > [hidden email]> > > > wrote: > > > > > > > Hello Madhi, > > > > > > > > Not sure but can you check if you have associated your custom method > > with > > > > the right ProductStorePaymentSetting? > > > > > > > > <ProductStorePaymentSetting productStoreId="${productStoreId}" > > > > paymentMethodTypeId="CREDIT_CARD" > > > > paymentServiceTypeEnumId="PRDS_PAY_REFUND" > > paymentService="testCCRefund" > > > > paymentCustomMethodId="CC_REFUND_TEST"/> > > > > > > > > You can either put your payment gateway service name in > paymentService > > of > > > > the custom method ID in paymentCustomMethodId field. > > > > > > > > It will be good if you can post the error log here if this is not a > > case. > > > > > > > > Kind Regards, > > > > -- > > > > Pritam Kute > > > > > > > > > > > > On Thu, Sep 10, 2020 at 4:42 AM Madhi Krishnan < > > > > [hidden email]> wrote: > > > > > > > > > Hii community, > > > > > Hope you all are doing well. > > > > > > > > > > I'm using an external Payment gateway in my ecommerce setup ,and > I'm > > > able > > > > > to place orders using an external gateway.. > > > > > My question is, I'm struggling to call the refund api if the user > > > cancels > > > > > an order line in an order. > > > > > I have configured the custom_method entity as well.. > > > > > let me know if I'm missing something.. > > > > > > > > > > Thanks & Regards > > > > > Madhi Krishnan > > > > > > > > > > > > > > > |
Hey Pritam
So if order is cancelled from back-office application ,then ofbiz seems to be invoking only authorized and settled orders, it does not act on payment_recieved .Is that expected? or is it some feature awaiting to be implemented? Thanks & Regards Madhi Krishnan On Fri, Sep 11, 2020 at 11:39 AM Pritam Kute <[hidden email]> wrote: > Hello Madhi, > > Happy to know that it helped you. > > In payment integration, the process to get payment done depends on lots of > things like rules in-country, the payment gateway which you are using, etc. > > In OFBiz OOTB, the expected payment cycle should be like > 1. Payment authorisation when order is placed into the system by the user. > 2. If an order gets cancelled, payment authorisation is released > 3. If an order is edited, payment is released and re-authorised. > 3. If an order is approved/completed in the system, it captures the amount. > 4. If an order is returned after fulfilment, the payment is refunded. > > For direct sale transaction, your payment is already settled/captured in > the gateway. So using releaseOrderPayment is not recommended. You should > use refundPayment instead. releaseOrderPayment should only be used when the > payment is in authorised status, not captured/received. > > Kind Regards, > -- > Pritam Kute > > > On Thu, Sep 10, 2020 at 5:23 PM Madhi Krishnan < > [hidden email]> wrote: > > > Hey pritam > > > > Thanks man.. > > I was missing the payment_authorization thing.. > > I did a direct sales_transaction.That's why my status on > > OrderPaymentPreference was PAYMENT_RECIVED. > > > > Do I have to explicitly call the *authOrderPayments* service before > calling > > the gateway? > > If you can share any documentation links about transactions in ofbiz will > > be helpful.. > > > > Thanks Once again > > Madhi Krishnan > > > > > > On Thu, Sep 10, 2020 at 2:55 PM Pritam Kute < > [hidden email] > > > > > wrote: > > > > > Hello Madhi, > > > > > > Now based on the logs which you have shared, I suspect either > > > orderPaymentPreferenceId passed to the custom service is wrong or the > > > orderPaymentPreference status is not PAYMENT_AUTHORISED. I hope you > have > > > done payment authorization while placing the order. If you have done a > > > direct sale transaction, then this might not work. > > > > > > Kind Regards, > > > -- > > > Pritam Kute > > > > > > > > > On Thu, Sep 10, 2020 at 2:10 PM Madhi Krishnan < > > > [hidden email]> wrote: > > > > > > > Hey pritam .. > > > > Thanks for your response ,I appreciate it. > > > > > > > > I checked the entities that you mentioned above and it looks ok to > me. > > > > i'm getting a warning in the console saying no payment preference was > > > > found.. > > > > > > > > Below are the logs that were generated. > > > > |I| Running Service ECA Service: releaseOrderPayments, triggered by > > rule > > > on > > > > Service: changeOrderStatus > > > > 2020-09-10 13:48:54,303 |jsse-nio-8443-exec-3 |PaymentGatewayServices > > > > |W| No OrderPaymentPreference records available for release > > > > 2020-09-10 13:48:54,304 |jsse-nio-8443-exec-3 |ServiceDispatcher > > > > |T| Sync service [order/releaseOrderPayments] finished in [2] > > > > milliseconds > > > > > > > > other than that everything looks good in the logs.. > > > > I tried to debug ..and i'm getting the warning from the service > called > > > " > > > > *releaseOrderPayments*" > > > > Service Implementation Location > > > > > > > > > > > > > > ofbiz-framework/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java > > > > At line 772. > > > > > > > > Thanks and regards > > > > Madhi Krishnan > > > > > > > > On Thu, Sep 10, 2020 at 12:56 PM Pritam Kute < > > > > [hidden email]> > > > > wrote: > > > > > > > > > Hello Madhi, > > > > > > > > > > Not sure but can you check if you have associated your custom > method > > > with > > > > > the right ProductStorePaymentSetting? > > > > > > > > > > <ProductStorePaymentSetting productStoreId="${productStoreId}" > > > > > paymentMethodTypeId="CREDIT_CARD" > > > > > paymentServiceTypeEnumId="PRDS_PAY_REFUND" > > > paymentService="testCCRefund" > > > > > paymentCustomMethodId="CC_REFUND_TEST"/> > > > > > > > > > > You can either put your payment gateway service name in > > paymentService > > > of > > > > > the custom method ID in paymentCustomMethodId field. > > > > > > > > > > It will be good if you can post the error log here if this is not a > > > case. > > > > > > > > > > Kind Regards, > > > > > -- > > > > > Pritam Kute > > > > > > > > > > > > > > > On Thu, Sep 10, 2020 at 4:42 AM Madhi Krishnan < > > > > > [hidden email]> wrote: > > > > > > > > > > > Hii community, > > > > > > Hope you all are doing well. > > > > > > > > > > > > I'm using an external Payment gateway in my ecommerce setup ,and > > I'm > > > > able > > > > > > to place orders using an external gateway.. > > > > > > My question is, I'm struggling to call the refund api if the user > > > > cancels > > > > > > an order line in an order. > > > > > > I have configured the custom_method entity as well.. > > > > > > let me know if I'm missing something.. > > > > > > > > > > > > Thanks & Regards > > > > > > Madhi Krishnan > > > > > > > > > > > > > > > > > > > > > |
Hello Madhi,
I believe in general eCommerce workflow, an order cannot be canceled when it is shipped or completed. It should always be returned. If payment is received for the order, it means order is completed in OFBiz. So in that case, you should create a return instead of canceling the order. I think there is some confusion in the process which you are following. Can you provide some steps in your system how you are processing the fulfillment? Kind Regards, -- Pritam Kute On Fri, Sep 11, 2020 at 1:29 PM Madhi Krishnan < [hidden email]> wrote: > Hey Pritam > > So if order is cancelled from back-office application ,then ofbiz seems to > be invoking only authorized and settled orders, > it does not act on payment_recieved .Is that expected? > or is it some feature awaiting to be implemented? > > Thanks & Regards > Madhi Krishnan > > On Fri, Sep 11, 2020 at 11:39 AM Pritam Kute < > [hidden email]> > wrote: > > > Hello Madhi, > > > > Happy to know that it helped you. > > > > In payment integration, the process to get payment done depends on lots > of > > things like rules in-country, the payment gateway which you are using, > etc. > > > > In OFBiz OOTB, the expected payment cycle should be like > > 1. Payment authorisation when order is placed into the system by the > user. > > 2. If an order gets cancelled, payment authorisation is released > > 3. If an order is edited, payment is released and re-authorised. > > 3. If an order is approved/completed in the system, it captures the > amount. > > 4. If an order is returned after fulfilment, the payment is refunded. > > > > For direct sale transaction, your payment is already settled/captured in > > the gateway. So using releaseOrderPayment is not recommended. You should > > use refundPayment instead. releaseOrderPayment should only be used when > the > > payment is in authorised status, not captured/received. > > > > Kind Regards, > > -- > > Pritam Kute > > > > > > On Thu, Sep 10, 2020 at 5:23 PM Madhi Krishnan < > > [hidden email]> wrote: > > > > > Hey pritam > > > > > > Thanks man.. > > > I was missing the payment_authorization thing.. > > > I did a direct sales_transaction.That's why my status on > > > OrderPaymentPreference was PAYMENT_RECIVED. > > > > > > Do I have to explicitly call the *authOrderPayments* service before > > calling > > > the gateway? > > > If you can share any documentation links about transactions in ofbiz > will > > > be helpful.. > > > > > > Thanks Once again > > > Madhi Krishnan > > > > > > > > > On Thu, Sep 10, 2020 at 2:55 PM Pritam Kute < > > [hidden email] > > > > > > > wrote: > > > > > > > Hello Madhi, > > > > > > > > Now based on the logs which you have shared, I suspect either > > > > orderPaymentPreferenceId passed to the custom service is wrong or the > > > > orderPaymentPreference status is not PAYMENT_AUTHORISED. I hope you > > have > > > > done payment authorization while placing the order. If you have done > a > > > > direct sale transaction, then this might not work. > > > > > > > > Kind Regards, > > > > -- > > > > Pritam Kute > > > > > > > > > > > > On Thu, Sep 10, 2020 at 2:10 PM Madhi Krishnan < > > > > [hidden email]> wrote: > > > > > > > > > Hey pritam .. > > > > > Thanks for your response ,I appreciate it. > > > > > > > > > > I checked the entities that you mentioned above and it looks ok to > > me. > > > > > i'm getting a warning in the console saying no payment preference > was > > > > > found.. > > > > > > > > > > Below are the logs that were generated. > > > > > |I| Running Service ECA Service: releaseOrderPayments, triggered by > > > rule > > > > on > > > > > Service: changeOrderStatus > > > > > 2020-09-10 13:48:54,303 |jsse-nio-8443-exec-3 > |PaymentGatewayServices > > > > > |W| No OrderPaymentPreference records available for release > > > > > 2020-09-10 13:48:54,304 |jsse-nio-8443-exec-3 |ServiceDispatcher > > > > > |T| Sync service [order/releaseOrderPayments] finished in [2] > > > > > milliseconds > > > > > > > > > > other than that everything looks good in the logs.. > > > > > I tried to debug ..and i'm getting the warning from the service > > called > > > > " > > > > > *releaseOrderPayments*" > > > > > Service Implementation Location > > > > > > > > > > > > > > > > > > > > ofbiz-framework/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java > > > > > At line 772. > > > > > > > > > > Thanks and regards > > > > > Madhi Krishnan > > > > > > > > > > On Thu, Sep 10, 2020 at 12:56 PM Pritam Kute < > > > > > [hidden email]> > > > > > wrote: > > > > > > > > > > > Hello Madhi, > > > > > > > > > > > > Not sure but can you check if you have associated your custom > > method > > > > with > > > > > > the right ProductStorePaymentSetting? > > > > > > > > > > > > <ProductStorePaymentSetting productStoreId="${productStoreId}" > > > > > > paymentMethodTypeId="CREDIT_CARD" > > > > > > paymentServiceTypeEnumId="PRDS_PAY_REFUND" > > > > paymentService="testCCRefund" > > > > > > paymentCustomMethodId="CC_REFUND_TEST"/> > > > > > > > > > > > > You can either put your payment gateway service name in > > > paymentService > > > > of > > > > > > the custom method ID in paymentCustomMethodId field. > > > > > > > > > > > > It will be good if you can post the error log here if this is > not a > > > > case. > > > > > > > > > > > > Kind Regards, > > > > > > -- > > > > > > Pritam Kute > > > > > > > > > > > > > > > > > > On Thu, Sep 10, 2020 at 4:42 AM Madhi Krishnan < > > > > > > [hidden email]> wrote: > > > > > > > > > > > > > Hii community, > > > > > > > Hope you all are doing well. > > > > > > > > > > > > > > I'm using an external Payment gateway in my ecommerce setup > ,and > > > I'm > > > > > able > > > > > > > to place orders using an external gateway.. > > > > > > > My question is, I'm struggling to call the refund api if the > user > > > > > cancels > > > > > > > an order line in an order. > > > > > > > I have configured the custom_method entity as well.. > > > > > > > let me know if I'm missing something.. > > > > > > > > > > > > > > Thanks & Regards > > > > > > > Madhi Krishnan > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
Hii Pritam.
I basically followed the ofbiz ecommerce flow .. Shipping -> Shipping_type -> Payment_method ->final_review_page -> External Gateway ->Callback Url.. Here I am using a gateway Called PAYTM. So once the user clicks the place Order button on the final review page ,the request goes to the *processOrder*.. Here the request get redirects to *checkExternalPayment ,* So from here the user gets redirected to my External Gateway.. Here i have noticed that at this stage the status is set as PAYMENT_NOT_RECIVED, is that correct? Once the user comes back to my site ..i'm processing the gateway's response and depending on the status i am either *approving *the order or *cancelling *the order.. Thanks & Regards Madhi Krishnan On Fri, Sep 11, 2020 at 2:12 PM Pritam Kute <[hidden email]> wrote: > Hello Madhi, > > I believe in general eCommerce workflow, an order cannot be canceled when > it is shipped or completed. It should always be returned. > > If payment is received for the order, it means order is completed in OFBiz. > So in that case, you should create a return instead of canceling the order. > > I think there is some confusion in the process which you are following. Can > you provide some steps in your system how you are processing the > fulfillment? > > Kind Regards, > -- > Pritam Kute > > > On Fri, Sep 11, 2020 at 1:29 PM Madhi Krishnan < > [hidden email]> wrote: > > > Hey Pritam > > > > So if order is cancelled from back-office application ,then ofbiz seems > to > > be invoking only authorized and settled orders, > > it does not act on payment_recieved .Is that expected? > > or is it some feature awaiting to be implemented? > > > > Thanks & Regards > > Madhi Krishnan > > > > On Fri, Sep 11, 2020 at 11:39 AM Pritam Kute < > > [hidden email]> > > wrote: > > > > > Hello Madhi, > > > > > > Happy to know that it helped you. > > > > > > In payment integration, the process to get payment done depends on lots > > of > > > things like rules in-country, the payment gateway which you are using, > > etc. > > > > > > In OFBiz OOTB, the expected payment cycle should be like > > > 1. Payment authorisation when order is placed into the system by the > > user. > > > 2. If an order gets cancelled, payment authorisation is released > > > 3. If an order is edited, payment is released and re-authorised. > > > 3. If an order is approved/completed in the system, it captures the > > amount. > > > 4. If an order is returned after fulfilment, the payment is refunded. > > > > > > For direct sale transaction, your payment is already settled/captured > in > > > the gateway. So using releaseOrderPayment is not recommended. You > should > > > use refundPayment instead. releaseOrderPayment should only be used when > > the > > > payment is in authorised status, not captured/received. > > > > > > Kind Regards, > > > -- > > > Pritam Kute > > > > > > > > > On Thu, Sep 10, 2020 at 5:23 PM Madhi Krishnan < > > > [hidden email]> wrote: > > > > > > > Hey pritam > > > > > > > > Thanks man.. > > > > I was missing the payment_authorization thing.. > > > > I did a direct sales_transaction.That's why my status on > > > > OrderPaymentPreference was PAYMENT_RECIVED. > > > > > > > > Do I have to explicitly call the *authOrderPayments* service before > > > calling > > > > the gateway? > > > > If you can share any documentation links about transactions in ofbiz > > will > > > > be helpful.. > > > > > > > > Thanks Once again > > > > Madhi Krishnan > > > > > > > > > > > > On Thu, Sep 10, 2020 at 2:55 PM Pritam Kute < > > > [hidden email] > > > > > > > > > wrote: > > > > > > > > > Hello Madhi, > > > > > > > > > > Now based on the logs which you have shared, I suspect either > > > > > orderPaymentPreferenceId passed to the custom service is wrong or > the > > > > > orderPaymentPreference status is not PAYMENT_AUTHORISED. I hope you > > > have > > > > > done payment authorization while placing the order. If you have > done > > a > > > > > direct sale transaction, then this might not work. > > > > > > > > > > Kind Regards, > > > > > -- > > > > > Pritam Kute > > > > > > > > > > > > > > > On Thu, Sep 10, 2020 at 2:10 PM Madhi Krishnan < > > > > > [hidden email]> wrote: > > > > > > > > > > > Hey pritam .. > > > > > > Thanks for your response ,I appreciate it. > > > > > > > > > > > > I checked the entities that you mentioned above and it looks ok > to > > > me. > > > > > > i'm getting a warning in the console saying no payment preference > > was > > > > > > found.. > > > > > > > > > > > > Below are the logs that were generated. > > > > > > |I| Running Service ECA Service: releaseOrderPayments, triggered > by > > > > rule > > > > > on > > > > > > Service: changeOrderStatus > > > > > > 2020-09-10 13:48:54,303 |jsse-nio-8443-exec-3 > > |PaymentGatewayServices > > > > > > |W| No OrderPaymentPreference records available for release > > > > > > 2020-09-10 13:48:54,304 |jsse-nio-8443-exec-3 |ServiceDispatcher > > > > > > |T| Sync service [order/releaseOrderPayments] finished in [2] > > > > > > milliseconds > > > > > > > > > > > > other than that everything looks good in the logs.. > > > > > > I tried to debug ..and i'm getting the warning from the service > > > called > > > > > " > > > > > > *releaseOrderPayments*" > > > > > > Service Implementation Location > > > > > > > > > > > > > > > > > > > > > > > > > > > ofbiz-framework/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java > > > > > > At line 772. > > > > > > > > > > > > Thanks and regards > > > > > > Madhi Krishnan > > > > > > > > > > > > On Thu, Sep 10, 2020 at 12:56 PM Pritam Kute < > > > > > > [hidden email]> > > > > > > wrote: > > > > > > > > > > > > > Hello Madhi, > > > > > > > > > > > > > > Not sure but can you check if you have associated your custom > > > method > > > > > with > > > > > > > the right ProductStorePaymentSetting? > > > > > > > > > > > > > > <ProductStorePaymentSetting productStoreId="${productStoreId}" > > > > > > > paymentMethodTypeId="CREDIT_CARD" > > > > > > > paymentServiceTypeEnumId="PRDS_PAY_REFUND" > > > > > paymentService="testCCRefund" > > > > > > > paymentCustomMethodId="CC_REFUND_TEST"/> > > > > > > > > > > > > > > You can either put your payment gateway service name in > > > > paymentService > > > > > of > > > > > > > the custom method ID in paymentCustomMethodId field. > > > > > > > > > > > > > > It will be good if you can post the error log here if this is > > not a > > > > > case. > > > > > > > > > > > > > > Kind Regards, > > > > > > > -- > > > > > > > Pritam Kute > > > > > > > > > > > > > > > > > > > > > On Thu, Sep 10, 2020 at 4:42 AM Madhi Krishnan < > > > > > > > [hidden email]> wrote: > > > > > > > > > > > > > > > Hii community, > > > > > > > > Hope you all are doing well. > > > > > > > > > > > > > > > > I'm using an external Payment gateway in my ecommerce setup > > ,and > > > > I'm > > > > > > able > > > > > > > > to place orders using an external gateway.. > > > > > > > > My question is, I'm struggling to call the refund api if the > > user > > > > > > cancels > > > > > > > > an order line in an order. > > > > > > > > I have configured the custom_method entity as well.. > > > > > > > > let me know if I'm missing something.. > > > > > > > > > > > > > > > > Thanks & Regards > > > > > > > > Madhi Krishnan > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
Hello Madhi,
The way you have implemented the payment gateway is completely fine. The payment status thing also looks good to me. It all depends on how you have requested a payment gateway to process the transaction. Some payment gateways do direct sale transactions means the amount is debited from the customer's card once the transaction is successful. Another way is to authorize the amount in which payment gateway only authorizes the amount on the customer's card when order is placed into the system. It is not charged on the card yet. Once the order is approved or completed in the system, the system should send another request to the payment gateway to capture the transaction. This time the amount is actually charged on the customer's card. So if you have requested a direct sale transaction to PayTM, I will recommend you use a "refundPayment" service at the time of cancellation or edits in the order. Kind Regards, -- Pritam Kute On Mon, Sep 14, 2020 at 2:16 PM Madhi Krishnan < [hidden email]> wrote: > Hii Pritam. > > I basically followed the ofbiz ecommerce flow .. > Shipping -> Shipping_type -> Payment_method ->final_review_page -> External > Gateway ->Callback Url.. > > Here I am using a gateway Called PAYTM. > So once the user clicks the place Order button on the final review page > ,the request goes to the *processOrder*.. > Here the request get redirects to *checkExternalPayment ,* > So from here the user gets redirected to my External Gateway.. > > Here i have noticed that at this stage the status is set as > PAYMENT_NOT_RECIVED, is that correct? > > Once the user comes back to my site ..i'm processing the gateway's response > and depending on the status i am either *approving *the order or > *cancelling > *the order.. > > Thanks & Regards > Madhi Krishnan > > > > On Fri, Sep 11, 2020 at 2:12 PM Pritam Kute <[hidden email] > > > wrote: > > > Hello Madhi, > > > > I believe in general eCommerce workflow, an order cannot be canceled when > > it is shipped or completed. It should always be returned. > > > > If payment is received for the order, it means order is completed in > OFBiz. > > So in that case, you should create a return instead of canceling the > order. > > > > I think there is some confusion in the process which you are following. > Can > > you provide some steps in your system how you are processing the > > fulfillment? > > > > Kind Regards, > > -- > > Pritam Kute > > > > > > On Fri, Sep 11, 2020 at 1:29 PM Madhi Krishnan < > > [hidden email]> wrote: > > > > > Hey Pritam > > > > > > So if order is cancelled from back-office application ,then ofbiz seems > > to > > > be invoking only authorized and settled orders, > > > it does not act on payment_recieved .Is that expected? > > > or is it some feature awaiting to be implemented? > > > > > > Thanks & Regards > > > Madhi Krishnan > > > > > > On Fri, Sep 11, 2020 at 11:39 AM Pritam Kute < > > > [hidden email]> > > > wrote: > > > > > > > Hello Madhi, > > > > > > > > Happy to know that it helped you. > > > > > > > > In payment integration, the process to get payment done depends on > lots > > > of > > > > things like rules in-country, the payment gateway which you are > using, > > > etc. > > > > > > > > In OFBiz OOTB, the expected payment cycle should be like > > > > 1. Payment authorisation when order is placed into the system by the > > > user. > > > > 2. If an order gets cancelled, payment authorisation is released > > > > 3. If an order is edited, payment is released and re-authorised. > > > > 3. If an order is approved/completed in the system, it captures the > > > amount. > > > > 4. If an order is returned after fulfilment, the payment is refunded. > > > > > > > > For direct sale transaction, your payment is already settled/captured > > in > > > > the gateway. So using releaseOrderPayment is not recommended. You > > should > > > > use refundPayment instead. releaseOrderPayment should only be used > when > > > the > > > > payment is in authorised status, not captured/received. > > > > > > > > Kind Regards, > > > > -- > > > > Pritam Kute > > > > > > > > > > > > On Thu, Sep 10, 2020 at 5:23 PM Madhi Krishnan < > > > > [hidden email]> wrote: > > > > > > > > > Hey pritam > > > > > > > > > > Thanks man.. > > > > > I was missing the payment_authorization thing.. > > > > > I did a direct sales_transaction.That's why my status on > > > > > OrderPaymentPreference was PAYMENT_RECIVED. > > > > > > > > > > Do I have to explicitly call the *authOrderPayments* service before > > > > calling > > > > > the gateway? > > > > > If you can share any documentation links about transactions in > ofbiz > > > will > > > > > be helpful.. > > > > > > > > > > Thanks Once again > > > > > Madhi Krishnan > > > > > > > > > > > > > > > On Thu, Sep 10, 2020 at 2:55 PM Pritam Kute < > > > > [hidden email] > > > > > > > > > > > wrote: > > > > > > > > > > > Hello Madhi, > > > > > > > > > > > > Now based on the logs which you have shared, I suspect either > > > > > > orderPaymentPreferenceId passed to the custom service is wrong or > > the > > > > > > orderPaymentPreference status is not PAYMENT_AUTHORISED. I hope > you > > > > have > > > > > > done payment authorization while placing the order. If you have > > done > > > a > > > > > > direct sale transaction, then this might not work. > > > > > > > > > > > > Kind Regards, > > > > > > -- > > > > > > Pritam Kute > > > > > > > > > > > > > > > > > > On Thu, Sep 10, 2020 at 2:10 PM Madhi Krishnan < > > > > > > [hidden email]> wrote: > > > > > > > > > > > > > Hey pritam .. > > > > > > > Thanks for your response ,I appreciate it. > > > > > > > > > > > > > > I checked the entities that you mentioned above and it looks ok > > to > > > > me. > > > > > > > i'm getting a warning in the console saying no payment > preference > > > was > > > > > > > found.. > > > > > > > > > > > > > > Below are the logs that were generated. > > > > > > > |I| Running Service ECA Service: releaseOrderPayments, > triggered > > by > > > > > rule > > > > > > on > > > > > > > Service: changeOrderStatus > > > > > > > 2020-09-10 13:48:54,303 |jsse-nio-8443-exec-3 > > > |PaymentGatewayServices > > > > > > > |W| No OrderPaymentPreference records available for release > > > > > > > 2020-09-10 13:48:54,304 |jsse-nio-8443-exec-3 > |ServiceDispatcher > > > > > > > |T| Sync service [order/releaseOrderPayments] finished in [2] > > > > > > > milliseconds > > > > > > > > > > > > > > other than that everything looks good in the logs.. > > > > > > > I tried to debug ..and i'm getting the warning from the > service > > > > called > > > > > > " > > > > > > > *releaseOrderPayments*" > > > > > > > Service Implementation Location > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ofbiz-framework/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java > > > > > > > At line 772. > > > > > > > > > > > > > > Thanks and regards > > > > > > > Madhi Krishnan > > > > > > > > > > > > > > On Thu, Sep 10, 2020 at 12:56 PM Pritam Kute < > > > > > > > [hidden email]> > > > > > > > wrote: > > > > > > > > > > > > > > > Hello Madhi, > > > > > > > > > > > > > > > > Not sure but can you check if you have associated your custom > > > > method > > > > > > with > > > > > > > > the right ProductStorePaymentSetting? > > > > > > > > > > > > > > > > <ProductStorePaymentSetting > productStoreId="${productStoreId}" > > > > > > > > paymentMethodTypeId="CREDIT_CARD" > > > > > > > > paymentServiceTypeEnumId="PRDS_PAY_REFUND" > > > > > > paymentService="testCCRefund" > > > > > > > > paymentCustomMethodId="CC_REFUND_TEST"/> > > > > > > > > > > > > > > > > You can either put your payment gateway service name in > > > > > paymentService > > > > > > of > > > > > > > > the custom method ID in paymentCustomMethodId field. > > > > > > > > > > > > > > > > It will be good if you can post the error log here if this is > > > not a > > > > > > case. > > > > > > > > > > > > > > > > Kind Regards, > > > > > > > > -- > > > > > > > > Pritam Kute > > > > > > > > > > > > > > > > > > > > > > > > On Thu, Sep 10, 2020 at 4:42 AM Madhi Krishnan < > > > > > > > > [hidden email]> wrote: > > > > > > > > > > > > > > > > > Hii community, > > > > > > > > > Hope you all are doing well. > > > > > > > > > > > > > > > > > > I'm using an external Payment gateway in my ecommerce setup > > > ,and > > > > > I'm > > > > > > > able > > > > > > > > > to place orders using an external gateway.. > > > > > > > > > My question is, I'm struggling to call the refund api if > the > > > user > > > > > > > cancels > > > > > > > > > an order line in an order. > > > > > > > > > I have configured the custom_method entity as well.. > > > > > > > > > let me know if I'm missing something.. > > > > > > > > > > > > > > > > > > Thanks & Regards > > > > > > > > > Madhi Krishnan > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
Hii Pritam..
Yes I did a direct sales transaction... So if a call *refundPayment *service directly on order cancel or order edit ,will it not disturb the ofbiz flow ? Thanks & Regards Madhi Krishnan On Mon, Sep 14, 2020 at 2:47 PM Pritam Kute <[hidden email]> wrote: > Hello Madhi, > > The way you have implemented the payment gateway is completely fine. The > payment status thing also looks good to me. It all depends on how you have > requested a payment gateway to process the transaction. Some payment > gateways do direct sale transactions means the amount is debited from > the customer's card once the transaction is successful. Another way is to > authorize the amount in which payment gateway only authorizes the amount on > the customer's card when order is placed into the system. It is not charged > on the card yet. Once the order is approved or completed in the system, the > system should send another request to the payment gateway to capture the > transaction. This time the amount is actually charged on the customer's > card. > > So if you have requested a direct sale transaction to PayTM, I will > recommend you use a "refundPayment" service at the time of cancellation or > edits in the order. > > Kind Regards, > -- > Pritam Kute > > > On Mon, Sep 14, 2020 at 2:16 PM Madhi Krishnan < > [hidden email]> wrote: > > > Hii Pritam. > > > > I basically followed the ofbiz ecommerce flow .. > > Shipping -> Shipping_type -> Payment_method ->final_review_page -> > External > > Gateway ->Callback Url.. > > > > Here I am using a gateway Called PAYTM. > > So once the user clicks the place Order button on the final review page > > ,the request goes to the *processOrder*.. > > Here the request get redirects to *checkExternalPayment ,* > > So from here the user gets redirected to my External Gateway.. > > > > Here i have noticed that at this stage the status is set as > > PAYMENT_NOT_RECIVED, is that correct? > > > > Once the user comes back to my site ..i'm processing the gateway's > response > > and depending on the status i am either *approving *the order or > > *cancelling > > *the order.. > > > > Thanks & Regards > > Madhi Krishnan > > > > > > > > On Fri, Sep 11, 2020 at 2:12 PM Pritam Kute < > [hidden email] > > > > > wrote: > > > > > Hello Madhi, > > > > > > I believe in general eCommerce workflow, an order cannot be canceled > when > > > it is shipped or completed. It should always be returned. > > > > > > If payment is received for the order, it means order is completed in > > OFBiz. > > > So in that case, you should create a return instead of canceling the > > order. > > > > > > I think there is some confusion in the process which you are following. > > Can > > > you provide some steps in your system how you are processing the > > > fulfillment? > > > > > > Kind Regards, > > > -- > > > Pritam Kute > > > > > > > > > On Fri, Sep 11, 2020 at 1:29 PM Madhi Krishnan < > > > [hidden email]> wrote: > > > > > > > Hey Pritam > > > > > > > > So if order is cancelled from back-office application ,then ofbiz > seems > > > to > > > > be invoking only authorized and settled orders, > > > > it does not act on payment_recieved .Is that expected? > > > > or is it some feature awaiting to be implemented? > > > > > > > > Thanks & Regards > > > > Madhi Krishnan > > > > > > > > On Fri, Sep 11, 2020 at 11:39 AM Pritam Kute < > > > > [hidden email]> > > > > wrote: > > > > > > > > > Hello Madhi, > > > > > > > > > > Happy to know that it helped you. > > > > > > > > > > In payment integration, the process to get payment done depends on > > lots > > > > of > > > > > things like rules in-country, the payment gateway which you are > > using, > > > > etc. > > > > > > > > > > In OFBiz OOTB, the expected payment cycle should be like > > > > > 1. Payment authorisation when order is placed into the system by > the > > > > user. > > > > > 2. If an order gets cancelled, payment authorisation is released > > > > > 3. If an order is edited, payment is released and re-authorised. > > > > > 3. If an order is approved/completed in the system, it captures the > > > > amount. > > > > > 4. If an order is returned after fulfilment, the payment is > refunded. > > > > > > > > > > For direct sale transaction, your payment is already > settled/captured > > > in > > > > > the gateway. So using releaseOrderPayment is not recommended. You > > > should > > > > > use refundPayment instead. releaseOrderPayment should only be used > > when > > > > the > > > > > payment is in authorised status, not captured/received. > > > > > > > > > > Kind Regards, > > > > > -- > > > > > Pritam Kute > > > > > > > > > > > > > > > On Thu, Sep 10, 2020 at 5:23 PM Madhi Krishnan < > > > > > [hidden email]> wrote: > > > > > > > > > > > Hey pritam > > > > > > > > > > > > Thanks man.. > > > > > > I was missing the payment_authorization thing.. > > > > > > I did a direct sales_transaction.That's why my status on > > > > > > OrderPaymentPreference was PAYMENT_RECIVED. > > > > > > > > > > > > Do I have to explicitly call the *authOrderPayments* service > before > > > > > calling > > > > > > the gateway? > > > > > > If you can share any documentation links about transactions in > > ofbiz > > > > will > > > > > > be helpful.. > > > > > > > > > > > > Thanks Once again > > > > > > Madhi Krishnan > > > > > > > > > > > > > > > > > > On Thu, Sep 10, 2020 at 2:55 PM Pritam Kute < > > > > > [hidden email] > > > > > > > > > > > > > wrote: > > > > > > > > > > > > > Hello Madhi, > > > > > > > > > > > > > > Now based on the logs which you have shared, I suspect either > > > > > > > orderPaymentPreferenceId passed to the custom service is wrong > or > > > the > > > > > > > orderPaymentPreference status is not PAYMENT_AUTHORISED. I hope > > you > > > > > have > > > > > > > done payment authorization while placing the order. If you have > > > done > > > > a > > > > > > > direct sale transaction, then this might not work. > > > > > > > > > > > > > > Kind Regards, > > > > > > > -- > > > > > > > Pritam Kute > > > > > > > > > > > > > > > > > > > > > On Thu, Sep 10, 2020 at 2:10 PM Madhi Krishnan < > > > > > > > [hidden email]> wrote: > > > > > > > > > > > > > > > Hey pritam .. > > > > > > > > Thanks for your response ,I appreciate it. > > > > > > > > > > > > > > > > I checked the entities that you mentioned above and it looks > ok > > > to > > > > > me. > > > > > > > > i'm getting a warning in the console saying no payment > > preference > > > > was > > > > > > > > found.. > > > > > > > > > > > > > > > > Below are the logs that were generated. > > > > > > > > |I| Running Service ECA Service: releaseOrderPayments, > > triggered > > > by > > > > > > rule > > > > > > > on > > > > > > > > Service: changeOrderStatus > > > > > > > > 2020-09-10 13:48:54,303 |jsse-nio-8443-exec-3 > > > > |PaymentGatewayServices > > > > > > > > |W| No OrderPaymentPreference records available for release > > > > > > > > 2020-09-10 13:48:54,304 |jsse-nio-8443-exec-3 > > |ServiceDispatcher > > > > > > > > |T| Sync service [order/releaseOrderPayments] finished in > [2] > > > > > > > > milliseconds > > > > > > > > > > > > > > > > other than that everything looks good in the logs.. > > > > > > > > I tried to debug ..and i'm getting the warning from the > > service > > > > > called > > > > > > > " > > > > > > > > *releaseOrderPayments*" > > > > > > > > Service Implementation Location > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ofbiz-framework/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java > > > > > > > > At line 772. > > > > > > > > > > > > > > > > Thanks and regards > > > > > > > > Madhi Krishnan > > > > > > > > > > > > > > > > On Thu, Sep 10, 2020 at 12:56 PM Pritam Kute < > > > > > > > > [hidden email]> > > > > > > > > wrote: > > > > > > > > > > > > > > > > > Hello Madhi, > > > > > > > > > > > > > > > > > > Not sure but can you check if you have associated your > custom > > > > > method > > > > > > > with > > > > > > > > > the right ProductStorePaymentSetting? > > > > > > > > > > > > > > > > > > <ProductStorePaymentSetting > > productStoreId="${productStoreId}" > > > > > > > > > paymentMethodTypeId="CREDIT_CARD" > > > > > > > > > paymentServiceTypeEnumId="PRDS_PAY_REFUND" > > > > > > > paymentService="testCCRefund" > > > > > > > > > paymentCustomMethodId="CC_REFUND_TEST"/> > > > > > > > > > > > > > > > > > > You can either put your payment gateway service name in > > > > > > paymentService > > > > > > > of > > > > > > > > > the custom method ID in paymentCustomMethodId field. > > > > > > > > > > > > > > > > > > It will be good if you can post the error log here if this > is > > > > not a > > > > > > > case. > > > > > > > > > > > > > > > > > > Kind Regards, > > > > > > > > > -- > > > > > > > > > Pritam Kute > > > > > > > > > > > > > > > > > > > > > > > > > > > On Thu, Sep 10, 2020 at 4:42 AM Madhi Krishnan < > > > > > > > > > [hidden email]> wrote: > > > > > > > > > > > > > > > > > > > Hii community, > > > > > > > > > > Hope you all are doing well. > > > > > > > > > > > > > > > > > > > > I'm using an external Payment gateway in my ecommerce > setup > > > > ,and > > > > > > I'm > > > > > > > > able > > > > > > > > > > to place orders using an external gateway.. > > > > > > > > > > My question is, I'm struggling to call the refund api if > > the > > > > user > > > > > > > > cancels > > > > > > > > > > an order line in an order. > > > > > > > > > > I have configured the custom_method entity as well.. > > > > > > > > > > let me know if I'm missing something.. > > > > > > > > > > > > > > > > > > > > Thanks & Regards > > > > > > > > > > Madhi Krishnan > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
Hello Madhi,
Direct sale transactions mean the payments are already settled at the payment gateway so you need to refund the payment to the customer. The release payment will not work in that case. I will need some time to look into code for commenting on the impact on OFBiz flow. In general understanding, I don't think it will have any adverse effects on OFBiz flow as this is the recommended workflow. Kind Regards, -- Pritam Kute On Mon, Sep 14, 2020 at 3:11 PM Madhi Krishnan < [hidden email]> wrote: > Hii Pritam.. > > Yes I did a direct sales transaction... > So if a call *refundPayment *service directly on order cancel or order edit > ,will it not disturb the ofbiz flow ? > > Thanks & Regards > Madhi Krishnan > > On Mon, Sep 14, 2020 at 2:47 PM Pritam Kute <[hidden email] > > > wrote: > > > Hello Madhi, > > > > The way you have implemented the payment gateway is completely fine. The > > payment status thing also looks good to me. It all depends on how you > have > > requested a payment gateway to process the transaction. Some payment > > gateways do direct sale transactions means the amount is debited from > > the customer's card once the transaction is successful. Another way is to > > authorize the amount in which payment gateway only authorizes the amount > on > > the customer's card when order is placed into the system. It is not > charged > > on the card yet. Once the order is approved or completed in the system, > the > > system should send another request to the payment gateway to capture the > > transaction. This time the amount is actually charged on the customer's > > card. > > > > So if you have requested a direct sale transaction to PayTM, I will > > recommend you use a "refundPayment" service at the time of cancellation > or > > edits in the order. > > > > Kind Regards, > > -- > > Pritam Kute > > > > > > On Mon, Sep 14, 2020 at 2:16 PM Madhi Krishnan < > > [hidden email]> wrote: > > > > > Hii Pritam. > > > > > > I basically followed the ofbiz ecommerce flow .. > > > Shipping -> Shipping_type -> Payment_method ->final_review_page -> > > External > > > Gateway ->Callback Url.. > > > > > > Here I am using a gateway Called PAYTM. > > > So once the user clicks the place Order button on the final review page > > > ,the request goes to the *processOrder*.. > > > Here the request get redirects to *checkExternalPayment ,* > > > So from here the user gets redirected to my External Gateway.. > > > > > > Here i have noticed that at this stage the status is set as > > > PAYMENT_NOT_RECIVED, is that correct? > > > > > > Once the user comes back to my site ..i'm processing the gateway's > > response > > > and depending on the status i am either *approving *the order or > > > *cancelling > > > *the order.. > > > > > > Thanks & Regards > > > Madhi Krishnan > > > > > > > > > > > > On Fri, Sep 11, 2020 at 2:12 PM Pritam Kute < > > [hidden email] > > > > > > > wrote: > > > > > > > Hello Madhi, > > > > > > > > I believe in general eCommerce workflow, an order cannot be canceled > > when > > > > it is shipped or completed. It should always be returned. > > > > > > > > If payment is received for the order, it means order is completed in > > > OFBiz. > > > > So in that case, you should create a return instead of canceling the > > > order. > > > > > > > > I think there is some confusion in the process which you are > following. > > > Can > > > > you provide some steps in your system how you are processing the > > > > fulfillment? > > > > > > > > Kind Regards, > > > > -- > > > > Pritam Kute > > > > > > > > > > > > On Fri, Sep 11, 2020 at 1:29 PM Madhi Krishnan < > > > > [hidden email]> wrote: > > > > > > > > > Hey Pritam > > > > > > > > > > So if order is cancelled from back-office application ,then ofbiz > > seems > > > > to > > > > > be invoking only authorized and settled orders, > > > > > it does not act on payment_recieved .Is that expected? > > > > > or is it some feature awaiting to be implemented? > > > > > > > > > > Thanks & Regards > > > > > Madhi Krishnan > > > > > > > > > > On Fri, Sep 11, 2020 at 11:39 AM Pritam Kute < > > > > > [hidden email]> > > > > > wrote: > > > > > > > > > > > Hello Madhi, > > > > > > > > > > > > Happy to know that it helped you. > > > > > > > > > > > > In payment integration, the process to get payment done depends > on > > > lots > > > > > of > > > > > > things like rules in-country, the payment gateway which you are > > > using, > > > > > etc. > > > > > > > > > > > > In OFBiz OOTB, the expected payment cycle should be like > > > > > > 1. Payment authorisation when order is placed into the system by > > the > > > > > user. > > > > > > 2. If an order gets cancelled, payment authorisation is released > > > > > > 3. If an order is edited, payment is released and re-authorised. > > > > > > 3. If an order is approved/completed in the system, it captures > the > > > > > amount. > > > > > > 4. If an order is returned after fulfilment, the payment is > > refunded. > > > > > > > > > > > > For direct sale transaction, your payment is already > > settled/captured > > > > in > > > > > > the gateway. So using releaseOrderPayment is not recommended. You > > > > should > > > > > > use refundPayment instead. releaseOrderPayment should only be > used > > > when > > > > > the > > > > > > payment is in authorised status, not captured/received. > > > > > > > > > > > > Kind Regards, > > > > > > -- > > > > > > Pritam Kute > > > > > > > > > > > > > > > > > > On Thu, Sep 10, 2020 at 5:23 PM Madhi Krishnan < > > > > > > [hidden email]> wrote: > > > > > > > > > > > > > Hey pritam > > > > > > > > > > > > > > Thanks man.. > > > > > > > I was missing the payment_authorization thing.. > > > > > > > I did a direct sales_transaction.That's why my status on > > > > > > > OrderPaymentPreference was PAYMENT_RECIVED. > > > > > > > > > > > > > > Do I have to explicitly call the *authOrderPayments* service > > before > > > > > > calling > > > > > > > the gateway? > > > > > > > If you can share any documentation links about transactions in > > > ofbiz > > > > > will > > > > > > > be helpful.. > > > > > > > > > > > > > > Thanks Once again > > > > > > > Madhi Krishnan > > > > > > > > > > > > > > > > > > > > > On Thu, Sep 10, 2020 at 2:55 PM Pritam Kute < > > > > > > [hidden email] > > > > > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > Hello Madhi, > > > > > > > > > > > > > > > > Now based on the logs which you have shared, I suspect either > > > > > > > > orderPaymentPreferenceId passed to the custom service is > wrong > > or > > > > the > > > > > > > > orderPaymentPreference status is not PAYMENT_AUTHORISED. I > hope > > > you > > > > > > have > > > > > > > > done payment authorization while placing the order. If you > have > > > > done > > > > > a > > > > > > > > direct sale transaction, then this might not work. > > > > > > > > > > > > > > > > Kind Regards, > > > > > > > > -- > > > > > > > > Pritam Kute > > > > > > > > > > > > > > > > > > > > > > > > On Thu, Sep 10, 2020 at 2:10 PM Madhi Krishnan < > > > > > > > > [hidden email]> wrote: > > > > > > > > > > > > > > > > > Hey pritam .. > > > > > > > > > Thanks for your response ,I appreciate it. > > > > > > > > > > > > > > > > > > I checked the entities that you mentioned above and it > looks > > ok > > > > to > > > > > > me. > > > > > > > > > i'm getting a warning in the console saying no payment > > > preference > > > > > was > > > > > > > > > found.. > > > > > > > > > > > > > > > > > > Below are the logs that were generated. > > > > > > > > > |I| Running Service ECA Service: releaseOrderPayments, > > > triggered > > > > by > > > > > > > rule > > > > > > > > on > > > > > > > > > Service: changeOrderStatus > > > > > > > > > 2020-09-10 13:48:54,303 |jsse-nio-8443-exec-3 > > > > > |PaymentGatewayServices > > > > > > > > > |W| No OrderPaymentPreference records available for > release > > > > > > > > > 2020-09-10 13:48:54,304 |jsse-nio-8443-exec-3 > > > |ServiceDispatcher > > > > > > > > > |T| Sync service [order/releaseOrderPayments] finished in > > [2] > > > > > > > > > milliseconds > > > > > > > > > > > > > > > > > > other than that everything looks good in the logs.. > > > > > > > > > I tried to debug ..and i'm getting the warning from the > > > service > > > > > > called > > > > > > > > " > > > > > > > > > *releaseOrderPayments*" > > > > > > > > > Service Implementation Location > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ofbiz-framework/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java > > > > > > > > > At line 772. > > > > > > > > > > > > > > > > > > Thanks and regards > > > > > > > > > Madhi Krishnan > > > > > > > > > > > > > > > > > > On Thu, Sep 10, 2020 at 12:56 PM Pritam Kute < > > > > > > > > > [hidden email]> > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > Hello Madhi, > > > > > > > > > > > > > > > > > > > > Not sure but can you check if you have associated your > > custom > > > > > > method > > > > > > > > with > > > > > > > > > > the right ProductStorePaymentSetting? > > > > > > > > > > > > > > > > > > > > <ProductStorePaymentSetting > > > productStoreId="${productStoreId}" > > > > > > > > > > paymentMethodTypeId="CREDIT_CARD" > > > > > > > > > > paymentServiceTypeEnumId="PRDS_PAY_REFUND" > > > > > > > > paymentService="testCCRefund" > > > > > > > > > > paymentCustomMethodId="CC_REFUND_TEST"/> > > > > > > > > > > > > > > > > > > > > You can either put your payment gateway service name in > > > > > > > paymentService > > > > > > > > of > > > > > > > > > > the custom method ID in paymentCustomMethodId field. > > > > > > > > > > > > > > > > > > > > It will be good if you can post the error log here if > this > > is > > > > > not a > > > > > > > > case. > > > > > > > > > > > > > > > > > > > > Kind Regards, > > > > > > > > > > -- > > > > > > > > > > Pritam Kute > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Thu, Sep 10, 2020 at 4:42 AM Madhi Krishnan < > > > > > > > > > > [hidden email]> wrote: > > > > > > > > > > > > > > > > > > > > > Hii community, > > > > > > > > > > > Hope you all are doing well. > > > > > > > > > > > > > > > > > > > > > > I'm using an external Payment gateway in my ecommerce > > setup > > > > > ,and > > > > > > > I'm > > > > > > > > > able > > > > > > > > > > > to place orders using an external gateway.. > > > > > > > > > > > My question is, I'm struggling to call the refund api > if > > > the > > > > > user > > > > > > > > > cancels > > > > > > > > > > > an order line in an order. > > > > > > > > > > > I have configured the custom_method entity as well.. > > > > > > > > > > > let me know if I'm missing something.. > > > > > > > > > > > > > > > > > > > > > > Thanks & Regards > > > > > > > > > > > Madhi Krishnan > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
Free forum by Nabble | Edit this page |