Skip to content

Commit

Permalink
BuildMaster release: v1.7.33
Browse files Browse the repository at this point in the history
  • Loading branch information
securesubmit-buildmaster committed Jul 1, 2021
1 parent a7117d5 commit a3ea842
Show file tree
Hide file tree
Showing 3 changed files with 223 additions and 12 deletions.
20 changes: 11 additions & 9 deletions src/GlobalPayments.Api/Mapping/GpApiMapping.cs
Expand Up @@ -75,7 +75,7 @@ public class GpApiMapping {

var summary = new TransactionSummary {
TransactionId = doc.GetValue<string>("id"),
TransactionDate = doc.GetValue<DateTime>("time_created"),
TransactionDate = doc.GetValue<DateTime?>("time_created", DateConverter),
TransactionStatus = doc.GetValue<string>("status"),
TransactionType = doc.GetValue<string>("type"),
Channel = doc.GetValue<string>("channel"),
Expand Down Expand Up @@ -111,7 +111,7 @@ public class GpApiMapping {

private static DateTime? DateConverter(object value) {
if (value != null && !string.IsNullOrEmpty(value.ToString())) {
return DateTime.Parse(value.ToString());
return Convert.ToDateTime(value);
}
return null;
}
Expand Down Expand Up @@ -190,7 +190,7 @@ public class GpApiMapping {
public static DepositSummary MapDepositSummary(JsonDoc doc) {
var summary = new DepositSummary {
DepositId = doc.GetValue<string>("id"),
DepositDate = doc.GetValue<DateTime>("time_created"),
DepositDate = doc.GetValue<DateTime?>("time_created", DateConverter),
Status = doc.GetValue<string>("status"),
Type = doc.GetValue<string>("funding_type"),
Amount = doc.GetValue<string>("amount").ToAmount(),
Expand Down Expand Up @@ -222,7 +222,7 @@ public class GpApiMapping {
public static DisputeSummary MapDisputeSummary(JsonDoc doc) {
var summary = new DisputeSummary {
CaseId = doc.GetValue<string>("id"),
CaseIdTime = doc.GetValue<DateTime?>("time_created"),
CaseIdTime = doc.GetValue<DateTime?>("time_created", DateConverter),
CaseStatus = doc.GetValue<string>("status"),
CaseStage = doc.GetValue<string>("stage"),
CaseAmount = doc.GetValue<string>("amount").ToAmount(),
Expand All @@ -244,7 +244,7 @@ public class GpApiMapping {
};

if (!string.IsNullOrEmpty(doc.GetValue<string>("time_to_respond_by"))) {
summary.RespondByDate = doc.GetValue<DateTime?>("time_to_respond_by");
summary.RespondByDate = doc.GetValue<DateTime?>("time_to_respond_by", DateConverter);
}

return summary;
Expand All @@ -253,10 +253,10 @@ public class GpApiMapping {
public static DisputeSummary MapSettlementDisputeSummary(JsonDoc doc) {
var summary = MapDisputeSummary(doc);

summary.CaseIdTime = doc.GetValue<DateTime?>("stage_time_created");
summary.DepositDate = doc.GetValue<string>("deposit_time_created")?.ToDateTime("yyyy-MM-dd");
summary.CaseIdTime = doc.GetValue<DateTime?>("stage_time_created", DateConverter);
summary.DepositDate = doc.GetValue<DateTime?>("deposit_time_created",DateConverter);
summary.DepositReference = doc.GetValue<string>("deposit_id");
summary.TransactionTime = doc.Get("transaction")?.GetValue<DateTime?>("time_created");
summary.TransactionTime = doc.Get("transaction")?.GetValue<DateTime?>("time_created", DateConverter);
summary.TransactionType = doc.Get("transaction")?.GetValue<string>("type");
summary.TransactionAmount = doc.Get("transaction")?.GetValue<string>("amount").ToAmount();
summary.TransactionCurrency = doc.Get("transaction")?.GetValue<string>("currency");
Expand Down Expand Up @@ -340,7 +340,9 @@ public class GpApiMapping {
ChallengeReturnUrl = json.Get("notifications")?.GetValue<string>("challenge_return_url"),
SessionDataFieldName = json.Get("three_ds")?.GetValue<string>("session_data_field_name"),
MessageType = json.Get("three_ds")?.GetValue<string>("message_type"),
PayerAuthenticationRequest = json.Get("three_ds")?.GetValue<string>("challenge_value"),
PayerAuthenticationRequest = (!string.IsNullOrEmpty(json.Get("three_ds")?.Get("method_data")?.GetValue<string>("encoded_method_data"))) ?
json.Get("three_ds")?.Get("method_data")?.GetValue<string>("encoded_method_data") :
json.Get("three_ds")?.GetValue<string>("challenge_value"),
StatusReason = json.Get("three_ds")?.GetValue<string>("status_reason"),
MessageCategory = json.Get("three_ds")?.GetValue<string>("message_category"),
}
Expand Down
4 changes: 2 additions & 2 deletions tests/GlobalPayments.Api.Tests/GpApi/GpApi3DSecureTests.cs
Expand Up @@ -34,8 +34,8 @@ public class GpApi3DSecureTests : BaseGpApiTests {
[ClassInitialize]
public static void ClassInitialize(TestContext context) {
ServicesContainer.ConfigureService(new GpApiConfig {
AppId = "P3LRVjtGRGxWQQJDE345mSkEh2KfdAyg",
AppKey = "ockJr6pv6KFoGiZA",
AppId = "rkiYguPfTurmGcVhkDbIGKn2IJe2t09M",
AppKey = "6gFzVGf40S7ZpjJs",
Country = "GB",
ChallengeNotificationUrl = "https://ensi808o85za.x.pipedream.net/",
MethodNotificationUrl = "https://ensi808o85za.x.pipedream.net/",
Expand Down

0 comments on commit a3ea842

Please sign in to comment.