Skip to content

Commit db2a2ee

Browse files
author
Fabian Pechstein
committed
[bug-fix] remove '_' from narrative_text in case of KLARNA/SOFORT
1 parent c033ed5 commit db2a2ee

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/PayoneBundle/Ecommerce/PaymentManager/BsPayone.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ private function setupPostParametersFor($paymentType, $cart, $orderIdent, $confi
869869
"amount" => $this->getAmount($price),
870870
'currency' => $price->getCurrency()->getShortName(),
871871
"reference" => $orderIdent,
872-
"narrative_text" => $config['orderDescription'] ?: $config['paymentInfo']->getInternalPaymentId(),
872+
"narrative_text" => $this->cleanNarrativeText( $config['orderDescription'] ?: $config['paymentInfo']->getInternalPaymentId()),
873873
"successurl" => $config['successURL'],
874874
"errorurl" => $config['failureURL'],
875875
"backurl" => $config['cancelURL'],
@@ -1358,4 +1358,11 @@ public function startPayment(OrderAgentInterface $orderAgent, PriceInterface $pr
13581358

13591359
return new SnippetResponse($orderAgent->getOrder(), $snippet);
13601360
}
1361+
1362+
private function cleanNarrativeText(string $param)
1363+
{
1364+
//some chars like "_" seem to cause issues with SOFORT/KLARNA
1365+
$param = str_replace('_', '-', $param);
1366+
return $param;
1367+
}
13611368
}

0 commit comments

Comments
 (0)