Skip to content

HostedPaymentRequest

// RB2 Core Connect
namespace CoreConnect.Payments;
public class HostedPaymentRequest
{
public HostedPaymentRequest(
string countryCode,
string merchantReference,
decimal amount,
string currencyCode,
Customer customer,
//IEnumerable<string> allowedPaymentMethods,
string? returnUrl,
IEnumerable<LineItem> lineItems,
string? userIp = null,
string? selectedMethod = null,
string? selectedSubMethod = null,
BillingAddress? billingAddress = null,
ShippingAddress? shippingAddress = null,
string? customerCompanyName = null,
string? customerKvkNumber = null,
string? customerVatNumber = null,
string? orderId = null,
string? languageCode = null,
object? metadata = null,
string? sequenceType = null,
string? mandateId = null)
{
CountryCode = countryCode;
MerchantReference = merchantReference;
Amount = amount;
CurrencyCode = currencyCode;
CustomerData = customer;
//AllowedPaymentMethods = allowedPaymentMethods;
ReturnUrl = returnUrl;
LineItems = lineItems;
UserIp = userIp;
SelectedMethod = selectedMethod;
SelectedSubMethod = selectedSubMethod;
BillingAddress = billingAddress;
ShippingAddress = shippingAddress;
CustomerCompanyName = customerCompanyName;
CustomerKvkNumber = customerKvkNumber;
CustomerVatNumber = customerVatNumber;
OrderId = orderId;
CustomerLanguageCode = languageCode;
Metadata = metadata;
SequenceType = sequenceType;
MandateId = mandateId;
}
public string CountryCode { get; }
public string? MerchantReference { get; }
public decimal Amount { get; }
public string CurrencyCode { get; }
public string? ReturnUrl { get; }
public Customer CustomerData { get; }
//public IEnumerable<string>? AllowedPaymentMethods { get; }
public bool? StorePaymentMethod { get; }
public object? Metadata { get; set; }
public string? SequenceType { get; set; }
public string? MandateId { get; set; }
public class Customer
{
public Customer(
string id,
string email,
string firstName,
string lastName,
string phone,
string? locale)
{
Id = id;
Email = email;
FirstName = firstName;
LastName = lastName;
Phone = phone;
Locale = locale;
}
public string? Id { get; }
public string Email { get; }
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string? Phone { get; set; }
public string? Locale { get; set; }
}
public IEnumerable<LineItem> LineItems { get; set; }
public string? UserIp { get; }
public string? SelectedMethod { get; }
public string? SelectedSubMethod { get; }
public string? OrderId { get; set; }
public BillingAddress? BillingAddress { get; }
public ShippingAddress? ShippingAddress { get; }
public string? CustomerCompanyName { get; }
public string? CustomerKvkNumber { get; }
public string? CustomerVatNumber { get; }
public string? CustomerLanguageCode { get; }
public class LineItem
{
public required string Id { get; set; }
public string? ImageUrl { get; set; }
public string? ProductUrl { get; set; }
public string? ItemCategory { get; set; }
public int Quantity { get; set; }
public decimal PriceInclTax { get; set; }
public decimal? PriceExclTax { get; set; }
public string? Description { get; set; }
public decimal? TaxAmount { get; set; }
public decimal? TaxPercentage { get; set; }
public ProductType? Type { get; set; }
}
}
public enum ProductType
{
Article,
Shipping,
Handling,
Discount,
}