This bug report is being created after a discussion on Slack with mglaman.

The latest dev release (Oct 10, 2019) is working on the front end but not on the admin side (/admin/commerce/orders/%/payment).

The error in watchdog reads: Square transaction error. category: INVALID_REQUEST_ERROR code: MISSING_REQUIRED_PARAMETER detail: Missing required parameter.

From mglaman:

it looks like the JavaScript isn't mounting right

which.. https://git.drupalcode.org/project/commerce_square/blob/7.x-1.x/commerce...
that's why

that needs to also be in the #attached here commerce_square_payment_method_submit_form

CommentFileSizeAuthor
#6 3087211-6.patch2.91 KBmglaman

Comments

2ndmile created an issue. See original summary.

2ndmile’s picture

Title: Terminal Payments do not work due to missing JS file. » Terminal Payments do not work due to missing JS file
mglaman’s picture

Assigned: Unassigned » mglaman
mglaman’s picture

Title: Terminal Payments do not work due to missing JS file » Terminal Payments do not work
Related issues: +#3087422: Prevent possible "SqPaymentForm is not defined"

First there was #3087422: Prevent possible "SqPaymentForm is not defined", the initial problem. There's also a fatal error that occurs as well.

  /** @var \SquareConnect\Model\ChargeResponse $result */
  $result = $order->square_result;

The $result variable is null.

mglaman’s picture

This is the problem, the form submit selector: var $formSubmit = $rootForm.find('#edit-continue[name="op"]');

mglaman’s picture

Status: Active » Needs review
StatusFileSize
new2.91 KB

Here is a patch that should fix admin based payments.

mglaman’s picture

Assigned: mglaman » Unassigned
mglaman’s picture

making sure @2ndmile is credited for QA assistance

  • mglaman committed 99db957 on 7.x-1.x
    Issue #3087211 by mglaman, 2ndmile: Terminal Payments do not work
    
mglaman’s picture

Status: Needs review » Fixed

This is fixed!

Status: Fixed » Closed (fixed)

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