Control Payment type options in store


#44

Reviving this thread. I’m having the same issue trying to get paypal_rest to work:

Question: Doesn’t this:

<include location="component://paypal/webapp/paypal/WEB-INF/controller.xml"/>

Have to be installed somewhere?

I noticed that on shop.scipioerp.com, the below link works, or at least responds and sends you back to the main menu:

https://shop.scipioerp.com/control/cancelPaymentPayPalRest

On my shop, it does nothing. I 100% believe that I followed the directions in this thread and the readmes, but it still does not work.

What does it take to get the paypal maps to work under “/control/xxx”?


#45

Ah, I see that it’s loaded at the shop controller via:

<include location="component://*/webapp/hooks/shop-controller-post.xml" optional="true" order="post-local"/>

Clever. I see that it being loaded:

[INFO]|2019-01-03 23:44:09,043 |main                 |ComponentContainer            |I| Loaded component : [paypal]
[INFO]|2019-01-03 23:44:16,134 |kJoinPool-1-worker-4 |ServiceEcaUtil                |I| Loaded [2] Service ECA Rules from file:/opt/scipio-erp/addons/paypal/servicedef/secas.xml
[INFO]|2019-01-03 23:44:17,585 |kJoinPool-1-worker-0 |ModelServiceReader            |I| Loaded [8] Services from file:/opt/scipio-erp/applications/accounting/servicedef/services_paypal.xml
[INFO]|2019-01-03 23:44:17,904 |kJoinPool-1-worker-0 |ModelServiceReader            |I| Loaded [3] Services from file:/opt/scipio-erp/addons/paypal/servicedef/services.xml
[INFO]|2019-01-03 23:44:18,021 |kJoinPool-1-worker-2 |ServiceEcaUtil                |I| Loaded [2] Service ECA Rules from file:/opt/scipio-erp/addons/paypal/servicedef/secas.xml
[INFO]|2019-01-03 23:44:20,776 |0.0.0.0-startStop-1  |ConfigXMLReader               |I| controller loaded: 0.001s, 0 requests, 0 views in file:/opt/scipio-erp/addons/paypal/webapp/hooks/shop-controller-post.xml
[INFO]|2019-01-03 23:44:20,810 |0.0.0.0-startStop-1  |ConfigXMLReader               |I| controller loaded: 0.002s, 8 requests, 0 views in file:/opt/scipio-erp/addons/paypal/webapp/paypal/WEB-INF/controller.xml
[INFO]|2019-01-03 23:44:26,262 |0.0.0.0-startStop-1  |ConfigXMLReader               |I| controller loaded: 0.0s, 1 requests, 0 views in file:/opt/scipio-erp/addons/paypal/webapp/hooks/backend-controller-post.xml

#46

Setup data:

root@kvm01:/opt/scipio-erp# cat paypal.data
select * from payment_gateway_config_type where payment_gateway_config_type_id = 'PAYPAL_REST';
 payment_gateway_config_type_id | parent_type_id | has_table |         description         |     last_updated_stamp     |   last_updated_tx_stamp    |       created_stamp        |      created_tx_stamp
--------------------------------+----------------+-----------+-----------------------------+----------------------------+----------------------------+----------------------------+----------------------------
 PAYPAL_REST                    |                | N         | PayPal REST Payment Gateway | 2018-12-31 01:46:08.097-08 | 2018-12-31 01:46:08.093-08 | 2018-12-31 01:46:08.097-08 | 2018-12-31 01:46:08.093-08

select * from payment_gateway_config where payment_gateway_config_id = 'PAYPAL_REST_CFG';
 payment_gateway_config_id | payment_gateway_config_type_id |    description     |     last_updated_stamp     |   last_updated_tx_stamp    |       created_stamp        |      created_tx_stamp
---------------------------+--------------------------------+--------------------+----------------------------+----------------------------+----------------------------+----------------------------
 PAYPAL_REST_CFG           | PAYPAL_REST                    | PayPal REST Config | 2018-12-31 01:46:08.101-08 | 2018-12-31 01:46:08.093-08 | 2018-12-31

select * from Payment_Gateway_Pay_Pal_Rest;
 payment_gateway_config_id |                                    client_id                                     |                                                              secret                                                              |   payment_return_url    |   payment_cancel_url    |   billing_agreement_return_url   |   billing_agreement_cancel_url   |     last_updated_stamp     |   last_updated_tx_stamp    |       created_stamp        |      created_tx_stamp
---------------------------+----------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+-------------------------+-------------------------+----------------------------------+----------------------------------+----------------------------+----------------------------+----------------------------+----------------------------
 PAYPAL_REST_CFG           | [secret] | [client_id] | returnPaymentPayPalRest | cancelPaymentPayPalRest | returnBillingAgreementPayPalRest | cancelBillingAgreementPayPalRest | 2018-12-31 01:46:25.955-08 | 2018-12-31 01:46:25.951-08 | 2018-12-31 01:46:25.955-08 | 2018-12-31 01:46:25.951-08
(1 row)

[STORE CONFIG]

select * from product_store_payment_setting where payment_gateway_config_id = 'PAYPAL_REST_CFG';
 product_store_id | payment_method_type_id | payment_service_type_enum_id | payment_service | payment_custom_method_id | payment_gateway_config_id | payment_properties_path | apply_to_all_products |     last_updated_stamp     |   last_updated_tx_stamp    |       created_stamp        |      created_tx_stamp
------------------+------------------------+------------------------------+-----------------+--------------------------+---------------------------+-------------------------+-----------------------+----------------------------+----------------------------+----------------------------+----------------------------
 Gallery          | EXT_PAYPAL             | PRDS_PAY_EXTERNAL            |                 |                          | PAYPAL_REST_CFG           |                         |                       | 2019-01-02 00:37:33.865-08 | 2019-01-02 00:37:33.847-08 | 2019-01-02 00:37:33.865-08 | 2019-01-02 00:37:33.847-08
(1 row)

[ACCT SEED DATA]
12010_accounting_GeneralChartOfAccounts.xml:    accountName="ACCOUNTS RECEIVABLE - PAYPAL" description=""/>
12030_accounting_GlSetupData.xml:    <PaymentMethodType paymentMethodTypeId="EXT_PAYPAL" defaultGlAccountId="122000"/>
12030_accounting_GlSetupData.xml:    <PaymentMethodTypeGlAccount organizationPartyId="Company" paymentMethodTypeId="EXT_PAYPAL" glAccountId="122500"/>

#47

@mz4wheeler Perhaps you can clarify the steps you’ve taken to install the component.

Did you follow this guide? https://www.scipioerp.com/community/end-user/addons/paypal/

What makes you think it isn’t setup correctly - does the PayPal payment show up at all in your store? I can see from the data you sent that the clientId and secret are missing from your gateway config. I hope that that is just for security reasons for us. You get these from Paypal.

Also, depending on whether you are in production or in a test environment, you may want to switch payment.paypal.mode=sandbox to live in addons/paypal/config/paypal.properties


#48

Yes, I followed the guide, but there is a bug in the git-addons script. It does not correctly identify whether “git subtree” is installed. Here is your code:

  if ! git --help --all | grep -q 'subtree'; then
    print_error_req "git subtree command does not appear installed - upgrade git?"
    return 2
  fi

This does not work with the latest version of git:

root@kvm01:/opt/scipio-erp# git --version
git version 2.20.1
root@kvm01:/opt/scipio-erp# git --help --all | grep subtree

That is the FIRST issue I had. Another way to check whether subtree is installed:

root@kvm01:/opt/scipio-erp# git subtree | grep "git subtree add"
usage: git subtree add   --prefix=<prefix> <commit>
   or: git subtree add   --prefix=<prefix> <repository> <ref>

So, I had to eventually comment out the “return 2” in the above code.

root@kvm01:/opt/scipio-erp# ./git-addons list --all | grep -i paypal
paypal -> addons/paypal [INSTALLED, subtree]

./ant clean
./ant build

Works… Even when it’s running, I see all the paypal libraries loaded.

root@kvm01:/opt/scipio-erp# lsof|grep addon | awk '{print $NF}' | sort -u
/opt/scipio-erp/addons/paypal/build/lib/paypal.jar
/opt/scipio-erp/addons/paypal/lib/rest-api-sdk-1.14.0.jar

During checkout, I select Paypal, just like in your example, does not call paypal. Here is what I get as I call “Submit Order”

Payment Information PayPal: $7.42
“Submit Order:”

Prior to submit, the logs show:

