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

[ECP-9196] Allow shopperReference to be linked to GuestCustomer #2607

Open
ryan-lambert-IEX opened this issue May 7, 2024 · 6 comments · May be fixed by #2620
Open

[ECP-9196] Allow shopperReference to be linked to GuestCustomer #2607

ryan-lambert-IEX opened this issue May 7, 2024 · 6 comments · May be fixed by #2620
Assignees
Labels
Enhancement Indicates a new feature request

Comments

@ryan-lambert-IEX
Copy link

Is your feature request related to a problem? Please describe.
We are trying to pass in a tokenized storedPaymentMethodId to a guest-cart checkout, and right now there doesn't appear to be a way to link the shopperReference with the guest user. In the current plugin, the shopperReference is either the customerID or a UUID, causing our guest-cart payment to fail, as there is no way to get or change the uuid value prior to submission.

// in Helper/Requests.php
    public function getShopperReference($customerId, $orderIncrementId): string
    {
        if ($customerId) {
            $shopperReference = $this->adyenHelper->padShopperReference($customerId);
        } else {
            $uuid = Uuid::generateV4();
            $guestCustomerId = $orderIncrementId . $uuid;
            $shopperReference = $guestCustomerId;
        }

        return $shopperReference;
    }
}

For added context, we have a headless implementation which tokenizes card information by making a 0 dollar charge (per docs ). Our implementation handles raw credit card information (we are PCI certified) and we require our AdobeCommerce partners to submit a SAQ-A-EP and provision us with our own API key as to limit the scope of our tokenization flow.

We are trying to pass our tokenized payment data (we cannot pass raw card data, as this would break the PCI chain, nor can we use the AdyenJS library in our environment) to AdobeCommerce for submission. We use guest-carts since our flow collects payment information outside the usual "primary" store workflow.

Using the guest-cart flow as described above works great for Braintree and Stripe, but this shopperReference uuid seems to break our intended flow in our Adyen implementation.

Describe the solution you'd like
I think any of these things could fix this problem:

  1. Use the guest-cart uuid cartId for the shopperReference vs the current orderId.uuid you use now
  2. Allow a shopperReference value to be passed into the paymentMethod.additional_data which overrides the current behavior
  3. Allow us to retrieve the uuid value prior to submission; can be attached to the guest-cart/${cartId}

Describe alternatives you've considered
I understand why you use a uuid for guests, as the assumption probably is stored payment methods belong to "stored customers".

An alternative would be for Adyen to provide a way to get a single-use-payment-token like Braintree and Stripe vs. a stored payment method (with a shopperReference), but that change is probably far too great to hope for :]

Additional context
Our website

@ryan-lambert-IEX ryan-lambert-IEX added the Enhancement Indicates a new feature request label May 7, 2024
@RokPopov RokPopov changed the title Allow shopperReference to be linked to GuestCustomer [ECP-9196] Allow shopperReference to be linked to GuestCustomer May 14, 2024
@RokPopov
Copy link
Contributor

Hi @ryan-lambert-IEX,

Thank you for opening this issue. I have opened a ticket internally to investigate the above and decide on what would the best approach be. We'll update the issue accordingly.

Kind regards,
Rok

@RokPopov RokPopov self-assigned this May 14, 2024
@ryan-lambert-IEX
Copy link
Author

Thank you @RokPopov keen to hear your feedback on the preferred approach. We are happy to help contribute / submit a PR for solution.

@RokPopov
Copy link
Contributor

Hi @ryan-lambert-IEX,

Thank you for your reply. We would be happy to review your contribution and iterate over it if necessary.

Kind regards,
Rok

@ryan-lambert-IEX
Copy link
Author

@RokPopov #2620 offers a simple solution; please review and let us know your thoughts. This would unblock us internally so appreciate it.

@RokPopov
Copy link
Contributor

Hi @ryan-lambert-IEX,

Thank you for your contribution, it is highly appreciated. I left a comment on the PR itself, could you please take a look when you'll get a chance?

Kind regards,
Rok

@ryan-lambert-IEX
Copy link
Author

@RokPopov let me know what you think of the updated PR; happy to make tweaks as needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Indicates a new feature request
Projects
None yet
2 participants