Skip to content

Commit

Permalink
Add a services example
Browse files Browse the repository at this point in the history
  • Loading branch information
chrpai committed Apr 3, 2019
1 parent 003e386 commit 61407a1
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
8 changes: 4 additions & 4 deletions samples/TestApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using TestApp.Common;
using TestApp.Transaction;

//using TestApp.Transaction;
using TestApp.Services;
namespace TestApp
{
class Program
{
static void Main(string[] args)
{
Utility.ConfigureInstance();
TransactionSamples.ProcessCreditCardSale();

//TransactionSamples.ProcessCreditCardSale();
ServicesSamples.PaymentAccountCreate();
}
}
}
32 changes: 32 additions & 0 deletions samples/TestApp/Services/PaymentAccountCreate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VXEN.Models.Services;
using VXEN.Services;

namespace TestApp.Services
{
public partial class ServicesSamples
{
public static void PaymentAccountCreate()
{
typePaymentAccountCreateWithTransID paymentAccountCreateWithTransID = new typePaymentAccountCreateWithTransID();
typeCard card = new typeCard();
card.CardNumber = "12345678";
card.WalletType = typeCardWalletType.Item2;

typePaymentAccount paymentAccount = new typePaymentAccount();
paymentAccount.PaymentAccountType = "0";

paymentAccountCreateWithTransID.Application = Session.Instance.GetApplication<typeApplication>();
paymentAccountCreateWithTransID.Credentials = Session.Instance.GetCredentials<typeCredentials>();
paymentAccountCreateWithTransID.PaymentAccount = paymentAccount;
paymentAccountCreateWithTransID.Card = card;

var xml = Serialization.Serialize<typePaymentAccountCreateWithTransID>(paymentAccountCreateWithTransID);
Console.WriteLine("PAK");
}
}
}
2 changes: 1 addition & 1 deletion samples/TestApp/TestApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<Compile Include="Common\Utility.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services\PaymentAccountCreate.cs" />
<Compile Include="Transaction\CreditCardSale.cs" />
</ItemGroup>
<ItemGroup>
Expand All @@ -62,7 +63,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Reporting\" />
<Folder Include="Services\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down

0 comments on commit 61407a1

Please sign in to comment.