Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions QuickPay.IntegrationTests/PaymentsServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void CreatePaymentLink()
var service = new PaymentsService(QpConfig.ApiKey);
string randomOrderId = OrderIdGenerator.createRandomOrderId();

var createPaymentReqParams= new CreatePaymentRequestParams("DKK", randomOrderId);
var createPaymentReqParams = new CreatePaymentRequestParams("DKK", randomOrderId);
Payment payment = service.CreatePayment(createPaymentReqParams).GetAwaiter().GetResult();

var createPaymentLinkReqParams = new CreatePaymentLinkRequestParams(1000);
Expand All @@ -128,7 +128,7 @@ public void DeletePaymentLink()
{
task.GetAwaiter().GetResult();
}
catch(Exception)
catch (Exception)
{
Assert.Fail("No exception should be thrown");
}
Expand Down Expand Up @@ -161,6 +161,39 @@ public void UpdatePayment()
var result = task.Result;

Assert.IsNotNull(result);
}
}

private readonly string _jsonPaymentResponseTest = @"{
""id"": 2,
""type"": ""authorize"",
""amount"": 148,
""pending"": false,
""qp_status_code"": ""20000"",
""qp_status_msg"": ""Approved"",
""aq_status_code"": ""0"",
""aq_status_msg"": ""Accepted, The agreement has been accepted."",
""data"": { },
""callback_url"": ""https://13f5-147-78-28-145.ngrok-free.app/subscriptions/callback"",
""callback_success"": false,
""callback_response_code"": null,
""callback_duration"": 30002,
""acquirer"": ""mobilepaysubscriptions"",
""3d_secure_status"": null,
""callback_at"": ""2023-09-06T11:54:00Z"",
""created_at"": ""2023-09-06T11:50:58Z""
}";

[TestMethod]
public void ParseJsonResponse()
{
try
{
var operation = System.Text.Json.JsonSerializer.Deserialize<Quickpay.Models.Payments.Operation>(_jsonPaymentResponseTest);
}
catch (Exception e)
{
Assert.Fail(e.Message);
}
}
}
}
2 changes: 1 addition & 1 deletion QuickPay/Models/Payments/Operation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class Operation
public string callback_url { get; set; }
public Boolean? callback_success { get; set; }
public string callback_response_code { get; set; }
public string callback_duration { get; set; }
public int? callback_duration { get; set; }
public string acquirer { get; set; }
public string callback_at { get; set; }
public string created_at { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions QuickPay/Quickpay.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>2.2.3</Version>
<Version>2.2.4</Version>
<PackageId>QuickPay.API.Client</PackageId>
<ReleaseVersion>2.2.3</ReleaseVersion>
<ReleaseVersion>2.2.4</ReleaseVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
Expand Down