Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mglaman created an issue. See original summary.

focal55’s picture

I took a pass at implementing this. It provides a checkbox on the payment method add form allowing the user to opt in for storing the card on file. If the user opts in, the customer and card records is store at Square.

focal55’s picture

I fixed up the coding standard errors in this patch.

focal55’s picture

I used the AddressItem class to set the address data in this patch.

mglaman’s picture

Status: Active » Needs review

Thanks! I'll review. One of the blockers was to get this optional select in 2.0 core

Status: Needs review » Needs work

The last submitted patch, 4: reusable-payments-2869137-4.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

nnevill’s picture

Version: 8.x-1.x-dev » 8.x-1.2
Status: Needs work » Needs review
FileSize
10.08 KB

Here is working versions for reusable square payments for 8.x-1.2 version.

vuil’s picture

Is this issue related? #3069064

My Square Connect module doesn't work at all.

vuil’s picture

I also update #7 patch with the mentioned issue [#3069064] to the latest 8.x-1.x-dev version.

vuil’s picture

Status: Needs review » Needs work

The last submitted patch, 9: 2869137-9.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

SocialNicheGuru’s picture

this no longer applies after the new dev version.

mglaman’s picture

Hiding the patch from ilchovuchkov in #9. It's a mismash.

#7 will need a reroll against fixes for the 2019-03-15 API changes going into -dev.

I like this approach until Commerce itself adds this checkbox.

focal55’s picture

This seems to work for me against the lastest version of dev.

oheller’s picture

This patch is using tabs for indents instead of two spaces. It is creating havoc when trying to implement further patches on these files.

oheller’s picture

SocialNicheGuru’s picture

no longer applies to 1.4 version

oheller’s picture

Here is a rerolled patch for 1.4.

oheller’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 18: 2869137-18.patch, failed testing. View results

vmarchuk’s picture

We should take into account this issue #2871483 as it's described here

SocialNicheGuru’s picture

Why are there two reusable checkboxes

+    $element['reusable'] = [
+      '#type' => 'checkbox',
+      '#title' => t('Save this card for future purchases'),
+      '#default_value' => TRUE,
+      '#attributes' => [
+        'checked' => 'checked',
+        'class' => ['form-group'],
+      ],
+    ];
+
+    $element['reusable'] = [
+      '#type' => 'checkbox',
+      '#title' => t('Save this card for future purchases'),
+      '#default_value' => TRUE,
+      '#attributes' => [
+        'checked' => 'checked',
+        'class' => ['form-group'],
+      ],
+    ];
+
SocialNicheGuru’s picture

Edit: I no longer have the issue below.

It seems to work for me.

Slight modification would be to remove the redundant code for the checkbox.

I apply the patch
select recurring
the initial order is settled as expected
The recurring order is settled also.

----
I apply the patch
I can go through the checkout just fine as anonymous user.
If I am logged in there is an error on payment.

I get the following:
We encountered an unexpected error processing your payment method. Please try again later.

and then in my logs:
mysite/checkout/80/review
Message [HTTP/2 400] @"errors":[{"category":"INVALID_REQUEST_ERROR","code":"MISSING_REQUIRED_PARAMETER","detail":"Missing required parameter.","field":"customer_id"]}

SocialNicheGuru’s picture

SocialNicheGuru’s picture

This no longer applies to the module.

as_vard’s picture

Any news?

vuil’s picture