Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CreateTokenRequest" /> class.
 /// </summary>
 /// <param name="Authority">Authority (required).</param>
 public CreateTokenRequest(AuthorityRequest AuthorityRequest = default(AuthorityRequest))
 {
     // to ensure "Authority" is required (not null)
     if (Authority == null)
     {
         throw new InvalidDataException("Authority is a required property for CreateTokenRequest and cannot be null");
     }
     else
     {
         this.Authority = Authority;
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CreateChargeRequest" /> class.
 /// </summary>
 /// <param name="Authority">Authority (required).</param>
 /// <param name="Reference">The reference for this charge (unique payment reference in your store).</param>
 /// <param name="Amount">The amount of the charge (required).</param>
 /// <param name="Currency">The currency (required).</param>
 /// <param name="Capture">If true this will be a direct capture, pass false to perform an authorisation only (default to true).</param>
 /// <param name="Order">Order.</param>
 /// <param name="Metadata">Metadata.</param>
 public CreateChargeRequest(AuthorityRequest Authority = default(AuthorityRequest), string Reference = default(string), decimal?Amount = default(decimal?), CurrencyEnum?Currency = default(CurrencyEnum?), bool?Capture = true, ChargeOrder Order = default(ChargeOrder), Object Metadata = default(Object))
 {
     // to ensure "Authority" is required (not null)
     if (Authority == null)
     {
         throw new InvalidDataException("Authority is a required property for CreateChargeRequest and cannot be null");
     }
     else
     {
         this.Authority = Authority;
     }
     // to ensure "Amount" is required (not null)
     if (Amount == null)
     {
         throw new InvalidDataException("Amount is a required property for CreateChargeRequest and cannot be null");
     }
     else
     {
         this.Amount = Amount;
     }
     // to ensure "Currency" is required (not null)
     if (Currency == null)
     {
         throw new InvalidDataException("Currency is a required property for CreateChargeRequest and cannot be null");
     }
     else
     {
         this.Currency = Currency;
     }
     this.Reference = Reference;
     // use default value if no "Capture" provided
     if (Capture == null)
     {
         this.Capture = true;
     }
     else
     {
         this.Capture = Capture;
     }
     this.Order    = Order;
     this.Metadata = Metadata;
 }