-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from JudoPay/develop
Prepare release
- Loading branch information
Showing
12 changed files
with
174 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Runtime.Serialization; | ||
|
||
// ReSharper disable ClassNeverInstantiated.Global | ||
|
||
namespace JudoPayDotNet.Models | ||
{ | ||
[DataContract] | ||
public class AndroidPaymentModel : PaymentModel | ||
{ | ||
|
||
[DataMember(IsRequired = true)] | ||
public AndroidWalletModel Wallet { get; set; } | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using Newtonsoft.Json.Linq; | ||
using System.Runtime.Serialization; | ||
|
||
namespace JudoPayDotNet.Models | ||
{ | ||
public class AndroidWalletModel | ||
{ | ||
|
||
[DataMember(IsRequired = true)] | ||
public string EncryptedMessage{ get; set; } | ||
|
||
[DataMember(IsRequired = true)] | ||
public string EphemeralPublicKey { get; set; } | ||
|
||
[DataMember(IsRequired = true)] | ||
public string Tag { get; set; } | ||
|
||
[DataMember(IsRequired = true)] | ||
public string PublicKey { get; set; } | ||
|
||
[DataMember(IsRequired = true)] | ||
public string InstrumentDetails { get; set; } | ||
|
||
[DataMember(IsRequired = true)] | ||
public string InstrumentType { get; set; } | ||
|
||
[DataMember(IsRequired = true)] | ||
public string GoogleTransactionId { get; set; } | ||
|
||
[DataMember(IsRequired = true)] | ||
public int Environment { get; set; } | ||
|
||
[DataMember(IsRequired = true)] | ||
public int Version { get; set; } | ||
|
||
public string PaymentMethodToken | ||
{ | ||
set | ||
{ | ||
var json = JObject.Parse(value); | ||
EncryptedMessage = json.GetValue("encryptedMessage").Value<string>(); | ||
EphemeralPublicKey = json.GetValue("ephemeralPublicKey").Value<string>(); | ||
Tag = json.GetValue("tag").Value<string>(); | ||
} | ||
private get { return null; } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
JudoPayDotNet/Models/Validations/AndroidPaymentValidator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using FluentValidation; | ||
|
||
namespace JudoPayDotNet.Models.Validations | ||
{ | ||
internal class AndroidPaymentValidator : PaymentsBaseValidator<AndroidPaymentModel> | ||
{ | ||
public AndroidPaymentValidator() | ||
{ | ||
RuleFor(model => model.Wallet) | ||
.NotEmpty().WithMessage("You must supply a wallet"); | ||
|
||
RuleFor(model => model.Wallet.EncryptedMessage) | ||
.NotEmpty().WithMessage("You must supply the EncryptedMessage"); | ||
|
||
RuleFor(model => model.Wallet.EphemeralPublicKey) | ||
.NotEmpty().WithMessage("You must supply the EphemeralPublicKey"); | ||
|
||
RuleFor(model => model.Wallet.Tag) | ||
.NotEmpty().WithMessage("You must supply the Tag"); | ||
|
||
RuleFor(model => model.Wallet.PublicKey) | ||
.NotEmpty().WithMessage("You must supply the PublicKey"); | ||
|
||
RuleFor(model => model.Wallet.InstrumentDetails) | ||
.NotEmpty().WithMessage("You must supply the InstrumentDetails"); | ||
|
||
RuleFor(model => model.Wallet.InstrumentType) | ||
.NotEmpty().WithMessage("You must supply the InstrumentType"); | ||
|
||
RuleFor(model => model.Wallet.GoogleTransactionId) | ||
.NotEmpty().WithMessage("You must supply the GoogleTransactionId"); | ||
|
||
RuleFor(model => model.Wallet.Environment) | ||
.NotEmpty().WithMessage("You must supply the Environment"); | ||
|
||
RuleFor(model => model.Wallet.Version) | ||
.NotEmpty().WithMessage("You must supply the Version"); | ||
} | ||
} | ||
} |