<commit_before>﻿/*
Copyright (c) 2014, Fox Internet Programming, www.foxip.net
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text.RegularExpressions;
using System.Configuration;

namespace Mollie.Api
{

	#region Enums
	/// <summary>
	/// Payment method
	/// </summary>
	public enum Method
	{
		ideal,
		creditcard,
		mistercash,
		sofort,
		banktransfer,
		bitcoin,
		paypal,
		paysafecard,
	}	
	/// <summary>
	/// Payment status
	/// </summary>
	public enum Status
	{
		/// <summary>
		/// The payment has been created, but no other status has been reached yet.
		/// </summary>
		open,

		/// <summary>
		/// Your customer has cancelled the payment.
		/// </summary>
		cancelled,

		/// <summary>
		/// The payment has been started but not yet complete.
		/// </summary>
		pending,

		/// <summary>
		/// The payment has been paid for.
		/// </summary>
		paid,

		/// <summary>
		/// The payment has been paid for and we have transferred the sum to your bank account.
		/// </summary>
		paidout,

		/// <summary>
		/// The payment has been refunded.
		/// </summary>
		refunded,

		/// <summary>
		/// The payment has expired, for example, your customer has closed the payment screen.
		/// </summary>
		expired,
	}
	#endregion

	#region Plain objects
	public class Payment
	{
		/// <summary>
		/// (Required) The exact amount you want to charge your buyer in Euro's. If you want to charge € 99,95 provide 99.95 as the value.
		/// </summary>
		public decimal amount { get; set; }
		
		/// <summary>
		/// (Required) The description for this payment. This will be shown to your buyer in our payment screens and on their bank statement if the payment method supports that.
		/// </summary>
		public string description { get; set; }

		/// <summary>
		/// (Required) The URL that you want us to send your buyer to after he completes the payment. It's important to include some kind of unique identifier to this URL - like an order ID - so that you can directly show the right screen to your buyer.
		/// </summary>
		public string redirectUrl { get; set; }

		/// <summary>
		/// (Optional) Use this parameter to directly select a payment method to use. Your buyer will then skip the payment method selection screen and will be sent directly to the payment method.
		/// </summary>
		[JsonConverter(typeof(StringEnumConverter))]
		public Method? method { get; set; }

		/// <summary>
		/// (Optional) Use this parameter to store your own custom parameters with the payment. When you retrieve the payment details, you'll get these custom parameters back as well. You can provide around 1 KB of data.
		/// </summary>
		public string metadata { get; set; }

		/// <summary>
		/// (Required) The URL that you want us to send your buyer to after he completes the payment. It's important to include some kind of unique identifier to this URL - like an order ID - so that you can directly show the right screen to your buyer.
		/// </summary>
		public string webhookUrl { get; set; }

		/// <summary>
		/// (Optional) If you pass a valid URL as this parameter, we will use this URL as the web hook instead of the web hook that is set in the web site profile.
		/// </summary>
		public string locale { get; set; }

		//(Optional) Creditcard and/or paypal parameters. Countries must be specified in ISO 3166-1 alpha-2 format.
		public string billingCity { get; set; }
		public string billingRegion { get; set; }
		public string billingPostal { get; set; }
		public string billingCountry { get; set; }
		public string shippingAddress { get; set; }
		public string shippingCity { get; set; }
		public string shippingRegion { get; set; }
		public string shippingPostal { get; set; }
		public string shippingCountry { get; set; }

		/// <summary>
		/// (Optional) Bank transfer parameter: Email address of the customer where he/she will receive the bank transfer details.
		/// </summary>
		public string billingEmail { get; set; }

		/// <summary>
		/// (Optional) Date that the payment automatically expires. Format YYYY-MM-DD.
		/// </summary>
		public string dueDate { get; set; }

		/// <summary>
		/// (Optional) Paysafecard parameter. Used for identifying the customer. For example the remote IP address of the customer.
		/// </summary>
		public string customerReference { get; set; }

		/// <summary>
		/// (Optional) iDEAL issuer id. The id could for example be ideal_INGBNL2A. The returned paymentUrl will then directly point to the ING web site.
		/// </summary><commit_msg>Add billingAddress<commit_after>﻿/*
Copyright (c) 2014, Fox Internet Programming, www.foxip.net
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text.RegularExpressions;
using System.Configuration;

namespace Mollie.Api
{

	#region Enums
	/// <summary>
	/// Payment method
	/// </summary>
	public enum Method
	{
		ideal,
		creditcard,
		mistercash,
		sofort,
		banktransfer,
		bitcoin,
		paypal,
		paysafecard,
	}	
	/// <summary>
	/// Payment status
	/// </summary>
	public enum Status
	{
		/// <summary>
		/// The payment has been created, but no other status has been reached yet.
		/// </summary>
		open,

		/// <summary>
		/// Your customer has cancelled the payment.
		/// </summary>
		cancelled,

		/// <summary>
		/// The payment has been started but not yet complete.
		/// </summary>
		pending,

		/// <summary>
		/// The payment has been paid for.
		/// </summary>
		paid,

		/// <summary>
		/// The payment has been paid for and we have transferred the sum to your bank account.
		/// </summary>
		paidout,

		/// <summary>
		/// The payment has been refunded.
		/// </summary>
		refunded,

		/// <summary>
		/// The payment has expired, for example, your customer has closed the payment screen.
		/// </summary>
		expired,
	}
	#endregion

	#region Plain objects
	public class Payment
	{
		/// <summary>
		/// (Required) The exact amount you want to charge your buyer in Euro's. If you want to charge € 99,95 provide 99.95 as the value.
		/// </summary>
		public decimal amount { get; set; }
		
		/// <summary>
		/// (Required) The description for this payment. This will be shown to your buyer in our payment screens and on their bank statement if the payment method supports that.
		/// </summary>
		public string description { get; set; }

		/// <summary>
		/// (Required) The URL that you want us to send your buyer to after he completes the payment. It's important to include some kind of unique identifier to this URL - like an order ID - so that you can directly show the right screen to your buyer.
		/// </summary>
		public string redirectUrl { get; set; }

		/// <summary>
		/// (Optional) Use this parameter to directly select a payment method to use. Your buyer will then skip the payment method selection screen and will be sent directly to the payment method.
		/// </summary>
		[JsonConverter(typeof(StringEnumConverter))]
		public Method? method { get; set; }

		/// <summary>
		/// (Optional) Use this parameter to store your own custom parameters with the payment. When you retrieve the payment details, you'll get these custom parameters back as well. You can provide around 1 KB of data.
		/// </summary>
		public string metadata { get; set; }

		/// <summary>
		/// (Required) The URL that you want us to send your buyer to after he completes the payment. It's important to include some kind of unique identifier to this URL - like an order ID - so that you can directly show the right screen to your buyer.
		/// </summary>
		public string webhookUrl { get; set; }

		/// <summary>
		/// (Optional) If you pass a valid URL as this parameter, we will use this URL as the web hook instead of the web hook that is set in the web site profile.
        /// Valid values: nl, fr, de, en, es
		/// </summary>
		public string locale { get; set; }

		//(Optional) Creditcard and/or paypal parameters. Countries must be specified in ISO 3166-1 alpha-2 format.
		public string billingAddress { get; set; }
		public string billingCity { get; set; }
		public string billingRegion { get; set; }
		public string billingPostal { get; set; }
		public string billingCountry { get; set; }
		public string shippingAddress { get; set; }
		public string shippingCity { get; set; }
		public string shippingRegion { get; set; }
		public string shippingPostal { get; set; }
		public string shippingCountry { get; set; }

		/// <summary>
		/// (Optional) Bank transfer parameter: Email address of the customer where he/she will receive the bank transfer details.
		/// </summary>
		public string billingEmail { get; set; }

		/// <summary>
		/// (Optional) Date that the payment automatically expires. Format YYYY-MM-DD.
		/// </summary>
		public string dueDate { get; set; }

		/// <summary>
		/// (Optional) Paysafecard parameter. Used for identifying the customer. For example the remote IP address of the customer.
		/// </summary>
		public string customerReference { get; set; }

		/// <summary>
		/// (Optional) iDEAL issuer id. The id could for example be ideal_INGBNL2A. The returned paymentUrl will then directly point to the ING web site.
		/// </summary>
{'fraction_non_alphanumeric': 0.09228942234286198, 'fraction_numerical': 0.0033929934684875734, 'mean_word_length': 3.2349137931034484, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 83, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4831999', 'n_tokens_mistral': 3482, 'n_tokens_neox': 3099, 'n_words': 1552}