这是indexloc提供的服务,不要输入任何密码
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
5 changes: 3 additions & 2 deletions ShopifySharp.Tests/Multipass_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void Link_Multipass()
string url = MultipassService.GetMultipassUrl(
Fixture.Create(),
Utils.MyShopifyUrl,
Utils.AccessToken
Utils.MultipassSecret
);

Assert.True(!string.IsNullOrEmpty(url));
Expand All @@ -33,14 +33,15 @@ public class Multipass_Tests_Fixture : IAsyncLifetime
{
public Guid Guid = Guid.NewGuid();

public Customer Create() => new Customer()
public MultipassRequest Create() => new MultipassRequest()
{
Email = Guid.NewGuid().ToString() + "@example.com",
CreatedAt = DateTimeOffset.Now,
FirstName = "John",
LastName = "Doe",
VerifiedEmail = true,
MultipassIdentifier = Guid.ToString(),
ReturnTo = $"{Utils.MyShopifyUrl}",
Addresses = new List<Address>()
{
new Address()
Expand Down
20 changes: 20 additions & 0 deletions ShopifySharp/Entities/MultipassRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Text;

namespace ShopifySharp
{
public class MultipassRequest : Customer
{
[JsonProperty("tag_string")]
public string TagString { get; set; }
[JsonProperty("identifier")]
public string Identifier { get; set; }
[JsonProperty("remote_ip")]
public string RemoteIP { get; set; }
[JsonProperty("return_to")]
public string ReturnTo { get; set; }
}
}
5 changes: 3 additions & 2 deletions ShopifySharp/Services/Multipass/MultipassService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Security.Cryptography;
using System.Text;
using Newtonsoft.Json;
using ShopifySharp.Entities;

namespace ShopifySharp
{
Expand All @@ -12,8 +13,8 @@ public static class MultipassService
private const int FixedKeySize = 16;

public static string GetMultipassUrl(
Customer userData,
string shopifyUrl,
MultipassRequest userData,
string shopifyUrl,
string multipassSecret
)
{
Expand Down