2019-01-04 10:31:25,168 |ajp-nio-8009-exec-7  |ServiceDispatcher             |T| Sync service [gallery-shop/calcTax] finished in [46] milliseconds
2019-01-04 10:31:25,169 |ajp-nio-8009-exec-7  |RequestHandler                |I| Ran Event [java:org.ofbiz.order.shoppingcart.CheckOutEvents#calcTax] from [request], result is [success]
2019-01-04 10:31:25,170 |ajp-nio-8009-exec-7  |RequestHandler                |I| [RequestHandler.doRequest]: Response is a chained request. sessionId=[hidden]
2019-01-04 10:31:25,170 |ajp-nio-8009-exec-7  |RequestHandler                |I| [RequestHandler]: Chain in place: requestUri=validatePaymentMethods overrideViewUri=null sessionId=[hidden]
2019-01-04 10:31:25,171 |ajp-nio-8009-exec-7  |ShoppingCart                  |I| Compare [Pm: null / PmType: EXT_PAYPAL / Amt: null / Ref: null!null] to [Pm: null / PmType: EXT_PAYPAL / Amt: null / Ref: null!null]
2019-01-04 10:31:25,171 |ajp-nio-8009-exec-7  |ShoppingCart                  |I| Returned existing PaymentInfo - Pm: null / PmType: EXT_PAYPAL / Amt: null / Ref: null!null
2019-01-04 10:31:25,172 |ajp-nio-8009-exec-7  |ShoppingCart                  |I| Compare [Pm: null / PmType: EXT_PAYPAL / Amt: null / Ref: null!null] to [Pm: null / PmType: EXT_PAYPAL / Amt: null / Ref: null!null]
2019-01-04 10:31:25,172 |ajp-nio-8009-exec-7  |ShoppingCart                  |I| Returned existing PaymentInfo - Pm: null / PmType: EXT_PAYPAL / Amt: null / Ref: null!null

After Submit order (complete):

2019-01-04 10:36:24,436 |ajp-nio-8009-exec-6  |ControlServlet                |T| [[[processorder(Domain:https://storefly.com)] Request Begun, encoding=[UTF-8]- total:0.0,since last(Begin):0.0]]
2019-01-04 10:36:24,437 |ajp-nio-8009-exec-6  |RequestHandler                |I| Ran Event [java:org.ofbiz.order.shoppingcart.CheckOutEvents#cartNotEmpty] from [request], result is [success]
2019-01-04 10:36:24,438 |ajp-nio-8009-exec-6  |RequestHandler                |I| [RequestHandler.doRequest]: Response is a chained request. sessionId=[hidden]
2019-01-04 10:36:24,438 |ajp-nio-8009-exec-6  |RequestHandler                |I| [RequestHandler]: Chain in place: requestUri=processordervalidatepayment overrideViewUri=null sessionId=[hidden]
2019-01-04 10:36:24,439 |ajp-nio-8009-exec-6  |ShoppingCart                  |I| Compare [Pm: null / PmType: EXT_PAYPAL / Amt: 7.415000000000000 / Ref: null!null] to [Pm: null / PmType: EXT_PAYPAL / Amt: null / Ref: null!null]
2019-01-04 10:36:24,439 |ajp-nio-8009-exec-6  |ShoppingCart                  |I| Returned existing PaymentInfo - Pm: null / PmType: EXT_PAYPAL / Amt: 7.415000000000000 / Ref: null!null
2019-01-04 10:36:24,439 |ajp-nio-8009-exec-6  |RequestHandler                |I| Ran Event [java:org.ofbiz.order.shoppingcart.CheckOutEvents#checkPaymentMethods] from [request], result is [success]
2019-01-04 10:36:24,440 |ajp-nio-8009-exec-6  |RequestHandler                |I| [RequestHandler.doRequest]: Response is a chained request. sessionId=[hidden]
2019-01-04 10:36:24,441 |ajp-nio-8009-exec-6  |RequestHandler                |I| [RequestHandler]: Chain in place: requestUri=processordercreate overrideViewUri=null sessionId=[hidden]
2019-01-04 10:36:24,452 |ajp-nio-8009-exec-6  |ShoppingCart                  |I| Creating OrderPaymentPreference - [GenericEntity:OrderPaymentPreference][orderPaymentPreferenceId,null()][orderId,null()][orderItemSeqId,null()][shipGroupSeqId,null()][productPricePurposeId,null()][paymentMethodTypeId,EXT_PAYPAL(java.lang.String)][paymentMethodId,null()][finAccountId,null()][securityCode,null()][track2,null()][presentFlag,N(java.lang.String)][swipedFlag,N(java.lang.String)][overflowFlag,Y(java.lang.String)][maxAmount,7.42(java.math.BigDecimal)][processAttempt,null()][billingPostalCode,null()][manualAuthCode,null()][manualRefNum,null()][statusId,PAYMENT_NOT_RECEIVED(java.lang.String)][needsNsfRetry,null()][createdDate,null()][createdByUserLogin,null()][lastModifiedDate,null()][lastModifiedByUserLogin,null()][lastUpdatedStamp,null()][lastUpdatedTxStamp,null()][createdStamp,null()][createdTxStamp,null()]
2019-01-04 10:36:24,519 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/countProductQuantityOrdered] finished in [7] milliseconds
2019-01-04 10:36:24,522 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/isStoreInventoryAvailableOrNotRequired] finished in [2] milliseconds
2019-01-04 10:36:24,581 |ajp-nio-8009-exec-6  |Log                           |I| [OrderServices.xml#getNextOrderId line 468] In getNextOrderId partyId is [Company], partyAcctgPreference: [GenericEntity:PartyAcctgPreference][partyId,Company(java.lang.String)][fiscalYearStartMonth,1(java.lang.Long)][fiscalYearStartDay,1(java.lang.Long)][taxFormId,US_IRS_1040(java.lang.String)][cogsMethodId,COGS_LIFO(java.lang.String)][baseCurrencyUomId,USD(java.lang.String)][invoiceSeqCustMethId,INV_HOOK_ENF_SEQ(java.lang.String)][invoiceIdPrefix,INV(java.lang.String)][lastInvoiceNumber,null()][lastInvoiceRestartDate,null()][useInvoiceIdForReturns,null()][quoteSeqCustMethId,null()][quoteIdPrefix,QUO(java.lang.String)][lastQuoteNumber,null()][orderSeqCustMethId,null()][orderIdPrefix,ORD(java.lang.String)][lastOrderNumber,null()][refundPaymentMethodId,null()][errorGlJournalId,ERROR_JOURNAL(java.lang.String)][oldInvoiceSequenceEnumId,null()][oldOrderSequenceEnumId,null()][oldQuoteSequenceEnumId,null()][lastUpdatedStamp,2018-12-31 01:46:10.566(java.sql.Timestamp)][lastUpdatedTxStamp,2018-12-31 01:46:10.555(java.sql.Timestamp)][createdStamp,2018-12-31 01:46:10.566(java.sql.Timestamp)][createdTxStamp,2018-12-31 01:46:10.555(java.sql.Timestamp)]
2019-01-04 10:36:24,591 |ajp-nio-8009-exec-6  |SequenceUtil                  |I| Got bank of sequenced IDs for [OrderHeader]; curSeqId=10270, maxSeqId=10280, bankSize=10
2019-01-04 10:36:24,600 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/getNextOrderId] finished in [76] milliseconds
2019-01-04 10:36:24,621 |ajp-nio-8009-exec-6  |EntityEcaRule                 |I| Running Entity ECA Service: createSystemInfoNote, triggered by rule on Entity: OrderHeader
2019-01-04 10:36:24,627 |ajp-nio-8009-exec-6  |SequenceUtil                  |I| Got bank of sequenced IDs for [NoteData]; curSeqId=10330, maxSeqId=10340, bankSize=10
2019-01-04 10:36:24,632 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| Running Service ECA Service: convertSystemMessageFromNoteData, triggered by rule on Service: createSystemInfoNote
2019-01-04 10:36:24,638 |ajp-nio-8009-exec-6  |SequenceUtil                  |I| Got bank of sequenced IDs for [SystemMessages]; curSeqId=10330, maxSeqId=10340, bankSize=10
2019-01-04 10:36:24,643 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [entity-default/convertSystemMessageFromNoteData] finished in [10] milliseconds
2019-01-04 10:36:24,643 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [entity-default/createSystemInfoNote] finished in [21] milliseconds
2019-01-04 10:36:24,648 |ajp-nio-8009-exec-6  |SequenceUtil                  |I| Got bank of sequenced IDs for [OrderStatus]; curSeqId=10360, maxSeqId=10370, bankSize=10
2019-01-04 10:36:24,653 |ajp-nio-8009-exec-6  |SequenceUtil                  |I| Got bank of sequenced IDs for [OrderAdjustment]; curSeqId=10290, maxSeqId=10300, bankSize=10
2019-01-04 10:36:24,664 |ajp-nio-8009-exec-6  |SequenceUtil                  |I| Got bank of sequenced IDs for [OrderPaymentPreference]; curSeqId=10260, maxSeqId=10270, bankSize=10
2019-01-04 10:36:24,682 |ajp-nio-8009-exec-6  |SequenceUtil                  |I| Got bank of sequenced IDs for [EntityAuditLog]; curSeqId=10520, maxSeqId=10530, bankSize=10
2019-01-04 10:36:24,812 |ajp-nio-8009-exec-6  |EntityEcaRule                 |I| Running Entity ECA Service: changeOrderPaymentStatus, triggered by rule on Entity: OrderPaymentPreference
2019-01-04 10:36:24,821 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [entity-default/changeOrderPaymentStatus] finished in [9] milliseconds
2019-01-04 10:36:24,826 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| For Service ECA [storeOrder] on [commit] got false for condition: [originOrderId][is-not-empty][true][String]
2019-01-04 10:36:24,826 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| Running Service ECA Service: updateShoppingListQuantitiesFromOrder, triggered by rule on Service: storeOrder
2019-01-04 10:36:24,837 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/updateShoppingListQuantitiesFromOrder] finished in [11] milliseconds
2019-01-04 10:36:24,838 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| Running Service ECA Service: checkOrderItemForProductGroupOrder, triggered by rule on Service: storeOrder
2019-01-04 10:36:24,848 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/checkOrderItemForProductGroupOrder] finished in [10] milliseconds
2019-01-04 10:36:24,848 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| Running Service ECA Service: resetGrandTotal, triggered by rule on Service: storeOrder
2019-01-04 10:36:24,871 |ajp-nio-8009-exec-6  |EntityEcaRule                 |I| Running Entity ECA Service: createSystemInfoNote, triggered by rule on Entity: OrderHeader
2019-01-04 10:36:24,875 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| Running Service ECA Service: convertSystemMessageFromNoteData, triggered by rule on Service: createSystemInfoNote
2019-01-04 10:36:24,880 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [entity-default/convertSystemMessageFromNoteData] finished in [3] milliseconds
2019-01-04 10:36:24,880 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [entity-default/createSystemInfoNote] finished in [8] milliseconds
2019-01-04 10:36:24,880 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/resetGrandTotal] finished in [32] milliseconds
2019-01-04 10:36:24,880 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| Running Service ECA Service: addSuggestionsToShoppingList, triggered by rule on Service: storeOrder
2019-01-04 10:36:24,880 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| [[ASync service started...- total:0.0,since last(Begin):0.0]] - 'gallery-shop / addSuggestionsToShoppingList'
2019-01-04 10:36:24,885 |ajp-nio-8009-exec-6  |SequenceUtil                  |I| Got bank of sequenced IDs for [RuntimeData]; curSeqId=12600, maxSeqId=12700, bankSize=100
2019-01-04 10:36:24,916 |ajp-nio-8009-exec-6  |GenericAsyncEngine            |I| Persisted job queued : 1546626984911
2019-01-04 10:36:24,917 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| [[ASync service finished...- total:0.037,since last(ASync service sta...):0.037]] - 'gallery-shop / addSuggestionsToShoppingList'
2019-01-04 10:36:24,917 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| Running Service ECA Service: checkCreateDropShipPurchaseOrders, triggered by rule on Service: storeOrder
2019-01-04 10:36:24,934 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/calculatePurchasePrice] finished in [3] milliseconds
2019-01-04 10:36:24,936 |ajp-nio-8009-exec-6  |UtilProperties                |I| OrderNoAgreementFoundWithIdNotDoingPromotions misses in OrderErrorUiLabels for locale en
2019-01-04 10:36:24,936 |ajp-nio-8009-exec-6  |ProductPromoWorker            |W| OrderNoAgreementFoundWithIdNotDoingPromotions
2019-01-04 10:36:24,941 |ajp-nio-8009-exec-6  |ShoppingCartItem              |I| Setting orderItemSeqId - 00001
2019-01-04 10:36:24,959 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/countProductQuantityOrdered] finished in [6] milliseconds
2019-01-04 10:36:24,963 |ajp-nio-8009-exec-6  |Log                           |I| [OrderServices.xml#getNextOrderId line 468] In getNextOrderId partyId is [Gallery], partyAcctgPreference:
2019-01-04 10:36:24,963 |ajp-nio-8009-exec-6  |Log                           |W| [OrderServices.xml#getNextOrderId line 473] Acctg preference not defined for partyId [Gallery]
2019-01-04 10:36:24,968 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/getNextOrderId] finished in [7] milliseconds
2019-01-04 10:36:24,974 |ajp-nio-8009-exec-6  |EntityEcaRule                 |I| Running Entity ECA Service: createSystemInfoNote, triggered by rule on Entity: OrderHeader
2019-01-04 10:36:24,979 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| Running Service ECA Service: convertSystemMessageFromNoteData, triggered by rule on Service: createSystemInfoNote
2019-01-04 10:36:24,983 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [entity-default/convertSystemMessageFromNoteData] finished in [4] milliseconds
2019-01-04 10:36:24,984 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [entity-default/createSystemInfoNote] finished in [8] milliseconds
2019-01-04 10:36:24,988 |ajp-nio-8009-exec-6  |SequenceUtil                  |I| Got bank of sequenced IDs for [OrderItemPriceInfo]; curSeqId=10260, maxSeqId=10270, bankSize=10
2019-01-04 10:36:25,073 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| For Service ECA [storeOrder] on [commit] got false for condition: [originOrderId][is-not-empty][true][String]
2019-01-04 10:36:25,073 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| Running Service ECA Service: updateShoppingListQuantitiesFromOrder, triggered by rule on Service: storeOrder
2019-01-04 10:36:25,078 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/updateShoppingListQuantitiesFromOrder] finished in [4] milliseconds
2019-01-04 10:36:25,078 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| For Service ECA [storeOrder] on [commit] got false for condition: [orderTypeId][equals][SALES_ORDER][true][String]
2019-01-04 10:36:25,078 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| Running Service ECA Service: resetGrandTotal, triggered by rule on Service: storeOrder
2019-01-04 10:36:25,095 |ajp-nio-8009-exec-6  |EntityEcaRule                 |I| Running Entity ECA Service: createSystemInfoNote, triggered by rule on Entity: OrderHeader
2019-01-04 10:36:25,100 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| Running Service ECA Service: convertSystemMessageFromNoteData, triggered by rule on Service: createSystemInfoNote
2019-01-04 10:36:25,112 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [entity-default/convertSystemMessageFromNoteData] finished in [12] milliseconds
2019-01-04 10:36:25,113 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [entity-default/createSystemInfoNote] finished in [17] milliseconds
2019-01-04 10:36:25,113 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/resetGrandTotal] finished in [35] milliseconds
2019-01-04 10:36:25,113 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| Running Service ECA Service: addSuggestionsToShoppingList, triggered by rule on Service: storeOrder
2019-01-04 10:36:25,113 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| [[ASync service started...- total:0.0,since last(Begin):0.0]] - 'gallery-shop / addSuggestionsToShoppingList'
2019-01-04 10:36:25,144 |ajp-nio-8009-exec-6  |GenericAsyncEngine            |I| Persisted job queued : 1546626985141
2019-01-04 10:36:25,145 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| [[ASync service finished...- total:0.032,since last(ASync service sta...):0.032]] - 'gallery-shop / addSuggestionsToShoppingList'
2019-01-04 10:36:25,145 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| For Service ECA [storeOrder] on [return] got false for condition: [orderTypeId][equals][SALES_ORDER][true][String]
2019-01-04 10:36:25,145 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| Running Service ECA Service: balanceOrderItemsWithNegativeReservations, triggered by rule on Service: storeOrder
2019-01-04 10:36:25,162 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/balanceOrderItemsWithNegativeReservations] finished in [17] milliseconds
2019-01-04 10:36:25,162 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| Running Service ECA Service: setUnitPriceAsLastPrice, triggered by rule on Service: storeOrder
2019-01-04 10:36:25,167 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/setUnitPriceAsLastPrice] finished in [4] milliseconds
2019-01-04 10:36:25,167 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| Running Service ECA Service: setOrderReservationPriority, triggered by rule on Service: storeOrder
2019-01-04 10:36:25,178 |ajp-nio-8009-exec-6  |EntityEcaRule                 |I| Running Entity ECA Service: createSystemInfoNote, triggered by rule on Entity: OrderHeader
2019-01-04 10:36:25,183 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| Running Service ECA Service: convertSystemMessageFromNoteData, triggered by rule on Service: createSystemInfoNote
2019-01-04 10:36:25,187 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [entity-default/convertSystemMessageFromNoteData] finished in [4] milliseconds
2019-01-04 10:36:25,188 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [entity-default/createSystemInfoNote] finished in [8] milliseconds
2019-01-04 10:36:25,188 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/setOrderReservationPriority] finished in [21] milliseconds
2019-01-04 10:36:25,188 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/storeOrder] finished in [244] milliseconds
2019-01-04 10:36:25,207 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/checkCreateDropShipPurchaseOrders] finished in [288] milliseconds
2019-01-04 10:36:25,207 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| Running Service ECA Service: balanceOrderItemsWithNegativeReservations, triggered by rule on Service: storeOrder
2019-01-04 10:36:25,220 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/balanceOrderItemsWithNegativeReservations] finished in [13] milliseconds
2019-01-04 10:36:25,220 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| For Service ECA [storeOrder] on [return] got false for condition: [orderTypeId][equals][PURCHASE_ORDER][true][String]
2019-01-04 10:36:25,220 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| Running Service ECA Service: setOrderReservationPriority, triggered by rule on Service: storeOrder
2019-01-04 10:36:25,231 |ajp-nio-8009-exec-6  |EntityEcaRule                 |I| Running Entity ECA Service: createSystemInfoNote, triggered by rule on Entity: OrderHeader
2019-01-04 10:36:25,235 |ajp-nio-8009-exec-6  |ServiceEcaRule                |I| Running Service ECA Service: convertSystemMessageFromNoteData, triggered by rule on Service: createSystemInfoNote
2019-01-04 10:36:25,239 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [entity-default/convertSystemMessageFromNoteData] finished in [4] milliseconds
2019-01-04 10:36:25,239 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [entity-default/createSystemInfoNote] finished in [8] milliseconds
2019-01-04 10:36:25,240 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/setOrderReservationPriority] finished in [19] milliseconds
2019-01-04 10:36:25,240 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/storeOrder] finished in [784] milliseconds
2019-01-04 10:36:25,260 |ajp-nio-8009-exec-6  |RequestHandler                |I| Ran Event [java:org.ofbiz.order.shoppingcart.CheckOutEvents#createOrder] from [request], result is [sales_order]
2019-01-04 10:36:25,261 |ajp-nio-8009-exec-6  |RequestHandler                |I| [RequestHandler.doRequest]: Response is a chained request. sessionId=[hidden]
2019-01-04 10:36:25,261 |ajp-nio-8009-exec-6  |RequestHandler                |I| [RequestHandler]: Chain in place: requestUri=checkBlacklist overrideViewUri=null sessionId=[hidden]
2019-01-04 10:36:25,288 |ajp-nio-8009-exec-6  |RequestHandler                |I| Ran Event [java:org.ofbiz.order.shoppingcart.CheckOutEvents#checkOrderBlacklist] from [request], result is [success]
2019-01-04 10:36:25,290 |ajp-nio-8009-exec-6  |RequestHandler                |I| [RequestHandler.doRequest]: Response is a chained request. sessionId=[hidden]
2019-01-04 10:36:25,290 |ajp-nio-8009-exec-6  |RequestHandler                |I| [RequestHandler]: Chain in place: requestUri=processpayment overrideViewUri=null sessionId=[hidden]
2019-01-04 10:36:25,296 |ajp-nio-8009-exec-6  |RequestHandler                |I| Ran Event [java:org.ofbiz.order.shoppingcart.CheckOutEvents#processPayment] from [request], result is [success]
2019-01-04 10:36:25,297 |ajp-nio-8009-exec-6  |RequestHandler                |I| [RequestHandler.doRequest]: Response is a chained request. sessionId=[hidden]
2019-01-04 10:36:25,298 |ajp-nio-8009-exec-6  |RequestHandler                |I| [RequestHandler]: Chain in place: requestUri=clearcartfororder overrideViewUri=null sessionId=[hidden]
2019-01-04 10:36:25,298 |ajp-nio-8009-exec-6  |CartEventListener             |I| Saving abandoned cart
2019-01-04 10:36:25,303 |ajp-nio-8009-exec-6  |ControlEventListener          |I| Destroying session: sessionId=[hidden]
2019-01-04 10:36:25,305 |ajp-nio-8009-exec-6  |ControlEventListener          |I| Creating session: sessionId=[hidden]
2019-01-04 10:36:25,306 |ajp-nio-8009-exec-6  |ShoppingCartEvents            |I| Scipio: Doing clearCart for anonymous user, but leaving anonymous user login in session (partyId: '10030'
2019-01-04 10:36:25,307 |ajp-nio-8009-exec-6  |RequestHandler                |I| Ran Event [java:org.ofbiz.order.shoppingcart.ShoppingCartEvents#clearEnsureCart] from [request], result is [success]
2019-01-04 10:36:25,308 |ajp-nio-8009-exec-6  |RequestHandler                |I| [RequestHandler.doRequest]: Response is a chained request. sessionId=[hidden]
2019-01-04 10:36:25,309 |ajp-nio-8009-exec-6  |RequestHandler                |I| [RequestHandler]: Chain in place: requestUri=checkExternalPayment overrideViewUri=null sessionId=[hidden]
2019-01-04 10:36:25,314 |ajp-nio-8009-exec-6  |RequestHandler                |I| Ran Event [java:org.ofbiz.order.shoppingcart.CheckOutEvents#checkExternalPayment] from [request], result is [paypal]
2019-01-04 10:36:25,315 |ajp-nio-8009-exec-6  |RequestHandler                |I| [RequestHandler.doRequest]: Response is a chained request. sessionId=[hidden]
2019-01-04 10:36:25,316 |ajp-nio-8009-exec-6  |RequestHandler                |I| [RequestHandler]: Chain in place: requestUri=paymentPayPalRest overrideViewUri=null sessionId=[hidden]
2019-01-04 10:36:25,317 |ajp-nio-8009-exec-6  |RequestHandler                |I| Rendering View [login]. sessionId=[hidden]
2019-01-04 10:36:25,322 |ajp-nio-8009-exec-6  |CmsScreenViewHandler          |I| Cms: No existing or active CMS page mapping found for view 'login'; continuing with Ofbiz screen (component://shop/widget/CommonScreens.xml#login); sessionId=[hidden]
2019-01-04 10:36:25,324 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/getUserPreferenceGroup] finished in [2] milliseconds
2019-01-04 10:36:25,328 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/getVisualThemeResources] finished in [3] milliseconds
2019-01-04 10:36:25,330 |ajp-nio-8009-exec-6  |ScreenRenderer                |I| loading properties: file:/opt/scipio-erp/framework/widget/config/widgetContextScripts.properties
2019-01-04 10:36:25,331 |ajp-nio-8009-exec-6  |PrepareNewScreenRender        |I| Scipio: Preparing new templating API render; clearing request-scope templating vars
2019-01-04 10:36:25,887 |ajp-nio-8009-exec-6  |ServiceDispatcher             |T| Sync service [gallery-shop/getSystemMessages] finished in [6] milliseconds
2019-01-04 10:36:26,029 |ajp-nio-8009-exec-6  |SideDeepCategory              |I| Current category: [currentTrail:null, curCategoryId:, currentCategoryPath:null]
2019-01-04 10:36:26,144 |ajp-nio-8009-exec-6  |VisitHandler                  |I| Found visitorId [12201] in cookie
2019-01-04 10:36:26,160 |ajp-nio-8009-exec-6  |ServerHitBin                  |I| Visit delegatorName=default, ServerHitBin delegatorName=default
2019-01-04 10:36:26,165 |ajp-nio-8009-exec-6  |ControlServlet                |T| [[[processorder(Domain:https://storefly.com)] Request Done- total:1.729,since last([processorder(Dom...):1.729]]

#49

Thanks for the heads up about Git, Mike. I can’t imagine why they decided to remove “subtree” from the “git --help --all” list. So far I can’t find a release note or commit reason for the removal…


#50

@mz4wheeler Please note I commented out the subtree command check in master+1.14 branches git-addons because it’s not essential anyway (it was only there to help detect very old git versions). Next time you pull you’ll get a conflict in that file since you edited it at the same place. Thanks!


#51

And in case you hadn’t, don’t forget to update the actual addon:

./git-addons pull paypal
./ant clean build

Afraid I can’t comment on the rest at this moment.


#52

I loaded demo and it seems to work… So, I have some studying to do [grin].


#53

OK: I figured it out, and it turns out to be a bug. There was nothing wrong with my setup, but it wasn’t calling paypal, and (hidden) it was unable to create a user account, which was not logged for some reason.

The root cause was ofbiz was (attempting) to create an illegal cookie when “saving” the user data (prior to sending to paypal), but ONLY IF the app mount point had multiple slashes.

For instance, if the shop mount point was “/shop”, no problem. It would create a cookie that looks like:

cookie: shop.autoUserLoginId

If the shop mount point was “/en/shop” (reasonable), it would create a cookie that looks like:

cookie: en/shop.autoUserLoginId

Which is illegal!.. The “/” is bad.

Try it! Set the mount point to “/en/shop”, and TRY to register a new user account. In MY case, I have multiple mount points for multiple languages and that is what was causing the hidden issue.

Here is the simple fix:

framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java

    protected static String getAutoLoginCookieName(HttpServletRequest request) {
        /**
        * Does not work when the mount point has multiple slashes:  example: /en/shop vs /shop
        * return UtilHttp.getApplicationName(request) + ".autoUserLoginId";
        */
        return UtilHttp.getApplicationName(request).replaceAll("/","_") + ".autoUserLoginId";
    }

Please make the above change to the master branch.


#54

That does indeed look like a bug! Thanks for fixing!

If you want, you can create a pull request on github - and we will try to apply it from there. That way your name will show up in the history.

Otherwise I will apply it first thing tomorrow. Thanks alot for the contribution!


#55

Thanks! I really appreciate that you guys are receptive to fixing little bugs.


#56

Oh, we really appreciate it. So thank you!


#57

Thanks Mike,

I’ll rather do it in UtilHttp::getApplicationName in OFBiz:

-        return appName;
+        return appName.replaceAll("/","_");

#58

Thanks Jacques. I didn’t know you hung out here [grin]. I thought about this approach, but I wasn’t sure if it would cause issues for other apps, so I decided to just fix the faulty cookie. BTW, I tested this fix and it does work. Thanks!


#59

@mz4wheeler thanks again - I committed your fix a moment ago (and also updated the function right below that one with the same replace statement. I gave you credit in the commit message, the fix will be pushed to github in the coming days.

@JacquesLeRoux: welcome to the community.


#60

You were right to do so Paul, I made a mistake trying to generalise changing UtilHttp::getApplicationName. This method is used in other places where the name should not be changed. Only cookies are concerned.
FYI: @mz4wheeler


#61

Mike, Jacques (hello!)

The name patch is in github, note in fact both have been applied. Having a slash in the “application name” can only lead to problems in new uses, and I couldn’t see any existing places it would cause a compatibility issue (if there are, can you give example? thank).


#62

Hi Pascal,
Thanks for your careful review.

I found at least an issue in webpos while working on https://issues.apache.org/jira/browse/OFBIZ-10767. Sometimes the F# buttons where not showing. I’m not even sure it was due to that but I preferred to not change UtilHttp::getApplicationName because it’s used in many places and I was unsure this name change could not introduce regression issues. Better be safe than sorry, as I like to say :wink:


#63

Hi Paul,

I thought about it and checked the cases where UtilHttp::getApplicationName is used. You are right there is no current issue with changing the name inside UtilHttp::getApplicationName.

I was misleaded, the problem I crossed with F# buttons in webpos was due to changing the webpos mountpoint to test/webpos. Anyway I’ll not get back in OFBiz now, even if I think a future possible issue with the name inside UtilHttp::getApplicationName is not probable.

@mz4wheeler, so beware using a slash in a mountpoint can have side effects beside needing to change the cookies names, at least in webpos.