Skip to content

Commit 8d87d67

Browse files
committed
Payment status field amends.
1 parent e6ec03c commit 8d87d67

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Umbraco.Forms.Integrations.Commerce.EMerchantPay/Controllers/PaymentProviderController.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,16 @@ public HttpResponseMessage NotifyPayment(string formId, string recordUniqueId, s
7777
var record = _recordStorage.GetRecordByUniqueId(Guid.Parse(recordUniqueId), form);
7878

7979
var paymentStatusField = record.GetRecordField(Guid.Parse(statusFieldId));
80+
paymentStatusField.Values.Clear();
8081
paymentStatusField.Values.Add(reconcileResponse.Status);
8182

82-
if(approve && notificationDto.Status == Constants.PaymentStatus.Approved)
83+
_recordStorage.UpdateRecord(record, form);
84+
85+
if (approve && notificationDto.Status == Constants.PaymentStatus.Approved)
8386
{
8487
_recordService.Approve(record, form);
8588
}
8689

87-
_recordStorage.UpdateRecord(record, form);
88-
8990
if (reconcileResponse.Status == Constants.ErrorCode.WorkflowError)
9091
return new HttpResponseMessage(HttpStatusCode.BadRequest);
9192

0 commit comments

Comments
 (0)