We've applied this as a patch and tested, it work great. We're deploying it to a production site tomorrow. Not sure if you want to call that "Reviewed and tested by the community or not".
Thanks!
@mmaranao - I've set up an issue fork for this patch. I've not testing it out yet though.
I'm unsure of this line as we have an configurable order number strategy in place. Maybe you can shed some light on the change?
'remote_id' => $payment_receipt['transaction_no'] . '|' . $payment_receipt['order_no'] . '|' . $payment_receipt['reference_no'],
Thanks!
redsky โ made their first commit to this issueโs fork.
Sorry for flip flopping here - just getting the hang of these statuses :P
This was changed as part of the D11 automated MR in #3428453 ๐ Automated Drupal 11 compatibility fixes for commerce_moneris_checkout Needs review . Marking Status as Fixed.
I merged in this change for D11 but kept D9 compatibility. Marking status as Fixed.
redsky โ made their first commit to this issueโs fork.
I merged in this branch. Thank you @mmaranao and @abhishek_gupta1!
Marking fixed.
redsky โ created an issue.
Thought I'd mention issue #3382018 โจ Add a field to the schema for transitions to support #button_type Active . It's a different need but it might be good to know there's another idea related to adding an optional field.
Also I wanted to add my support for the great idea being discussed here!
I've been following issue #3282355 โจ Add a 'description' field to the schema for states and transitions RTBC as I think the two might have similar needs in terms of where to store the extra information about a transition. Thought I'd share in case someone is considering this problem.
Thanks @lazzyvn. Our use case is we have a client with a large site with power users who build their own webforms and there are about 100 of them. It's working well but they've asked us to improve the address input. Address and Address Suggestion seems like they will be a big part of our solution however we can't get away from the Webform requirement.
I'll have to think about how to go about it. It might be this file in Webform that needs the change?
https://git.drupalcode.org/project/webform/-/blob/03b6e07416480ad802f453...
@lazzyvn, Thanks for this great module - I love it!
I noticed in an unrelated issue you mentioned "I don't think I have time to support web forms because web forms are not real entity fields.".
I wonder if you have any thoughts on how you would go about this though. It's perhaps something we could submit a patch for or write a secondary module for. It might also be a conversation I should have in the Webform project but I thought I'd start here with you.
redsky โ created an issue.
I created a feature request in State Machine โจ Add a field to the schema for transitions to support #button_type Active that I think could support this feature request. I got looking at the Drupal User Interface Standards โ and it seemed to be me in addition to the "primary" button type we should also consider the "dangerous" button type.
redsky โ created an issue.
I like the idea of a property of the transition something like this?
transitions:
place:
label: 'Place order'
from: [draft]
to: completed
primary: true
I have no idea if it's possible, I looked quickly through the State Machine module and didn't see anything. I did see requests to add properties like a description, so this would be a similar effort. I'll look deeper over there and if I don't find anything maybe I could raise an issue asking if it's possible or make a feature request.
This seems like a good idea to me but I'm wondering what might trigger a button to be the primary button. The transitions are determined from the *.workflows.yml file and you can create custom workflows that might not be "Fulfill order" or "Place order" ( See State Machine module โ ).
If you could specify that a transition was the default some how you could trigger the primary button styling based on that. I only see "label", "from" and "to" in the State Machine examples I've seen though.
transitions:
place:
label: 'Place order'
from: [draft]
to: completed
Creating release 1.0.1, closing.
I can confirm this MR worked. I accepted the Merge Request.
This is working in my initial tests - just waiting to here back from our client.
Great thanks @vmarchuk, I'm going to test it now.
Thanks for this MR!
I tested this out and it did stop the need to press submit twice after having a declined transaction but only for the "Moneris Checkout order number strategy" named "Use the order ID with timestamp appended". (See https://www.drupal.org/project/commerce_moneris_checkout/issues/3367095 ๐ Should the order_no field be the Commerce Order No? Fixed )
For the "Moneris Checkout order number strategy" named "Generate the order number early and use it instead of the ID" it fails. Without this MR, each submissions generates a new order_no which is consistent with the help text message "Note: generating order numbers will likely result in out of order or missing order numbers based on if / when the orders are placed." Those wasted numbers were missing from Drupal but they did show up as declined transactions in Moneris.
We'd love it if the double pressing submit bug could be solved and still generate new order_no's with each Moneris call.
Thanks,
Chris
Sounds good @vmarchuk, I'm testing this now.
Thanks!
Interestingly we just did a live test on a different Moneris account and a real credit card with a declined transaction and it did not show this double submit behavior. I didn't see the test first hand though, I can try to set the test up again if that helps.
redsky โ created an issue.
Thank you! I've tested this and can confirm the number I was expecting comes through and visible on the payment tab of an order.
Thanks for putting your heads together and coming up with this solution! I've tested the "Generate the order number early and use it instead of the ID." strategy and it works great!
I like that solution @rszrama! +1
I like your idea of not adding time to the order number in Prod.
However that does not solve the issue that the number is prominently displayed to the user in an email receipt and order_no is the number meaningful to the user where as order_id is a surrogate key not known to them. I'd
If you think we should make that user configurable I'm happy to open a new ticket. I just wanted to make sure you've seen the screenshot of the email, and how this number is intended by Moneris to be useful to the user:
@marchukvitaliy,
I see what you mean about it looking weird. If we generated the number early and the payment failed you might be โwastingโ the order number.
I feel like it might be the lesser of 2 evils to have the order_no be the most useful.
Do you think we should make this configurable? A checkbox, something like โGenerate Order No early to include in Transactionโ.
Let me know what you think.
Thanks,
Chris
"order_id-current_time" is more readable but it's not meaningful to the customer or the merchant in our case.
Could we use the pattern "order_no-current_time"?
This change would account for people who are using Number patterns (like us).
redsky โ created an issue.
I guess it might be more helpful if I explain my full use case and share some logs. I'm calling a API that requires getting an auth token with a first call and using a session cookie. So perhaps my question is simple, how do I accept a cookie in and have it persist for the second call where the actual work happens? I was trying to read the cookie from the first response header and set it in the second request header - this works in straight guzzle but as noted above, I'm not able to (or don't know how) access all the cookies using a response model.
Here's my anonymized debug log.
* Trying x.x.x.x:44300...
* Connected to my-example.com (x.x.x.x) port 44300 (#0)
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
* CApath: /etc/ssl/certs
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
* subject: CN=my-example.com
* start date: Mar 12 00:00:00 2023 GMT
* expire date: Feb 9 23:59:59 2024 GMT
* subjectAltName: host "my-example.com" matched cert's "my-example.com"
* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=RapidSSL TLS RSA CA G1
* SSL certificate verify ok.
> GET /my/example/path HTTP/1.1
Host: my-example.com:44300
User-Agent: GuzzleHttp/6.5.5 curl/7.74.0 PHP/8.1.8
Authorization: Basic YXBpdGVzdDpkYXJ0bW91dGg5OQ==
Accept: application/json
Content-Type: application/json
X-CSRF-Token: Fetch
Cache-control: no-cache
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< set-cookie: sap-usercontext=sap-client=200; path=/
< set-cookie: SAP_SESSIONID_G4D_200=WgR_NXWhmU2bmm0wXZ-esUUUzKMNAxHumh8A2GHKkLs%3d; path=/; HttpOnly
< content-type: application/json; charset=utf-8
< content-length: 20
< x-csrf-token: 3y9jdVCjxiApSCodboEwkA==
< sap-metadata-last-modified: Tue, 13 Jun 2023 19:04:37 GMT
< cache-control: no-store, no-cache
< dataserviceversion: 2.0
< sap-processing-info: ODataBEP=,crp=,RAL=,st=X,MedCacheHub=SHM,MedCacheBEP=SHM,codeployed=X,softstate=
< sap-server: true
< sap-perf-fesrec: 51745.000000
<
* Connection #0 to host my-example.com left intact
* Found bundle for host my-example.com: 0xaaaaf5c6d800 [serially]
* Re-using existing connection! (#0) with host my-example.com
* Connected to my-example.com (203.51.48.177) port 44300 (#0)
> POST /my/example/path HTTP/1.1
Host: my-example.com:44300
User-Agent: GuzzleHttp/6.5.5 curl/7.74.0 PHP/8.1.8
Authorization: Basic YXBpdGVzdDpkYXJ0bW91dGg5OQ==
Accept: application/json
Content-Type: application/json
x-csrf-token: 3y9jdVCjxiApSCodboEwkA==
Content-Length: 270
* upload completely sent off: 270 out of 270 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 403 Forbidden
< set-cookie: sap-usercontext=sap-client=200; path=/
< set-cookie: SAP_SESSIONID_G4D_200=O1IV5M1EjXOrhi-eVMpE-XbBCtcNAxHumk0A2GHKkLs%3d; path=/; HttpOnly
< content-type: text/plain; charset=utf-8
< content-length: 28
< x-csrf-token: Required
< sap-processing-info: ODataBEP=,crp=,RAL=,st=,MedCacheHub=,codeployed=X,softstate=
< sap-server: true
< sap-perf-fesrec: 33316.000000
<
* Connection #0 to host my-example.com left intact
Full disclosure I cut back the model to the relevant parts that show how I've been trying to access the cookies.
redsky โ created an issue.
Here's a screenshot of an email produced by Moneris.
It just seems to me the Order ID is pretty prominently displayed and a long number like 91-7dc5125d-f510-4258-bd0e-b6694d09d23b-1686219548 isn't very user friendly.
The reference number is Moneris's unique transaction number - i.e. 660160580010200010
Have a look here: https://developer.moneris.com:3000/livedemo/checkout/preload_req/guide/d...
The order_no falls under the optional fields section, I wonder if that is an indication that it's less important than we think.
redsky โ created an issue.
I'm having a similar issue but perhaps my use case is a bit different - simpler even.
When I have a parameter type: "array" it produced this error.
Error: Call to a member function getType() on null in Drupal\http_client_manager\Form\HttpServiceApiPreviewForm->getParameterType() (line 260 of modules/contrib/http_client_manager/src/Form/HttpServiceApiPreviewForm.php).
I applied patch #2 against 9.3 and I get the same error.
I'm happy to create a new issue if this is unrelated.
Thanks!
redsky โ made their first commit to this issueโs fork.