Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PW-6287] - Check if LPM supports recurring before adding recurring info #1389

Merged
merged 23 commits into from Mar 14, 2022

Conversation

Morerice
Copy link
Contributor

Description
Currently we are attempting to tokenize any alternative payment methods based on the settings related to stored card payments. The functionality should be divided and a list of payment methods that support recurring should be created. However from this list, only SEPA should be enabled for now.

Also add a new Token Type option to identify if the created token for alternative payment methods is a CardOnFile or a Subscription token.

Note that when upgrading the current Store alternative payment methods option will be set to No. This is done to ensure that once enabled, the admin will also choose what type of token should be created.

Tested scenarios

  • Card payment
  • Card payment (CardOnFile token created)
  • Card payment (Subscription token created)
  • Tokenized card payment (CardOnFile)
  • SEPA payment
  • SEPA payment (CardOnFile token created)
  • SEPA payment (Subscription token created)

…payment method should be saved (cardonfile or subscription)
…ld recurringtype source and model to deprecated
Setup/UpgradeData.php Outdated Show resolved Hide resolved
Copy link
Member

@acampos1916 acampos1916 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments.

acampos1916
acampos1916 previously approved these changes Mar 11, 2022
@@ -329,17 +337,15 @@ public function buildBrowserData($request = [])
}

/**
*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you forgot to write some docs for this method? or why the extra lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch 💪 Updated in c4ba1d3

@@ -0,0 +1,41 @@
<?php
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! 😎

@sonarcloud
Copy link

sonarcloud bot commented Mar 11, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 9 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Morerice Morerice merged commit 6a3afcf into develop Mar 14, 2022
@Morerice Morerice deleted the PW-6287 branch March 14, 2022 13:14
@Morerice Morerice mentioned this pull request Mar 15, 2022
@evgv
Copy link

evgv commented Mar 17, 2022

Hi

Currently I'm working on GraphQL implementation Adyen plugin with our frontend, so I pulled develop and everything was working well, but after these update and adding these code

if ($additionalData[self::BRAND_CODE] === Data::SEPA) { $additionalDataToSave = $this->getSepaAdditionalDataToSave($stateData); }

into the AdyenHppDataAssignObserver it stopped working because after second time when this event is triggering the additional data received from payment object (table) there is no brand_code field because in the payment table no such field, this data stored in additional_information field so as the temporary solution we can add these code

if (isset($additionalData['additional_information'])) { $additionalData = array_merge($additionalData, $additionalData['additional_information']); }

right above the previous the

$additionalData = DataArrayValidator::getArrayOnlyWithApprovedKeys( $additionalData, self::$approvedAdditionalDataKeys );

to add brand_code from additional_information

this error can be reproduced within HPP method as PP for example

UPD

or we could check the cc_type field instead of brand_code because in case of HPP it stored brand code value, for example for PP cc_type = paypal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants