Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding vipps via quickpay #7

Merged
merged 2 commits into from
Jan 25, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<VersionPrefix>10.0.5</VersionPrefix>
<VersionPrefix>10.0.6</VersionPrefix>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<Title>QuickPay Payment Window</Title>
<Description>The QuickPay Payment Window checkout handler is designed to work with QuickPay v10.</Description>
Expand Down
1 change: 1 addition & 0 deletions src/QuickPayPaymentWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/// </summary>
[AddInName("QuickPay Payment Window"),
AddInDescription("QuickPay Payment Window Checkout Handler")]
public class QuickPayPaymentWindow : CheckoutHandlerWithStatusPage, IDropDownOptions, IRemotePartialCapture, ISavedCard, IRecurring, IPartialReturn, IFullReturn

Check warning on line 28 in src/QuickPayPaymentWindow.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

'IDropDownOptions' is obsolete: 'Use IParameterOptions instead.'
{
private enum PostModes { Auto, Template, Inline }

Expand Down Expand Up @@ -283,7 +283,7 @@
/// checksum /^[a-z0-9]{32}$/ The calculated checksum of your data./
/// </remarks>
public override string StartCheckout(Order order) => StartCheckout(order, false, null, null);
public override string StartCheckout(Order order, bool headless, string? receiptUrl, string? cancelUrl)

Check warning on line 286 in src/QuickPayPaymentWindow.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 286 in src/QuickPayPaymentWindow.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
try
{
Expand Down Expand Up @@ -385,7 +385,7 @@

default:
Callback(order);
Context.Current.Response.End();

Check warning on line 388 in src/QuickPayPaymentWindow.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

'IResponse.End()' is obsolete: 'Do not use'
return null;
}
}
Expand Down Expand Up @@ -450,7 +450,7 @@
var metadata = Converter.Deserialize<Dictionary<string, object>>(cardData["metadata"].ToString());
var cardType = Converter.ToString(metadata["brand"]);
var cardNubmer = order.TransactionCardNumber = Converter.ToString(metadata["last4"]).PadLeft(16, 'X');
var user = User.GetCurrentUser(PagePermissionLevels.Frontend);

Check warning on line 453 in src/QuickPayPaymentWindow.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

'PagePermissionLevels' is obsolete: 'Do not use'

Check warning on line 453 in src/QuickPayPaymentWindow.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

'User.GetCurrentUser(PagePermissionLevels)' is obsolete: 'Use UserContext.Current.User instead. Check User.GetAllowBackendWithInheritance(), if needed.'
if (user != null)
{
var savedCard = Services.PaymentCard.CreatePaymentCard(user.ID, order.PaymentMethodId, storedCardInfo.Item2, cardType, cardNubmer, storedCardInfo.Item1);
Expand Down Expand Up @@ -816,7 +816,7 @@
return errorTemplate.Output();
}

private string CreateCard(string cardName, Order order, bool headless, string? receiptUrl, string? cancelUrl)

Check warning on line 819 in src/QuickPayPaymentWindow.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 819 in src/QuickPayPaymentWindow.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
string errorMessage = "Error happened during creating QuickPay card";

Expand Down Expand Up @@ -848,7 +848,7 @@
if (response.ContainsKey("url"))
{
Services.Orders.Save(order);
Context.Current.Response.Redirect(Converter.ToString(response["url"]));

Check warning on line 851 in src/QuickPayPaymentWindow.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

'IResponse.Redirect(string)' is obsolete: 'Do not use'
}
else
{
Expand Down Expand Up @@ -930,7 +930,7 @@
}

//Create HTTP POST request to QuickPay API.
HttpWebRequest request = HttpWebRequest.CreateHttp(GetServiceLink(apiService, serviceObjID, serviceParameters));

Check warning on line 933 in src/QuickPayPaymentWindow.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

'WebRequest.CreateHttp(string)' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

request.Headers.Set(HttpRequestHeader.Authorization, string.Format("Basic {0}", Convert.ToBase64String(Encoding.UTF8.GetBytes(string.Format(":{0}", ApiKey)))));
request.Headers.Add("Accept-Version", "v10");
Expand Down Expand Up @@ -1473,6 +1473,7 @@
{"swish", "Swish"},
{"trustly", "Trustly"},
{"vipps", "Vipps"},
{"vippspsp", "Vipps via Quickpay"},
{"paysafecard", "Paysafecard"}
};

Expand Down
Loading