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

Some of the orders are converting into recurring order #137

Open
shunmugakumaran opened this issue Apr 19, 2024 · 1 comment
Open

Some of the orders are converting into recurring order #137

shunmugakumaran opened this issue Apr 19, 2024 · 1 comment

Comments

@shunmugakumaran
Copy link

shunmugakumaran commented Apr 19, 2024

Hi

Customer invoice gets raised early due to stored credentials/tokenization which is considered as recurring order. we don't want create a invoice from worldpay. As We have a system that will generate a invoice by third party ERP from their side. But some of the respective user placing the order which is converting into recurring order due to stored credentials/tokenization as the user stored the card details when placing order

Once done all the future order will be consider as recurring order magento will send an authorization request if successful follow-up capture requests are triggered. After successful capturing/invoicing, recurring orders are fulfilled.

This is the reason we suspecting for the issue.

Above is the default behaviour from worldpay module.. finally worldpay is capturing the order & creating the invoice. because of this order modification is happening that is not necessary

Can we turn off the stored credentials/tokenization from magneto (currently enabled in production) and still customers can save their CC?

Can we turn off this cron job worldpay_recurring_transactions in magento if this not required?

Can we have any workaround for this ? like patch to avoid this

We have also raised a support ticket with worldpay & currently reviewed by

Donovan Loftin
Client Success Manager
Global Enterprise North America

@shunmugakumaran
Copy link
Author

shunmugakumaran commented Apr 20, 2024

Hi Team,

On checking the worldpay.log in Magento, we found that

A direct token order request is happening. When a shopper saves a card, the token generated by WorldPay is saved in the Magento database; we use this token for future authorizations & create a capture request & invoice generated

  1. The order is submitted with a direct token order request.

    Reference for 1 log we found:
    a. [2024-03-07T16:24:22.540111+00:00] WorldPay. INFO: ########## Submit a direct token order request. OrderCode: xxxxx-xxxxx ########## [] []
    b. [2024-03-04T08:49:05.110370+00:00] WorldPay. INFO: ########## Submit a direct token order request. OrderCode: xxxxx-xxxxx ########## [] []
    c. [2024-04-08T12:58:05.604528+00:00] WorldPay. INFO: ########## Submit a direct token order request. OrderCode: xxxxx-xxxxx ########## [] []
    d. [2024-04-12T10:34:58.334335+00:00] WorldPay. INFO: ########## Submit a direct token order request. OrderCode: xxxxx-xxxxx ########## [] []

  2. A direct token order request will be submitted when a payment request is sent using a tokenized saved card to the WorldPay server based on the token order parameters.

  3. As per logs, we traced and tracked the below PaymentServiceRequest.php file, which is calling the below function method.

    vendor/sapient/module-worldpay/Model/Request/PaymentServiceRequest.php

    function method: capture (\Magento\Sales\Model\ (Order $order, $wp, $paymentMethodCode, $capturedItems = null)

  4. Set the capture type to full (we believe), which is then sent as a capture XML in the below function method.

    $captureSimpleXml = $this->xmlcapture->build($merchantCode, $orderCode, $order->getOrderCurrencyCode(), $order->getGrandTotal(), $exponent, $order, $captureType, $wp->getIsMultishippingOrder(), $wp->getPaymentType(), $invoicedItems);

    /vendor/sapient/module-worldpay/Model/XmlBuilder/Capture.php

    function method:build($merchantCode, $orderCode, $currencyCode, $amount, $exponent, $order, $captureType, $isMultishippingOrder, $paymentType = null, $invoicedItems = null

  5. Once Magento creates a recurring/tokenization saved card order, which is submitting the direct token order request, it sends an authorization request to Worldpay, and, if successful, follow-up capture requests are triggered. After successful capture and invoicing, created

  6. As we don't need to create an invoice from WorldPay once a capture request is submitted from the direct token order request (because this customer invoice gets raised early as the invoice will be created by our third-party ERP system only). it is submitting the first direct token order request and capturing the request after that order is submitted.

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

No branches or pull requests

1 participant