Skip to content

Commit c136579

Browse files
committed
Merge branch 'graphql-api-enhancements' of github.com:magento-lynx/magento2ce into LYNX-699
2 parents 7954f5d + ea407a5 commit c136579

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

app/code/Magento/OrderCancellationGraphQl/Model/CancelOrderGuest.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Magento\Sales\Api\OrderRepositoryInterface;
1515
use Magento\Sales\Model\Order;
1616
use Magento\SalesGraphQl\Model\Formatter\Order as OrderFormatter;
17+
use Magento\SalesGraphQl\Model\Order\Token;
1718

1819
class CancelOrderGuest
1920
{
@@ -25,13 +26,15 @@ class CancelOrderGuest
2526
* @param ConfirmationKeySender $confirmationKeySender
2627
* @param GetConfirmationKey $confirmationKey
2728
* @param Uid $idEncoder
29+
* @param Token $token
2830
*/
2931
public function __construct(
3032
private readonly OrderFormatter $orderFormatter,
3133
private readonly OrderRepositoryInterface $orderRepository,
3234
private readonly ConfirmationKeySender $confirmationKeySender,
3335
private readonly GetConfirmationKey $confirmationKey,
34-
private readonly Uid $idEncoder
36+
private readonly Uid $idEncoder,
37+
private readonly Token $token
3538
) {
3639
}
3740

@@ -72,7 +75,13 @@ private function sendConfirmationKeyEmail(Order $order, string $reason): void
7275
$order,
7376
[
7477
'order_id' => $this->idEncoder->encode((string)$order->getEntityId()),
75-
'confirmation_key' => $this->confirmationKey->execute($order, $reason)
78+
'confirmation_key' => $this->confirmationKey->execute($order, $reason),
79+
'orderRef' => $this->token->encrypt(
80+
$order->getIncrementId(),
81+
$order->getBillingAddress()->getEmail(),
82+
$order->getBillingAddress()->getLastname()
83+
),
84+
'action' => 'cancel'
7685
]
7786
);
7887

0 commit comments

Comments
 (0)