Skip to content
Snippets Groups Projects
Commit 715ad335 authored by Trent Crawford's avatar Trent Crawford Committed by Sascha Grossenbacher
Browse files

Issue #3128594 by tcrawford, Berdir: Duplicate check failing on processPayment

parent bc6f9b5e
Branches
Tags
No related merge requests found
......@@ -348,7 +348,7 @@ class Datatrans extends OffsitePaymentGatewayBase {
protected function processPayment(array $post_data, OrderInterface $order) {
$payment_storage = $this->entityTypeManager->getStorage('commerce_payment');
if ($payment_storage->loadByProperties(['remote_id' => $post_data['authorizationCode']])) {
if ($payment_storage->loadByProperties(['remote_id' => $post_data['uppTransactionId']])) {
return FALSE;
}
......
......@@ -113,6 +113,9 @@ class DatatransKernelTest extends CommerceKernelTestBase {
]);
$datatrans->onReturn($this->order, $request);
// Process a second time, ensure that no duplicate is created.
$datatrans->onReturn($this->order, $request);
$payments = $this->entityTypeManager->getStorage('commerce_payment')->loadMultiple(NULL);
$this->assertCount(1, $payments);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment