Commit 2569764b authored by GiorgosK's avatar GiorgosK

Misspelling completed was not triggering order completion

parent 0ff6764b
......@@ -59,7 +59,7 @@ class CallbackController extends ControllerBase {
$ticket_result = $order->getData("IssueNewTicketResult");
$hash = $this->calculateHash($request, $order_id, $ticket_result);
if( $hash !== $hashkey) {
if($hash !== $hashkey) {
$this->createPayment($order, $request, $ticket_result, "Unvalidated");
return "Sorry we were not able to validate your payment";
}
......@@ -70,7 +70,7 @@ class CallbackController extends ControllerBase {
/**
* create Payment
*/
public function createPayment(Order $order, $request, $ticket_result, $state = "Completed"){
public function createPayment(Order $order, $request, $ticket_result, $state = "completed"){
$payment_storage = $this->entityTypeManager->getStorage('commerce_payment');
$payment = $payment_storage->create([
'state' => $state,
......@@ -80,7 +80,7 @@ class CallbackController extends ControllerBase {
'remote_id' => $request->get('TransactionId'),
'remote_state' => $request->get('StatusFlag'),
]);
if($state == "Completed"){
if($state == "completed"){
$payment->setAuthorizedTime(REQUEST_TIME);
$payment->setCompletedTime(REQUEST_TIME);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment