-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
70 additions
and
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using GoPay.Common; | ||
using Newtonsoft.Json; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
|
||
|
||
namespace GoPay.Model.Payments | ||
{ | ||
public class Bnpl | ||
{ | ||
|
||
[JsonProperty("bnplType")] | ||
[JsonConverter(typeof(SafeJsonEnumStringConvertor), (int) BnplType.UNKNOWN)] | ||
public BnplType bnplType { get; set; } | ||
|
||
[JsonProperty("label")] | ||
public Dictionary<CultureInfo, string> Label { get; set; } | ||
|
||
[JsonProperty("image")] | ||
public Image Image { get; set; } | ||
|
||
|
||
public Bnpl AddLabel(CultureInfo locale, string label) | ||
{ | ||
if (this.Label == null) | ||
{ | ||
this.Label = new Dictionary<CultureInfo, string>(); | ||
} | ||
|
||
this.Label.Add(locale, label); | ||
return this; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
Console.WriteLine("KONZOLE"); | ||
Console.WriteLine(bnplType); | ||
return string.Format( | ||
"BnplType [BnplType={0}, Label={1}, Image={2}]", | ||
bnplType, Label, Image | ||
); | ||
} | ||
|
||
|
||
|
||
} | ||
} |
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 |
---|---|---|
@@ -1,45 +1,11 @@ | ||
using GoPay.Common; | ||
using Newtonsoft.Json; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
|
||
|
||
| ||
namespace GoPay.Model.Payments | ||
{ | ||
public class BnplType | ||
public enum BnplType | ||
{ | ||
DEFERRED_PAYMENT, | ||
PAY_IN_THREE, | ||
|
||
[JsonProperty("bnplType")] | ||
public string BnplCategory { get; set; } | ||
|
||
[JsonProperty("label")] | ||
public Dictionary<CultureInfo, string> Label { get; set; } | ||
|
||
[JsonProperty("image")] | ||
public Image Image { get; set; } | ||
|
||
|
||
public BnplType AddLabel(CultureInfo locale, string label) | ||
{ | ||
if (this.Label == null) | ||
{ | ||
this.Label = new Dictionary<CultureInfo, string>(); | ||
} | ||
|
||
this.Label.Add(locale, label); | ||
return this; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return string.Format( | ||
"BnplType [BnplType={0}, Label={1}, Image={2}]", | ||
BnplCategory, Label, Image | ||
); | ||
} | ||
|
||
|
||
|
||
UNKNOWN | ||
} | ||
} |
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