making pay, & refactoring

This commit is contained in:
2017-05-05 23:37:07 +02:00
parent d590df1c92
commit 5bbe8bdfbd
34 changed files with 617 additions and 230 deletions

View File

@ -1,24 +1,35 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ViewModels.Manage
{
public class DoDirectCreditViewModel {
[Required]
public string PaymentType  { get; set;}
[Required]
public string PayerName  { get; set;}
[Required]
public string FirstName  { get; set;}
[Required]
public string LastName  { get; set;}
[Required]
public string CreditCardNumber  { get; set;}
public string CreditCardType  { get; set;}
public string Cvv2Number  { get; set;}
public string CardExpiryDate  { get; set;}
public string IpnNotificationUrl { get; set; }
[Required]
public string Street1 { get; set; }
public string Street2 { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Country { get; set; }
[Required]
public string PostalCode { get; set; }
public string Phone { get; set; }
[Required]
public string CurrencyCode { get; set; }
[Required]
public string Amount { get; set; }
}
}
}

View File

@ -0,0 +1,16 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ViewModels.Manage
{
public class SetAddressViewModel
{
[Required]
public string Street1 { get; set; }
public string Street2 { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Country { get; set; }
[Required]
public string PostalCode { get; set; }
}
}

View File

@ -0,0 +1,26 @@
namespace Yavsc.ViewModels.PayPal
{
public class Amount
{
public string total { get; set; }
public string currency { get; set; } = "EUR";
public class Details
{
public string subtotal { get; set; }
public string shipping { get; set; }
public string tax { get; set; }
public string shipping_discount { get; set; }
}
public Details details;
public class ItemList
{
public Item[] items;
public string description { get; set; }
public string invoice_number { get; set; }
public string custom { get; set; }
}
}
}

View File

@ -0,0 +1,22 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ViewModels.PayPal
{
public class CreatePaymentRequest
{
[Required]
public string intent { get; set; } = "sale"; // sale,
public string experience_profile_id { get; set; }
public class RedirectUrls
{
public string return_url { get; set; } = "";
public string cancel_url { get; set; }
}
public RedirectUrls redirect_urls;
public class Payer
{
public string payment_method { get; set; } = "paypal";
}
Payer payer;
}
}

View File

@ -0,0 +1,14 @@
namespace Yavsc.ViewModels.PayPal
{
public class Item
{
public string quantity { get; set; }
public string name { get; set; }
public string price { get; set; }
public string currency { get; set; } = "EUR";
public string description { get; set; }
public string tax { get; set; } = "1";
}
}