I added a product to cart and went to the checkout page. I have not created a payment gateway and therefore I get drupal message -

No payment gateways are defined, create one first.

I think it will be nice if we get the link to create a payment gateway also in the link.

Thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sorabh.v6 created an issue. See original summary.

sorabh.v6’s picture

Status: Active » Needs review
FileSize
1.1 KB

Patch is uploaded with the code to print the link of the add payment gateway in the drupal message. Please review.

Thanks

heddn’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

vdenis’s picture

I've tested the patch and it looks good for me too.

bojanz’s picture

Status: Reviewed & tested by the community » Needs work

#2917372: incorrect use of translation in CartEventSubscriber tells us that this is the wrong way to do a link inside t(). Let's follow its suggestion.

sorabh.v6’s picture

Assigned: Unassigned » sorabh.v6
sorabh.v6’s picture

Assigned: sorabh.v6 » Unassigned
Status: Needs work » Needs review
FileSize
2.41 KB
2.64 KB

Hi,

Code updated, please review the updated patch.

Thanks

sorabh.v6’s picture

FileSize
1.11 KB
1.09 KB

Wrong patch file update in the previous comment. This comment has the correct patchfile.

Thanks

The last submitted patch, 7: 2927114-6.patch, failed testing. View results

heddn’s picture

Status: Needs review » Reviewed & tested by the community

Good feedback in #5. This looks good to go now.

bojanz’s picture

Status: Reviewed & tested by the community » Needs work

Core uses : instead of @ for urls.

sorabh.v6’s picture

Status: Needs work » Needs review
FileSize
773 bytes
1.09 KB

Changes made as suggested in #11. Please review the updated patch.

Status: Needs review » Needs work

The last submitted patch, 12: 2927114-12.patch, failed testing. View results

drugan’s picture

May be test is failed because you should do this instead of the latest changes:

return $this->t('No payment gateways are defined, <a href=":url">create</a> one first.', [':url' => $add_payment_gateway_link]);return $this->t('No payment gateways are defined, <a href=:url>create</a> one first.', [':url' => $add_payment_gateway_link]);
sorabh.v6’s picture

Status: Needs work » Needs review
FileSize
775 bytes
1.1 KB

Thanks @drugan. Code updated as suggested in #14. Please review.

mglaman’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

We need test coverage in a Functional test.

mglaman’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
FileSize
3.32 KB

My local is screwing up, here's a pass at a test.

mglaman’s picture

Whoops, forgot the admin permission.

mglaman’s picture

Status: Needs review » Reviewed & tested by the community

bojanz: thoughts? I wasn't sure at first since it links to admin. But I highly doubt someone will launch like this :) And it improves the developer/site builder experience.

bojanz’s picture

Status: Reviewed & tested by the community » Needs work

Discussed points:
1) We might have gateways, but none of their conditions passed. "available" is the word we want to use, not "defined".
2) We need to account for the user possibly not having permissions to manage gateways (hence, we need two different messages).

bojanz’s picture

Title: Add payment gateway link should be in drupal message » Rework the "no payment gateways are defined" checkout error

  • bojanz committed 936de53 on 8.x-2.x authored by sorabh.v6
    Issue #2927114 by sorabh.v6, mglaman, bojanz, heddn: Rework the "no...
bojanz’s picture

Status: Needs work » Fixed

Tweaked as discussed and committed. Thanks, everyone.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.