I'm seeing these two warnings when users pay:

Notice: Undefined index: type in Drupal\stripe_checkout\StripeCallback->charge() (line 35 of /srv/bindings/eb2855608a6948439c41e7d233956502/code/modules/contrib/stripe_checkout/src/StripeCallback.php).

Warning: Creating default object from empty value in Drupal\stripe_checkout\StripeCallback->charge() (line 59 of /srv/bindings/eb2855608a6948439c41e7d233956502/code/modules/contrib/stripe_checkout/src/StripeCallback.php).

I'll throw together a patch. Thanks for this module!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kostajh created an issue. See original summary.

kostajh’s picture

FileSize
990 bytes
kostajh’s picture

Assigned: kostajh » Unassigned
Status: Active » Needs review
yanniboi’s picture

+++ b/src/StripeCallback.php
@@ -32,7 +32,7 @@ class StripeCallback extends ControllerBase {
+      if (isset($values['type']) && $values['type'] == 'stripe_checkout') {

Yes!

+++ b/src/StripeCallback.php
@@ -56,6 +56,7 @@ class StripeCallback extends ControllerBase {
+      $node->revision = new stdClass();

Correct me if I'm wrong, but I dont think we need to set $node->revision at all. Will it not create a new revision from $node->revision_log alone?

kostajh’s picture

@yanniboi not sure, that would be a good thing to test. Also, it should be `new \stdClass()`, if someone wants to update this patch.

kostajh’s picture

Status: Needs review » Needs work
yanniboi’s picture

I had a quick look at this, and setting $node->revision or leaving it out both update the current revision, but do not create a new revision. Need to have a look how you are supposed to programmatically create a new revision.

yanniboi’s picture

Status: Needs work » Needs review
FileSize
1.44 KB
1007 bytes

Figured it out, there is a method on the node entity setNewRevision().

I also changed $node->$clicked->value to $node->{$clicked}->value to be more readable...