PageRenderTime 44ms CodeModel.GetById 33ms RepoModel.GetById 12ms app.codeStats 1ms

/PayPalInvoiceSDK/Invoice/PayPalInvoiceModel.cs

https://github.com/josearis/invoice-sdk-dotnet
C# | 8249 lines | 5894 code | 915 blank | 1440 comment | 839 complexity | 8779ac375f46d1b301ccc77378a52e23 MD5 | raw file
Possible License(s): BitTorrent-1.0
  1. /*
  2. * Stub objects for Invoice
  3. * AUTO_GENERATED_CODE
  4. */
  5. using System;
  6. using System.Collections;
  7. using System.Collections.Generic;
  8. using System.ComponentModel;
  9. using System.Globalization;
  10. using System.Text;
  11. using System.Text.RegularExpressions;
  12. using System.Web;
  13. using System.Xml;
  14. using PayPal.Util;
  15. namespace PayPal.Invoice.Model
  16. {
  17. /// <summary>
  18. /// Utility class for Enums with descriptions
  19. /// </summary>
  20. public static class EnumUtils
  21. {
  22. /// <summary>
  23. /// Get description for a give enum value
  24. /// </summary>
  25. public static string GetDescription(Enum value)
  26. {
  27. string description = "";
  28. DescriptionAttribute[] attributes = (DescriptionAttribute[])value.GetType().GetField(value.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), false);
  29. if (attributes.Length > 0)
  30. {
  31. description= attributes[0].Description;
  32. }
  33. return description;
  34. }
  35. /// <summary>
  36. /// Convert a string to an enum object
  37. /// </summary>
  38. public static object GetValue(string value,Type enumType)
  39. {
  40. string[] names = Enum.GetNames(enumType);
  41. foreach(string name in names)
  42. {
  43. if (GetDescription((Enum)Enum.Parse(enumType, name)).Equals(value))
  44. {
  45. return Enum.Parse(enumType, name);
  46. }
  47. }
  48. return null;
  49. }
  50. }
  51. /// <summary>
  52. ///
  53. /// </summary>
  54. public partial class BaseAddress {
  55. // Default US culture info
  56. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  57. /// <summary>
  58. ///
  59. /// </summary>
  60. private string line1Field;
  61. public string line1
  62. {
  63. get
  64. {
  65. return this.line1Field;
  66. }
  67. set
  68. {
  69. this.line1Field = value;
  70. }
  71. }
  72. /// <summary>
  73. ///
  74. /// </summary>
  75. private string line2Field;
  76. public string line2
  77. {
  78. get
  79. {
  80. return this.line2Field;
  81. }
  82. set
  83. {
  84. this.line2Field = value;
  85. }
  86. }
  87. /// <summary>
  88. ///
  89. /// </summary>
  90. private string cityField;
  91. public string city
  92. {
  93. get
  94. {
  95. return this.cityField;
  96. }
  97. set
  98. {
  99. this.cityField = value;
  100. }
  101. }
  102. /// <summary>
  103. ///
  104. /// </summary>
  105. private string stateField;
  106. public string state
  107. {
  108. get
  109. {
  110. return this.stateField;
  111. }
  112. set
  113. {
  114. this.stateField = value;
  115. }
  116. }
  117. /// <summary>
  118. ///
  119. /// </summary>
  120. private string postalCodeField;
  121. public string postalCode
  122. {
  123. get
  124. {
  125. return this.postalCodeField;
  126. }
  127. set
  128. {
  129. this.postalCodeField = value;
  130. }
  131. }
  132. /// <summary>
  133. ///
  134. /// </summary>
  135. private string countryCodeField;
  136. public string countryCode
  137. {
  138. get
  139. {
  140. return this.countryCodeField;
  141. }
  142. set
  143. {
  144. this.countryCodeField = value;
  145. }
  146. }
  147. /// <summary>
  148. ///
  149. /// </summary>
  150. private string typeField;
  151. public string type
  152. {
  153. get
  154. {
  155. return this.typeField;
  156. }
  157. set
  158. {
  159. this.typeField = value;
  160. }
  161. }
  162. /// <summary>
  163. /// Constructor with arguments
  164. /// </summary>
  165. public BaseAddress(string line1, string city, string countryCode)
  166. {
  167. this.line1 = line1;
  168. this.city = city;
  169. this.countryCode = countryCode;
  170. }
  171. /// <summary>
  172. /// Default Constructor
  173. /// </summary>
  174. public BaseAddress()
  175. {
  176. }
  177. public string ToNVPString(string prefix)
  178. {
  179. StringBuilder sb = new StringBuilder();
  180. if (this.line1 != null)
  181. {
  182. sb.Append(prefix).Append("line1").Append("=").Append(HttpUtility.UrlEncode(this.line1, BaseConstants.ENCODING_FORMAT)).Append("&");
  183. }
  184. if (this.line2 != null)
  185. {
  186. sb.Append(prefix).Append("line2").Append("=").Append(HttpUtility.UrlEncode(this.line2, BaseConstants.ENCODING_FORMAT)).Append("&");
  187. }
  188. if (this.city != null)
  189. {
  190. sb.Append(prefix).Append("city").Append("=").Append(HttpUtility.UrlEncode(this.city, BaseConstants.ENCODING_FORMAT)).Append("&");
  191. }
  192. if (this.state != null)
  193. {
  194. sb.Append(prefix).Append("state").Append("=").Append(HttpUtility.UrlEncode(this.state, BaseConstants.ENCODING_FORMAT)).Append("&");
  195. }
  196. if (this.postalCode != null)
  197. {
  198. sb.Append(prefix).Append("postalCode").Append("=").Append(HttpUtility.UrlEncode(this.postalCode, BaseConstants.ENCODING_FORMAT)).Append("&");
  199. }
  200. if (this.countryCode != null)
  201. {
  202. sb.Append(prefix).Append("countryCode").Append("=").Append(HttpUtility.UrlEncode(this.countryCode, BaseConstants.ENCODING_FORMAT)).Append("&");
  203. }
  204. if (this.type != null)
  205. {
  206. sb.Append(prefix).Append("type").Append("=").Append(HttpUtility.UrlEncode(this.type, BaseConstants.ENCODING_FORMAT)).Append("&");
  207. }
  208. return sb.ToString();
  209. }
  210. /// <summary>
  211. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  212. /// </summary>
  213. /// <param name="map">NVP map as returned by an API call</param>
  214. /// <param name="prefix">NVP prefix for this class in the response</param>
  215. /// <param name="index">For array elements, index of this element in the response</param>
  216. /// <returns>
  217. /// A new BaseAddress object created from the passed in NVP map
  218. /// </returns>
  219. public static BaseAddress CreateInstance(Dictionary<string, string> map, string prefix, int index)
  220. {
  221. BaseAddress baseAddress = null;
  222. string key;
  223. int i = 0;
  224. if(index != -1)
  225. {
  226. if (prefix.Length > 0 && !prefix.EndsWith("."))
  227. {
  228. prefix = prefix + "(" + index + ").";
  229. }
  230. }
  231. else
  232. {
  233. if (prefix.Length > 0 && !prefix.EndsWith("."))
  234. {
  235. prefix = prefix + ".";
  236. }
  237. }
  238. key = prefix + "line1";
  239. if (map.ContainsKey(key))
  240. {
  241. baseAddress = (baseAddress == null) ? new BaseAddress() : baseAddress;
  242. baseAddress.line1 = map[key];
  243. }
  244. key = prefix + "line2";
  245. if (map.ContainsKey(key))
  246. {
  247. baseAddress = (baseAddress == null) ? new BaseAddress() : baseAddress;
  248. baseAddress.line2 = map[key];
  249. }
  250. key = prefix + "city";
  251. if (map.ContainsKey(key))
  252. {
  253. baseAddress = (baseAddress == null) ? new BaseAddress() : baseAddress;
  254. baseAddress.city = map[key];
  255. }
  256. key = prefix + "state";
  257. if (map.ContainsKey(key))
  258. {
  259. baseAddress = (baseAddress == null) ? new BaseAddress() : baseAddress;
  260. baseAddress.state = map[key];
  261. }
  262. key = prefix + "postalCode";
  263. if (map.ContainsKey(key))
  264. {
  265. baseAddress = (baseAddress == null) ? new BaseAddress() : baseAddress;
  266. baseAddress.postalCode = map[key];
  267. }
  268. key = prefix + "countryCode";
  269. if (map.ContainsKey(key))
  270. {
  271. baseAddress = (baseAddress == null) ? new BaseAddress() : baseAddress;
  272. baseAddress.countryCode = map[key];
  273. }
  274. key = prefix + "type";
  275. if (map.ContainsKey(key))
  276. {
  277. baseAddress = (baseAddress == null) ? new BaseAddress() : baseAddress;
  278. baseAddress.type = map[key];
  279. }
  280. return baseAddress;
  281. }
  282. }
  283. /// <summary>
  284. /// This type contains the detailed error information resulting
  285. /// from the service operation.
  286. /// </summary>
  287. public partial class ErrorData {
  288. // Default US culture info
  289. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  290. /// <summary>
  291. ///
  292. /// </summary>
  293. private long? errorIdField;
  294. public long? errorId
  295. {
  296. get
  297. {
  298. return this.errorIdField;
  299. }
  300. set
  301. {
  302. this.errorIdField = value;
  303. }
  304. }
  305. /// <summary>
  306. ///
  307. /// </summary>
  308. private string domainField;
  309. public string domain
  310. {
  311. get
  312. {
  313. return this.domainField;
  314. }
  315. set
  316. {
  317. this.domainField = value;
  318. }
  319. }
  320. /// <summary>
  321. ///
  322. /// </summary>
  323. private string subdomainField;
  324. public string subdomain
  325. {
  326. get
  327. {
  328. return this.subdomainField;
  329. }
  330. set
  331. {
  332. this.subdomainField = value;
  333. }
  334. }
  335. /// <summary>
  336. ///
  337. /// </summary>
  338. private ErrorSeverity? severityField;
  339. public ErrorSeverity? severity
  340. {
  341. get
  342. {
  343. return this.severityField;
  344. }
  345. set
  346. {
  347. this.severityField = value;
  348. }
  349. }
  350. /// <summary>
  351. ///
  352. /// </summary>
  353. private ErrorCategory? categoryField;
  354. public ErrorCategory? category
  355. {
  356. get
  357. {
  358. return this.categoryField;
  359. }
  360. set
  361. {
  362. this.categoryField = value;
  363. }
  364. }
  365. /// <summary>
  366. ///
  367. /// </summary>
  368. private string messageField;
  369. public string message
  370. {
  371. get
  372. {
  373. return this.messageField;
  374. }
  375. set
  376. {
  377. this.messageField = value;
  378. }
  379. }
  380. /// <summary>
  381. ///
  382. /// </summary>
  383. private string exceptionIdField;
  384. public string exceptionId
  385. {
  386. get
  387. {
  388. return this.exceptionIdField;
  389. }
  390. set
  391. {
  392. this.exceptionIdField = value;
  393. }
  394. }
  395. /// <summary>
  396. ///
  397. /// </summary>
  398. private List<ErrorParameter> parameterField = new List<ErrorParameter>();
  399. public List<ErrorParameter> parameter
  400. {
  401. get
  402. {
  403. return this.parameterField;
  404. }
  405. set
  406. {
  407. this.parameterField = value;
  408. }
  409. }
  410. /// <summary>
  411. /// Default Constructor
  412. /// </summary>
  413. public ErrorData()
  414. {
  415. }
  416. /// <summary>
  417. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  418. /// </summary>
  419. /// <param name="map">NVP map as returned by an API call</param>
  420. /// <param name="prefix">NVP prefix for this class in the response</param>
  421. /// <param name="index">For array elements, index of this element in the response</param>
  422. /// <returns>
  423. /// A new ErrorData object created from the passed in NVP map
  424. /// </returns>
  425. public static ErrorData CreateInstance(Dictionary<string, string> map, string prefix, int index)
  426. {
  427. ErrorData errorData = null;
  428. string key;
  429. int i = 0;
  430. if(index != -1)
  431. {
  432. if (prefix.Length > 0 && !prefix.EndsWith("."))
  433. {
  434. prefix = prefix + "(" + index + ").";
  435. }
  436. }
  437. else
  438. {
  439. if (prefix.Length > 0 && !prefix.EndsWith("."))
  440. {
  441. prefix = prefix + ".";
  442. }
  443. }
  444. key = prefix + "errorId";
  445. if (map.ContainsKey(key))
  446. {
  447. errorData = (errorData == null) ? new ErrorData() : errorData;
  448. errorData.errorId = System.Convert.ToInt64(map[key], DefaultCulture);
  449. }
  450. key = prefix + "domain";
  451. if (map.ContainsKey(key))
  452. {
  453. errorData = (errorData == null) ? new ErrorData() : errorData;
  454. errorData.domain = map[key];
  455. }
  456. key = prefix + "subdomain";
  457. if (map.ContainsKey(key))
  458. {
  459. errorData = (errorData == null) ? new ErrorData() : errorData;
  460. errorData.subdomain = map[key];
  461. }
  462. key = prefix + "severity";
  463. if (map.ContainsKey(key))
  464. {
  465. errorData = (errorData == null) ? new ErrorData() : errorData;
  466. errorData.severity = (ErrorSeverity)EnumUtils.GetValue(map[key],typeof(ErrorSeverity));
  467. }
  468. key = prefix + "category";
  469. if (map.ContainsKey(key))
  470. {
  471. errorData = (errorData == null) ? new ErrorData() : errorData;
  472. errorData.category = (ErrorCategory)EnumUtils.GetValue(map[key],typeof(ErrorCategory));
  473. }
  474. key = prefix + "message";
  475. if (map.ContainsKey(key))
  476. {
  477. errorData = (errorData == null) ? new ErrorData() : errorData;
  478. errorData.message = map[key];
  479. }
  480. key = prefix + "exceptionId";
  481. if (map.ContainsKey(key))
  482. {
  483. errorData = (errorData == null) ? new ErrorData() : errorData;
  484. errorData.exceptionId = map[key];
  485. }
  486. i = 0;
  487. while(true)
  488. {
  489. ErrorParameter parameter = ErrorParameter.CreateInstance(map, prefix + "parameter", i);
  490. if (parameter != null)
  491. {
  492. errorData = (errorData == null) ? new ErrorData() : errorData;
  493. errorData.parameter.Add(parameter);
  494. i++;
  495. }
  496. else
  497. {
  498. break;
  499. }
  500. }
  501. return errorData;
  502. }
  503. }
  504. /// <summary>
  505. ///
  506. /// </summary>
  507. public partial class ErrorParameter {
  508. // Default US culture info
  509. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  510. /// <summary>
  511. ///
  512. /// </summary>
  513. private string nameField;
  514. public string name
  515. {
  516. get
  517. {
  518. return this.nameField;
  519. }
  520. set
  521. {
  522. this.nameField = value;
  523. }
  524. }
  525. /// <summary>
  526. ///
  527. /// </summary>
  528. private string valueField;
  529. public string value
  530. {
  531. get
  532. {
  533. return this.valueField;
  534. }
  535. set
  536. {
  537. this.valueField = value;
  538. }
  539. }
  540. /// <summary>
  541. /// Default Constructor
  542. /// </summary>
  543. public ErrorParameter()
  544. {
  545. }
  546. /// <summary>
  547. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  548. /// </summary>
  549. /// <param name="map">NVP map as returned by an API call</param>
  550. /// <param name="prefix">NVP prefix for this class in the response</param>
  551. /// <param name="index">For array elements, index of this element in the response</param>
  552. /// <returns>
  553. /// A new ErrorParameter object created from the passed in NVP map
  554. /// </returns>
  555. public static ErrorParameter CreateInstance(Dictionary<string, string> map, string prefix, int index)
  556. {
  557. ErrorParameter errorParameter = null;
  558. string key;
  559. int i = 0;
  560. if(index != -1)
  561. {
  562. if (prefix.Length > 0 && !prefix.EndsWith("."))
  563. {
  564. prefix = prefix + "(" + index + ").";
  565. }
  566. }
  567. else
  568. {
  569. if (prefix.Length > 0 && !prefix.EndsWith("."))
  570. {
  571. prefix = prefix + ".";
  572. }
  573. }
  574. key = prefix + "name";
  575. if (map.ContainsKey(key))
  576. {
  577. errorParameter = (errorParameter == null) ? new ErrorParameter() : errorParameter;
  578. errorParameter.name = map[key];
  579. }
  580. key = prefix.Substring(0, prefix.Length - 1);
  581. if (map.ContainsKey(key))
  582. {
  583. errorParameter = (errorParameter == null) ? new ErrorParameter() : errorParameter;
  584. errorParameter.value = map[key];
  585. }
  586. return errorParameter;
  587. }
  588. }
  589. /// <summary>
  590. /// This specifies a fault, encapsulating error data, with
  591. /// specific error codes.
  592. /// </summary>
  593. public partial class FaultMessage {
  594. // Default US culture info
  595. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  596. /// <summary>
  597. ///
  598. /// </summary>
  599. private ResponseEnvelope responseEnvelopeField;
  600. public ResponseEnvelope responseEnvelope
  601. {
  602. get
  603. {
  604. return this.responseEnvelopeField;
  605. }
  606. set
  607. {
  608. this.responseEnvelopeField = value;
  609. }
  610. }
  611. /// <summary>
  612. ///
  613. /// </summary>
  614. private List<ErrorData> errorField = new List<ErrorData>();
  615. public List<ErrorData> error
  616. {
  617. get
  618. {
  619. return this.errorField;
  620. }
  621. set
  622. {
  623. this.errorField = value;
  624. }
  625. }
  626. /// <summary>
  627. /// Default Constructor
  628. /// </summary>
  629. public FaultMessage()
  630. {
  631. }
  632. /// <summary>
  633. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  634. /// </summary>
  635. /// <param name="map">NVP map as returned by an API call</param>
  636. /// <param name="prefix">NVP prefix for this class in the response</param>
  637. /// <param name="index">For array elements, index of this element in the response</param>
  638. /// <returns>
  639. /// A new FaultMessage object created from the passed in NVP map
  640. /// </returns>
  641. public static FaultMessage CreateInstance(Dictionary<string, string> map, string prefix, int index)
  642. {
  643. FaultMessage faultMessage = null;
  644. string key;
  645. int i = 0;
  646. if(index != -1)
  647. {
  648. if (prefix.Length > 0 && !prefix.EndsWith("."))
  649. {
  650. prefix = prefix + "(" + index + ").";
  651. }
  652. }
  653. else
  654. {
  655. if (prefix.Length > 0 && !prefix.EndsWith("."))
  656. {
  657. prefix = prefix + ".";
  658. }
  659. }
  660. ResponseEnvelope responseEnvelope = ResponseEnvelope.CreateInstance(map, prefix + "responseEnvelope", -1);
  661. if (responseEnvelope != null)
  662. {
  663. faultMessage = (faultMessage == null) ? new FaultMessage() : faultMessage;
  664. faultMessage.responseEnvelope = responseEnvelope;
  665. }
  666. i = 0;
  667. while(true)
  668. {
  669. ErrorData error = ErrorData.CreateInstance(map, prefix + "error", i);
  670. if (error != null)
  671. {
  672. faultMessage = (faultMessage == null) ? new FaultMessage() : faultMessage;
  673. faultMessage.error.Add(error);
  674. i++;
  675. }
  676. else
  677. {
  678. break;
  679. }
  680. }
  681. return faultMessage;
  682. }
  683. }
  684. /// <summary>
  685. /// This specifies the list of parameters with every request to
  686. /// the service.
  687. /// </summary>
  688. public partial class RequestEnvelope {
  689. // Default US culture info
  690. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  691. /// <summary>
  692. ///
  693. /// </summary>
  694. private DetailLevelCode? detailLevelField;
  695. public DetailLevelCode? detailLevel
  696. {
  697. get
  698. {
  699. return this.detailLevelField;
  700. }
  701. set
  702. {
  703. this.detailLevelField = value;
  704. }
  705. }
  706. /// <summary>
  707. ///
  708. /// </summary>
  709. private string errorLanguageField;
  710. public string errorLanguage
  711. {
  712. get
  713. {
  714. return this.errorLanguageField;
  715. }
  716. set
  717. {
  718. this.errorLanguageField = value;
  719. }
  720. }
  721. /// <summary>
  722. /// Default Constructor
  723. /// </summary>
  724. public RequestEnvelope()
  725. {
  726. }
  727. public string ToNVPString(string prefix)
  728. {
  729. StringBuilder sb = new StringBuilder();
  730. if (this.detailLevel != null)
  731. {
  732. sb.Append(prefix).Append("detailLevel").Append("=").Append(EnumUtils.GetDescription(this.detailLevel));
  733. sb.Append("&");
  734. }
  735. if (this.errorLanguage != null)
  736. {
  737. sb.Append(prefix).Append("errorLanguage").Append("=").Append(HttpUtility.UrlEncode(this.errorLanguage, BaseConstants.ENCODING_FORMAT)).Append("&");
  738. }
  739. return sb.ToString();
  740. }
  741. }
  742. /// <summary>
  743. /// This specifies a list of parameters with every response from
  744. /// a service.
  745. /// </summary>
  746. public partial class ResponseEnvelope {
  747. // Default US culture info
  748. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  749. /// <summary>
  750. ///
  751. /// </summary>
  752. private string timestampField;
  753. public string timestamp
  754. {
  755. get
  756. {
  757. return this.timestampField;
  758. }
  759. set
  760. {
  761. this.timestampField = value;
  762. }
  763. }
  764. /// <summary>
  765. ///
  766. /// </summary>
  767. private AckCode? ackField;
  768. public AckCode? ack
  769. {
  770. get
  771. {
  772. return this.ackField;
  773. }
  774. set
  775. {
  776. this.ackField = value;
  777. }
  778. }
  779. /// <summary>
  780. ///
  781. /// </summary>
  782. private string correlationIdField;
  783. public string correlationId
  784. {
  785. get
  786. {
  787. return this.correlationIdField;
  788. }
  789. set
  790. {
  791. this.correlationIdField = value;
  792. }
  793. }
  794. /// <summary>
  795. ///
  796. /// </summary>
  797. private string buildField;
  798. public string build
  799. {
  800. get
  801. {
  802. return this.buildField;
  803. }
  804. set
  805. {
  806. this.buildField = value;
  807. }
  808. }
  809. /// <summary>
  810. /// Default Constructor
  811. /// </summary>
  812. public ResponseEnvelope()
  813. {
  814. }
  815. /// <summary>
  816. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  817. /// </summary>
  818. /// <param name="map">NVP map as returned by an API call</param>
  819. /// <param name="prefix">NVP prefix for this class in the response</param>
  820. /// <param name="index">For array elements, index of this element in the response</param>
  821. /// <returns>
  822. /// A new ResponseEnvelope object created from the passed in NVP map
  823. /// </returns>
  824. public static ResponseEnvelope CreateInstance(Dictionary<string, string> map, string prefix, int index)
  825. {
  826. ResponseEnvelope responseEnvelope = null;
  827. string key;
  828. int i = 0;
  829. if(index != -1)
  830. {
  831. if (prefix.Length > 0 && !prefix.EndsWith("."))
  832. {
  833. prefix = prefix + "(" + index + ").";
  834. }
  835. }
  836. else
  837. {
  838. if (prefix.Length > 0 && !prefix.EndsWith("."))
  839. {
  840. prefix = prefix + ".";
  841. }
  842. }
  843. key = prefix + "timestamp";
  844. if (map.ContainsKey(key))
  845. {
  846. responseEnvelope = (responseEnvelope == null) ? new ResponseEnvelope() : responseEnvelope;
  847. responseEnvelope.timestamp = map[key];
  848. }
  849. key = prefix + "ack";
  850. if (map.ContainsKey(key))
  851. {
  852. responseEnvelope = (responseEnvelope == null) ? new ResponseEnvelope() : responseEnvelope;
  853. responseEnvelope.ack = (AckCode)EnumUtils.GetValue(map[key],typeof(AckCode));
  854. }
  855. key = prefix + "correlationId";
  856. if (map.ContainsKey(key))
  857. {
  858. responseEnvelope = (responseEnvelope == null) ? new ResponseEnvelope() : responseEnvelope;
  859. responseEnvelope.correlationId = map[key];
  860. }
  861. key = prefix + "build";
  862. if (map.ContainsKey(key))
  863. {
  864. responseEnvelope = (responseEnvelope == null) ? new ResponseEnvelope() : responseEnvelope;
  865. responseEnvelope.build = map[key];
  866. }
  867. return responseEnvelope;
  868. }
  869. }
  870. /// <summary>
  871. /// AckCodeType This code identifies the
  872. /// acknowledgment code types that could be used to
  873. /// communicate the status of processing a (request)
  874. /// message to an application. This code would be
  875. /// used as part of a response message that contains
  876. /// an application level acknowledgment element.
  877. ///
  878. /// </summary>
  879. [Serializable]
  880. public enum AckCode {
  881. [Description("Success")]SUCCESS,
  882. [Description("Failure")]FAILURE,
  883. [Description("Warning")]WARNING,
  884. [Description("SuccessWithWarning")]SUCCESSWITHWARNING,
  885. [Description("FailureWithWarning")]FAILUREWITHWARNING
  886. }
  887. /// <summary>
  888. /// DetailLevelCodeType
  889. ///
  890. /// </summary>
  891. [Serializable]
  892. public enum DetailLevelCode {
  893. [Description("ReturnAll")]RETURNALL
  894. }
  895. /// <summary>
  896. ///
  897. /// </summary>
  898. [Serializable]
  899. public enum ErrorCategory {
  900. [Description("System")]SYSTEM,
  901. [Description("Application")]APPLICATION,
  902. [Description("Request")]REQUEST
  903. }
  904. /// <summary>
  905. ///
  906. /// </summary>
  907. [Serializable]
  908. public enum ErrorSeverity {
  909. [Description("Error")]ERROR,
  910. [Description("Warning")]WARNING
  911. }
  912. /// <summary>
  913. /// Specifies the payment terms for this invoice.
  914. ///
  915. /// </summary>
  916. [Serializable]
  917. public enum PaymentTermsType {
  918. [Description("NoDueDate")]NODUEDATE,
  919. [Description("DueOnReceipt")]DUEONRECEIPT,
  920. [Description("DueOnDateSpecified")]DUEONDATESPECIFIED,
  921. [Description("Net10")]NET1,
  922. [Description("Net15")]NET2,
  923. [Description("Net30")]NET3,
  924. [Description("Net45")]NET4
  925. }
  926. /// <summary>
  927. /// Specifies the payment methods that can be used to mark an
  928. /// invoice as paid.
  929. ///
  930. /// </summary>
  931. [Serializable]
  932. public enum PaymentMethodsType {
  933. [Description("BankTransfer")]BANKTRANSFER,
  934. [Description("Cash")]CASH,
  935. [Description("Check")]CHECK,
  936. [Description("CreditCard")]CREDITCARD,
  937. [Description("DebitCard")]DEBITCARD,
  938. [Description("Other")]OTHER,
  939. [Description("PayPal")]PAYPAL,
  940. [Description("WireTransfer")]WIRETRANSFER
  941. }
  942. /// <summary>
  943. /// Specifies the invoice status.
  944. ///
  945. /// </summary>
  946. [Serializable]
  947. public enum StatusType {
  948. [Description("Draft")]DRAFT,
  949. [Description("Sent")]SENT,
  950. [Description("Paid")]PAID,
  951. [Description("MarkedAsPaid")]MARKEDASPAID,
  952. [Description("Canceled")]CANCELED,
  953. [Description("Refunded")]REFUNDED,
  954. [Description("PartiallyRefunded")]PARTIALLYREFUNDED,
  955. [Description("MarkedAsRefunded")]MARKEDASREFUNDED
  956. }
  957. /// <summary>
  958. /// Specifies the merchant or payer.
  959. ///
  960. /// </summary>
  961. [Serializable]
  962. public enum OriginType {
  963. [Description("Web")]WEB,
  964. [Description("API")]API
  965. }
  966. /// <summary>
  967. /// Specifies the merchant or payer.
  968. ///
  969. /// </summary>
  970. [Serializable]
  971. public enum ActorType {
  972. [Description("Merchant")]MERCHANT,
  973. [Description("Payer")]PAYER
  974. }
  975. /// <summary>
  976. /// Contact information for a company participating in the
  977. /// invoicing system.
  978. /// </summary>
  979. public partial class BusinessInfoType {
  980. // Default US culture info
  981. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  982. /// <summary>
  983. ///
  984. /// </summary>
  985. private string firstNameField;
  986. public string firstName
  987. {
  988. get
  989. {
  990. return this.firstNameField;
  991. }
  992. set
  993. {
  994. this.firstNameField = value;
  995. }
  996. }
  997. /// <summary>
  998. ///
  999. /// </summary>
  1000. private string lastNameField;
  1001. public string lastName
  1002. {
  1003. get
  1004. {
  1005. return this.lastNameField;
  1006. }
  1007. set
  1008. {
  1009. this.lastNameField = value;
  1010. }
  1011. }
  1012. /// <summary>
  1013. ///
  1014. /// </summary>
  1015. private string businessNameField;
  1016. public string businessName
  1017. {
  1018. get
  1019. {
  1020. return this.businessNameField;
  1021. }
  1022. set
  1023. {
  1024. this.businessNameField = value;
  1025. }
  1026. }
  1027. /// <summary>
  1028. ///
  1029. /// </summary>
  1030. private string phoneField;
  1031. public string phone
  1032. {
  1033. get
  1034. {
  1035. return this.phoneField;
  1036. }
  1037. set
  1038. {
  1039. this.phoneField = value;
  1040. }
  1041. }
  1042. /// <summary>
  1043. ///
  1044. /// </summary>
  1045. private string faxField;
  1046. public string fax
  1047. {
  1048. get
  1049. {
  1050. return this.faxField;
  1051. }
  1052. set
  1053. {
  1054. this.faxField = value;
  1055. }
  1056. }
  1057. /// <summary>
  1058. ///
  1059. /// </summary>
  1060. private string websiteField;
  1061. public string website
  1062. {
  1063. get
  1064. {
  1065. return this.websiteField;
  1066. }
  1067. set
  1068. {
  1069. this.websiteField = value;
  1070. }
  1071. }
  1072. /// <summary>
  1073. ///
  1074. /// </summary>
  1075. private string languageField;
  1076. public string language
  1077. {
  1078. get
  1079. {
  1080. return this.languageField;
  1081. }
  1082. set
  1083. {
  1084. this.languageField = value;
  1085. }
  1086. }
  1087. /// <summary>
  1088. ///
  1089. /// </summary>
  1090. private string taxIdField;
  1091. public string taxId
  1092. {
  1093. get
  1094. {
  1095. return this.taxIdField;
  1096. }
  1097. set
  1098. {
  1099. this.taxIdField = value;
  1100. }
  1101. }
  1102. /// <summary>
  1103. ///
  1104. /// </summary>
  1105. private string customValueField;
  1106. public string customValue
  1107. {
  1108. get
  1109. {
  1110. return this.customValueField;
  1111. }
  1112. set
  1113. {
  1114. this.customValueField = value;
  1115. }
  1116. }
  1117. /// <summary>
  1118. ///
  1119. /// </summary>
  1120. private BaseAddress addressField;
  1121. public BaseAddress address
  1122. {
  1123. get
  1124. {
  1125. return this.addressField;
  1126. }
  1127. set
  1128. {
  1129. this.addressField = value;
  1130. }
  1131. }
  1132. /// <summary>
  1133. /// Default Constructor
  1134. /// </summary>
  1135. public BusinessInfoType()
  1136. {
  1137. }
  1138. public string ToNVPString(string prefix)
  1139. {
  1140. StringBuilder sb = new StringBuilder();
  1141. if (this.firstName != null)
  1142. {
  1143. sb.Append(prefix).Append("firstName").Append("=").Append(HttpUtility.UrlEncode(this.firstName, BaseConstants.ENCODING_FORMAT)).Append("&");
  1144. }
  1145. if (this.lastName != null)
  1146. {
  1147. sb.Append(prefix).Append("lastName").Append("=").Append(HttpUtility.UrlEncode(this.lastName, BaseConstants.ENCODING_FORMAT)).Append("&");
  1148. }
  1149. if (this.businessName != null)
  1150. {
  1151. sb.Append(prefix).Append("businessName").Append("=").Append(HttpUtility.UrlEncode(this.businessName, BaseConstants.ENCODING_FORMAT)).Append("&");
  1152. }
  1153. if (this.phone != null)
  1154. {
  1155. sb.Append(prefix).Append("phone").Append("=").Append(HttpUtility.UrlEncode(this.phone, BaseConstants.ENCODING_FORMAT)).Append("&");
  1156. }
  1157. if (this.fax != null)
  1158. {
  1159. sb.Append(prefix).Append("fax").Append("=").Append(HttpUtility.UrlEncode(this.fax, BaseConstants.ENCODING_FORMAT)).Append("&");
  1160. }
  1161. if (this.website != null)
  1162. {
  1163. sb.Append(prefix).Append("website").Append("=").Append(HttpUtility.UrlEncode(this.website, BaseConstants.ENCODING_FORMAT)).Append("&");
  1164. }
  1165. if (this.language != null)
  1166. {
  1167. sb.Append(prefix).Append("language").Append("=").Append(HttpUtility.UrlEncode(this.language, BaseConstants.ENCODING_FORMAT)).Append("&");
  1168. }
  1169. if (this.taxId != null)
  1170. {
  1171. sb.Append(prefix).Append("taxId").Append("=").Append(HttpUtility.UrlEncode(this.taxId, BaseConstants.ENCODING_FORMAT)).Append("&");
  1172. }
  1173. if (this.customValue != null)
  1174. {
  1175. sb.Append(prefix).Append("customValue").Append("=").Append(HttpUtility.UrlEncode(this.customValue, BaseConstants.ENCODING_FORMAT)).Append("&");
  1176. }
  1177. if (this.address != null)
  1178. {
  1179. string newPrefix = prefix + "address" + ".";
  1180. sb.Append(this.addressField.ToNVPString(newPrefix));
  1181. }
  1182. return sb.ToString();
  1183. }
  1184. /// <summary>
  1185. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  1186. /// </summary>
  1187. /// <param name="map">NVP map as returned by an API call</param>
  1188. /// <param name="prefix">NVP prefix for this class in the response</param>
  1189. /// <param name="index">For array elements, index of this element in the response</param>
  1190. /// <returns>
  1191. /// A new BusinessInfoType object created from the passed in NVP map
  1192. /// </returns>
  1193. public static BusinessInfoType CreateInstance(Dictionary<string, string> map, string prefix, int index)
  1194. {
  1195. BusinessInfoType businessInfoType = null;
  1196. string key;
  1197. int i = 0;
  1198. if(index != -1)
  1199. {
  1200. if (prefix.Length > 0 && !prefix.EndsWith("."))
  1201. {
  1202. prefix = prefix + "(" + index + ").";
  1203. }
  1204. }
  1205. else
  1206. {
  1207. if (prefix.Length > 0 && !prefix.EndsWith("."))
  1208. {
  1209. prefix = prefix + ".";
  1210. }
  1211. }
  1212. key = prefix + "firstName";
  1213. if (map.ContainsKey(key))
  1214. {
  1215. businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
  1216. businessInfoType.firstName = map[key];
  1217. }
  1218. key = prefix + "lastName";
  1219. if (map.ContainsKey(key))
  1220. {
  1221. businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
  1222. businessInfoType.lastName = map[key];
  1223. }
  1224. key = prefix + "businessName";
  1225. if (map.ContainsKey(key))
  1226. {
  1227. businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
  1228. businessInfoType.businessName = map[key];
  1229. }
  1230. key = prefix + "phone";
  1231. if (map.ContainsKey(key))
  1232. {
  1233. businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
  1234. businessInfoType.phone = map[key];
  1235. }
  1236. key = prefix + "fax";
  1237. if (map.ContainsKey(key))
  1238. {
  1239. businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
  1240. businessInfoType.fax = map[key];
  1241. }
  1242. key = prefix + "website";
  1243. if (map.ContainsKey(key))
  1244. {
  1245. businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
  1246. businessInfoType.website = map[key];
  1247. }
  1248. key = prefix + "language";
  1249. if (map.ContainsKey(key))
  1250. {
  1251. businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
  1252. businessInfoType.language = map[key];
  1253. }
  1254. key = prefix + "taxId";
  1255. if (map.ContainsKey(key))
  1256. {
  1257. businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
  1258. businessInfoType.taxId = map[key];
  1259. }
  1260. key = prefix + "customValue";
  1261. if (map.ContainsKey(key))
  1262. {
  1263. businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
  1264. businessInfoType.customValue = map[key];
  1265. }
  1266. BaseAddress address = BaseAddress.CreateInstance(map, prefix + "address", -1);
  1267. if (address != null)
  1268. {
  1269. businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
  1270. businessInfoType.address = address;
  1271. }
  1272. return businessInfoType;
  1273. }
  1274. }
  1275. /// <summary>
  1276. /// Item information about a service or product listed in the
  1277. /// invoice.
  1278. /// </summary>
  1279. public partial class InvoiceItemType {
  1280. // Default US culture info
  1281. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  1282. /// <summary>
  1283. ///
  1284. /// </summary>
  1285. private string nameField;
  1286. public string name
  1287. {
  1288. get
  1289. {
  1290. return this.nameField;
  1291. }
  1292. set
  1293. {
  1294. this.nameField = value;
  1295. }
  1296. }
  1297. /// <summary>
  1298. ///
  1299. /// </summary>
  1300. private string descriptionField;
  1301. public string description
  1302. {
  1303. get
  1304. {
  1305. return this.descriptionField;
  1306. }
  1307. set
  1308. {
  1309. this.descriptionField = value;
  1310. }
  1311. }
  1312. /// <summary>
  1313. ///
  1314. /// </summary>
  1315. private string dateField;
  1316. public string date
  1317. {
  1318. get
  1319. {
  1320. return this.dateField;
  1321. }
  1322. set
  1323. {
  1324. this.dateField = value;
  1325. }
  1326. }
  1327. /// <summary>
  1328. ///
  1329. /// </summary>
  1330. private decimal? quantityField;
  1331. public decimal? quantity
  1332. {
  1333. get
  1334. {
  1335. return this.quantityField;
  1336. }
  1337. set
  1338. {
  1339. this.quantityField = value;
  1340. }
  1341. }
  1342. /// <summary>
  1343. ///
  1344. /// </summary>
  1345. private decimal? unitPriceField;
  1346. public decimal? unitPrice
  1347. {
  1348. get
  1349. {
  1350. return this.unitPriceField;
  1351. }
  1352. set
  1353. {
  1354. this.unitPriceField = value;
  1355. }
  1356. }
  1357. /// <summary>
  1358. ///
  1359. /// </summary>
  1360. private decimal? discountPercentField;
  1361. public decimal? discountPercent
  1362. {
  1363. get
  1364. {
  1365. return this.discountPercentField;
  1366. }
  1367. set
  1368. {
  1369. this.discountPercentField = value;
  1370. }
  1371. }
  1372. /// <summary>
  1373. ///
  1374. /// </summary>
  1375. private decimal? discountAmountField;
  1376. public decimal? discountAmount
  1377. {
  1378. get
  1379. {
  1380. return this.discountAmountField;
  1381. }
  1382. set
  1383. {
  1384. this.discountAmountField = value;
  1385. }
  1386. }
  1387. /// <summary>
  1388. ///
  1389. /// </summary>
  1390. private string taxNameField;
  1391. public string taxName
  1392. {
  1393. get
  1394. {
  1395. return this.taxNameField;
  1396. }
  1397. set
  1398. {
  1399. this.taxNameField = value;
  1400. }
  1401. }
  1402. /// <summary>
  1403. ///
  1404. /// </summary>
  1405. private decimal? taxRateField;
  1406. public decimal? taxRate
  1407. {
  1408. get
  1409. {
  1410. return this.taxRateField;
  1411. }
  1412. set
  1413. {
  1414. this.taxRateField = value;
  1415. }
  1416. }
  1417. /// <summary>
  1418. ///
  1419. /// </summary>
  1420. private decimal? taxAmountField;
  1421. public decimal? taxAmount
  1422. {
  1423. get
  1424. {
  1425. return this.taxAmountField;
  1426. }
  1427. set
  1428. {
  1429. this.taxAmountField = value;
  1430. }
  1431. }
  1432. /// <summary>
  1433. ///
  1434. /// </summary>
  1435. private string imageUrlField;
  1436. public string imageUrl
  1437. {
  1438. get
  1439. {
  1440. return this.imageUrlField;
  1441. }
  1442. set
  1443. {
  1444. this.imageUrlField = value;
  1445. }
  1446. }
  1447. /// <summary>
  1448. /// Constructor with arguments
  1449. /// </summary>
  1450. public InvoiceItemType(string name, decimal? quantity, decimal? unitPrice)
  1451. {
  1452. this.name = name;
  1453. this.quantity = quantity;
  1454. this.unitPrice = unitPrice;
  1455. }
  1456. /// <summary>
  1457. /// Default Constructor
  1458. /// </summary>
  1459. public InvoiceItemType()
  1460. {
  1461. }
  1462. public string ToNVPString(string prefix)
  1463. {
  1464. StringBuilder sb = new StringBuilder();
  1465. if (this.name != null)
  1466. {
  1467. sb.Append(prefix).Append("name").Append("=").Append(HttpUtility.UrlEncode(this.name, BaseConstants.ENCODING_FORMAT)).Append("&");
  1468. }
  1469. if (this.description != null)
  1470. {
  1471. sb.Append(prefix).Append("description").Append("=").Append(HttpUtility.UrlEncode(this.description, BaseConstants.ENCODING_FORMAT)).Append("&");
  1472. }
  1473. if (this.date != null)
  1474. {
  1475. sb.Append(prefix).Append("date").Append("=").Append(HttpUtility.UrlEncode(this.date, BaseConstants.ENCODING_FORMAT)).Append("&");
  1476. }
  1477. if (this.quantity != null)
  1478. {
  1479. sb.Append(prefix).Append("quantity").Append("=").Append(Convert.ToString(this.quantity, DefaultCulture)).Append("&");
  1480. }
  1481. if (this.unitPrice != null)
  1482. {
  1483. sb.Append(prefix).Append("unitPrice").Append("=").Append(Convert.ToString(this.unitPrice, DefaultCulture)).Append("&");
  1484. }
  1485. if (this.discountPercent != null)
  1486. {
  1487. sb.Append(prefix).Append("discountPercent").Append("=").Append(Convert.ToString(this.discountPercent, DefaultCulture)).Append("&");
  1488. }
  1489. if (this.discountAmount != null)
  1490. {
  1491. sb.Append(prefix).Append("discountAmount").Append("=").Append(Convert.ToString(this.discountAmount, DefaultCulture)).Append("&");
  1492. }
  1493. if (this.taxName != null)
  1494. {
  1495. sb.Append(prefix).Append("taxName").Append("=").Append(HttpUtility.UrlEncode(this.taxName, BaseConstants.ENCODING_FORMAT)).Append("&");
  1496. }
  1497. if (this.taxRate != null)
  1498. {
  1499. sb.Append(prefix).Append("taxRate").Append("=").Append(Convert.ToString(this.taxRate, DefaultCulture)).Append("&");
  1500. }
  1501. if (this.taxAmount != null)
  1502. {
  1503. sb.Append(prefix).Append("taxAmount").Append("=").Append(Convert.ToString(this.taxAmount, DefaultCulture)).Append("&");
  1504. }
  1505. if (this.imageUrl != null)
  1506. {
  1507. sb.Append(prefix).Append("imageUrl").Append("=").Append(HttpUtility.UrlEncode(this.imageUrl, BaseConstants.ENCODING_FORMAT)).Append("&");
  1508. }
  1509. return sb.ToString();
  1510. }
  1511. /// <summary>
  1512. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  1513. /// </summary>
  1514. /// <param name="map">NVP map as returned by an API call</param>
  1515. /// <param name="prefix">NVP prefix for this class in the response</param>
  1516. /// <param name="index">For array elements, index of this element in the response</param>
  1517. /// <returns>
  1518. /// A new InvoiceItemType object created from the passed in NVP map
  1519. /// </returns>
  1520. public static InvoiceItemType CreateInstance(Dictionary<string, string> map, string prefix, int index)
  1521. {
  1522. InvoiceItemType invoiceItemType = null;
  1523. string key;
  1524. int i = 0;
  1525. if(index != -1)
  1526. {
  1527. if (prefix.Length > 0 && !prefix.EndsWith("."))
  1528. {
  1529. prefix = prefix + "(" + index + ").";
  1530. }
  1531. }
  1532. else
  1533. {
  1534. if (prefix.Length > 0 && !prefix.EndsWith("."))
  1535. {
  1536. prefix = prefix + ".";
  1537. }
  1538. }
  1539. key = prefix + "name";
  1540. if (map.ContainsKey(key))
  1541. {
  1542. invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
  1543. invoiceItemType.name = map[key];
  1544. }
  1545. key = prefix + "description";
  1546. if (map.ContainsKey(key))
  1547. {
  1548. invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
  1549. invoiceItemType.description = map[key];
  1550. }
  1551. key = prefix + "date";
  1552. if (map.ContainsKey(key))
  1553. {
  1554. invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
  1555. invoiceItemType.date = map[key];
  1556. }
  1557. key = prefix + "quantity";
  1558. if (map.ContainsKey(key))
  1559. {
  1560. invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
  1561. invoiceItemType.quantity = System.Convert.ToDecimal(map[key], DefaultCulture);
  1562. }
  1563. key = prefix + "unitPrice";
  1564. if (map.ContainsKey(key))
  1565. {
  1566. invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
  1567. invoiceItemType.unitPrice = System.Convert.ToDecimal(map[key], DefaultCulture);
  1568. }
  1569. key = prefix + "discountPercent";
  1570. if (map.ContainsKey(key))
  1571. {
  1572. invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
  1573. invoiceItemType.discountPercent = System.Convert.ToDecimal(map[key], DefaultCulture);
  1574. }
  1575. key = prefix + "discountAmount";
  1576. if (map.ContainsKey(key))
  1577. {
  1578. invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
  1579. invoiceItemType.discountAmount = System.Convert.ToDecimal(map[key], DefaultCulture);
  1580. }
  1581. key = prefix + "taxName";
  1582. if (map.ContainsKey(key))
  1583. {
  1584. invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
  1585. invoiceItemType.taxName = map[key];
  1586. }
  1587. key = prefix + "taxRate";
  1588. if (map.ContainsKey(key))
  1589. {
  1590. invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
  1591. invoiceItemType.taxRate = System.Convert.ToDecimal(map[key], DefaultCulture);
  1592. }
  1593. key = prefix + "taxAmount";
  1594. if (map.ContainsKey(key))
  1595. {
  1596. invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
  1597. invoiceItemType.taxAmount = System.Convert.ToDecimal(map[key], DefaultCulture);
  1598. }
  1599. key = prefix + "imageUrl";
  1600. if (map.ContainsKey(key))
  1601. {
  1602. invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
  1603. invoiceItemType.imageUrl = map[key];
  1604. }
  1605. return invoiceItemType;
  1606. }
  1607. }
  1608. /// <summary>
  1609. /// A list of invoice items.
  1610. /// </summary>
  1611. public partial class InvoiceItemListType {
  1612. // Default US culture info
  1613. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  1614. /// <summary>
  1615. ///
  1616. /// </summary>
  1617. private List<InvoiceItemType> itemField = new List<InvoiceItemType>();
  1618. public List<InvoiceItemType> item
  1619. {
  1620. get
  1621. {
  1622. return this.itemField;
  1623. }
  1624. set
  1625. {
  1626. this.itemField = value;
  1627. }
  1628. }
  1629. /// <summary>
  1630. /// Constructor with arguments
  1631. /// </summary>
  1632. public InvoiceItemListType(List<InvoiceItemType> item)
  1633. {
  1634. this.item = item;
  1635. }
  1636. /// <summary>
  1637. /// Default Constructor
  1638. /// </summary>
  1639. public InvoiceItemListType()
  1640. {
  1641. }
  1642. public string ToNVPString(string prefix)
  1643. {
  1644. StringBuilder sb = new StringBuilder();
  1645. for (int i = 0; i < this.item.Count; i++)
  1646. {
  1647. if (this.item[i] != null)
  1648. {
  1649. string newPrefix = prefix + "item" + "(" + i + ").";
  1650. sb.Append(this.item[i].ToNVPString(newPrefix));
  1651. }
  1652. }
  1653. return sb.ToString();
  1654. }
  1655. /// <summary>
  1656. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  1657. /// </summary>
  1658. /// <param name="map">NVP map as returned by an API call</param>
  1659. /// <param name="prefix">NVP prefix for this class in the response</param>
  1660. /// <param name="index">For array elements, index of this element in the response</param>
  1661. /// <returns>
  1662. /// A new InvoiceItemListType object created from the passed in NVP map
  1663. /// </returns>
  1664. public static InvoiceItemListType CreateInstance(Dictionary<string, string> map, string prefix, int index)
  1665. {
  1666. InvoiceItemListType invoiceItemListType = null;
  1667. string key;
  1668. int i = 0;
  1669. if(index != -1)
  1670. {
  1671. if (prefix.Length > 0 && !prefix.EndsWith("."))
  1672. {
  1673. prefix = prefix + "(" + index + ").";
  1674. }
  1675. }
  1676. else
  1677. {
  1678. if (prefix.Length > 0 && !prefix.EndsWith("."))
  1679. {
  1680. prefix = prefix + ".";
  1681. }
  1682. }
  1683. i = 0;
  1684. while(true)
  1685. {
  1686. InvoiceItemType item = InvoiceItemType.CreateInstance(map, prefix + "item", i);
  1687. if (item != null)
  1688. {
  1689. invoiceItemListType = (invoiceItemListType == null) ? new InvoiceItemListType() : invoiceItemListType;
  1690. invoiceItemListType.item.Add(item);
  1691. i++;
  1692. }
  1693. else
  1694. {
  1695. break;
  1696. }
  1697. }
  1698. return invoiceItemListType;
  1699. }
  1700. }
  1701. /// <summary>
  1702. /// Invoice details about the merchant, payer, totals and terms.
  1703. ///
  1704. /// </summary>
  1705. public partial class InvoiceType {
  1706. // Default US culture info
  1707. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  1708. /// <summary>
  1709. ///
  1710. /// </summary>
  1711. private string merchantEmailField;
  1712. public string merchantEmail
  1713. {
  1714. get
  1715. {
  1716. return this.merchantEmailField;
  1717. }
  1718. set
  1719. {
  1720. this.merchantEmailField = value;
  1721. }
  1722. }
  1723. /// <summary>
  1724. ///
  1725. /// </summary>
  1726. private string payerEmailField;
  1727. public string payerEmail
  1728. {
  1729. get
  1730. {
  1731. return this.payerEmailField;
  1732. }
  1733. set
  1734. {
  1735. this.payerEmailField = value;
  1736. }
  1737. }
  1738. /// <summary>
  1739. ///
  1740. /// </summary>
  1741. private string numberField;
  1742. public string number
  1743. {
  1744. get
  1745. {
  1746. return this.numberField;
  1747. }
  1748. set
  1749. {
  1750. this.numberField = value;
  1751. }
  1752. }
  1753. /// <summary>
  1754. ///
  1755. /// </summary>
  1756. private BusinessInfoType merchantInfoField;
  1757. public BusinessInfoType merchantInfo
  1758. {
  1759. get
  1760. {
  1761. return this.merchantInfoField;
  1762. }
  1763. set
  1764. {
  1765. this.merchantInfoField = value;
  1766. }
  1767. }
  1768. /// <summary>
  1769. ///
  1770. /// </summary>
  1771. private InvoiceItemListType itemListField;
  1772. public InvoiceItemListType itemList
  1773. {
  1774. get
  1775. {
  1776. return this.itemListField;
  1777. }
  1778. set
  1779. {
  1780. this.itemListField = value;
  1781. }
  1782. }
  1783. /// <summary>
  1784. ///
  1785. /// </summary>
  1786. private bool? taxCalculatedAfterDiscountField;
  1787. public bool? taxCalculatedAfterDiscount
  1788. {
  1789. get
  1790. {
  1791. return this.taxCalculatedAfterDiscountField;
  1792. }
  1793. set
  1794. {
  1795. this.taxCalculatedAfterDiscountField = value;
  1796. }
  1797. }
  1798. /// <summary>
  1799. ///
  1800. /// </summary>
  1801. private string currencyCodeField;
  1802. public string currencyCode
  1803. {
  1804. get
  1805. {
  1806. return this.currencyCodeField;
  1807. }
  1808. set
  1809. {
  1810. this.currencyCodeField = value;
  1811. }
  1812. }
  1813. /// <summary>
  1814. ///
  1815. /// </summary>
  1816. private string invoiceDateField;
  1817. public string invoiceDate
  1818. {
  1819. get
  1820. {
  1821. return this.invoiceDateField;
  1822. }
  1823. set
  1824. {
  1825. this.invoiceDateField = value;
  1826. }
  1827. }
  1828. /// <summary>
  1829. ///
  1830. /// </summary>
  1831. private string dueDateField;
  1832. public string dueDate
  1833. {
  1834. get
  1835. {
  1836. return this.dueDateField;
  1837. }
  1838. set
  1839. {
  1840. this.dueDateField = value;
  1841. }
  1842. }
  1843. /// <summary>
  1844. ///
  1845. /// </summary>
  1846. private PaymentTermsType? paymentTermsField;
  1847. public PaymentTermsType? paymentTerms
  1848. {
  1849. get
  1850. {
  1851. return this.paymentTermsField;
  1852. }
  1853. set
  1854. {
  1855. this.paymentTermsField = value;
  1856. }
  1857. }
  1858. /// <summary>
  1859. ///
  1860. /// </summary>
  1861. private decimal? discountPercentField;
  1862. public decimal? discountPercent
  1863. {
  1864. get
  1865. {
  1866. return this.discountPercentField;
  1867. }
  1868. set
  1869. {
  1870. this.discountPercentField = value;
  1871. }
  1872. }
  1873. /// <summary>
  1874. ///
  1875. /// </summary>
  1876. private decimal? discountAmountField;
  1877. public decimal? discountAmount
  1878. {
  1879. get
  1880. {
  1881. return this.discountAmountField;
  1882. }
  1883. set
  1884. {
  1885. this.discountAmountField = value;
  1886. }
  1887. }
  1888. /// <summary>
  1889. ///
  1890. /// </summary>
  1891. private decimal? totalItemDiscountAmountField;
  1892. public decimal? totalItemDiscountAmount
  1893. {
  1894. get
  1895. {
  1896. return this.totalItemDiscountAmountField;
  1897. }
  1898. set
  1899. {
  1900. this.totalItemDiscountAmountField = value;
  1901. }
  1902. }
  1903. /// <summary>
  1904. ///
  1905. /// </summary>
  1906. private bool? taxInclusiveField;
  1907. public bool? taxInclusive
  1908. {
  1909. get
  1910. {
  1911. return this.taxInclusiveField;
  1912. }
  1913. set
  1914. {
  1915. this.taxInclusiveField = value;
  1916. }
  1917. }
  1918. /// <summary>
  1919. ///
  1920. /// </summary>
  1921. private string termsField;
  1922. public string terms
  1923. {
  1924. get
  1925. {
  1926. return this.termsField;
  1927. }
  1928. set
  1929. {
  1930. this.termsField = value;
  1931. }
  1932. }
  1933. /// <summary>
  1934. ///
  1935. /// </summary>
  1936. private string noteField;
  1937. public string note
  1938. {
  1939. get
  1940. {
  1941. return this.noteField;
  1942. }
  1943. set
  1944. {
  1945. this.noteField = value;
  1946. }
  1947. }
  1948. /// <summary>
  1949. ///
  1950. /// </summary>
  1951. private string merchantMemoField;
  1952. public string merchantMemo
  1953. {
  1954. get
  1955. {
  1956. return this.merchantMemoField;
  1957. }
  1958. set
  1959. {
  1960. this.merchantMemoField = value;
  1961. }
  1962. }
  1963. /// <summary>
  1964. ///
  1965. /// </summary>
  1966. private string receiptDetailsField;
  1967. public string receiptDetails
  1968. {
  1969. get
  1970. {
  1971. return this.receiptDetailsField;
  1972. }
  1973. set
  1974. {
  1975. this.receiptDetailsField = value;
  1976. }
  1977. }
  1978. /// <summary>
  1979. ///
  1980. /// </summary>
  1981. private BusinessInfoType billingInfoField;
  1982. public BusinessInfoType billingInfo
  1983. {
  1984. get
  1985. {
  1986. return this.billingInfoField;
  1987. }
  1988. set
  1989. {
  1990. this.billingInfoField = value;
  1991. }
  1992. }
  1993. /// <summary>
  1994. ///
  1995. /// </summary>
  1996. private BusinessInfoType shippingInfoField;
  1997. public BusinessInfoType shippingInfo
  1998. {
  1999. get
  2000. {
  2001. return this.shippingInfoField;
  2002. }
  2003. set
  2004. {
  2005. this.shippingInfoField = value;
  2006. }
  2007. }
  2008. /// <summary>
  2009. ///
  2010. /// </summary>
  2011. private decimal? shippingAmountField;
  2012. public decimal? shippingAmount
  2013. {
  2014. get
  2015. {
  2016. return this.shippingAmountField;
  2017. }
  2018. set
  2019. {
  2020. this.shippingAmountField = value;
  2021. }
  2022. }
  2023. /// <summary>
  2024. ///
  2025. /// </summary>
  2026. private string shippingTaxNameField;
  2027. public string shippingTaxName
  2028. {
  2029. get
  2030. {
  2031. return this.shippingTaxNameField;
  2032. }
  2033. set
  2034. {
  2035. this.shippingTaxNameField = value;
  2036. }
  2037. }
  2038. /// <summary>
  2039. ///
  2040. /// </summary>
  2041. private decimal? shippingTaxRateField;
  2042. public decimal? shippingTaxRate
  2043. {
  2044. get
  2045. {
  2046. return this.shippingTaxRateField;
  2047. }
  2048. set
  2049. {
  2050. this.shippingTaxRateField = value;
  2051. }
  2052. }
  2053. /// <summary>
  2054. ///
  2055. /// </summary>
  2056. private decimal? shippingTaxAmountField;
  2057. public decimal? shippingTaxAmount
  2058. {
  2059. get
  2060. {
  2061. return this.shippingTaxAmountField;
  2062. }
  2063. set
  2064. {
  2065. this.shippingTaxAmountField = value;
  2066. }
  2067. }
  2068. /// <summary>
  2069. ///
  2070. /// </summary>
  2071. private string logoUrlField;
  2072. public string logoUrl
  2073. {
  2074. get
  2075. {
  2076. return this.logoUrlField;
  2077. }
  2078. set
  2079. {
  2080. this.logoUrlField = value;
  2081. }
  2082. }
  2083. /// <summary>
  2084. ///
  2085. /// </summary>
  2086. private string referrerCodeField;
  2087. public string referrerCode
  2088. {
  2089. get
  2090. {
  2091. return this.referrerCodeField;
  2092. }
  2093. set
  2094. {
  2095. this.referrerCodeField = value;
  2096. }
  2097. }
  2098. /// <summary>
  2099. ///
  2100. /// </summary>
  2101. private string customAmountLabelField;
  2102. public string customAmountLabel
  2103. {
  2104. get
  2105. {
  2106. return this.customAmountLabelField;
  2107. }
  2108. set
  2109. {
  2110. this.customAmountLabelField = value;
  2111. }
  2112. }
  2113. /// <summary>
  2114. ///
  2115. /// </summary>
  2116. private decimal? customAmountValueField;
  2117. public decimal? customAmountValue
  2118. {
  2119. get
  2120. {
  2121. return this.customAmountValueField;
  2122. }
  2123. set
  2124. {
  2125. this.customAmountValueField = value;
  2126. }
  2127. }
  2128. /// <summary>
  2129. /// Constructor with arguments
  2130. /// </summary>
  2131. public InvoiceType(string merchantEmail, string payerEmail, InvoiceItemListType itemList, string currencyCode)
  2132. {
  2133. this.merchantEmail = merchantEmail;
  2134. this.payerEmail = payerEmail;
  2135. this.itemList = itemList;
  2136. this.currencyCode = currencyCode;
  2137. }
  2138. /// <summary>
  2139. /// Default Constructor
  2140. /// </summary>
  2141. public InvoiceType()
  2142. {
  2143. }
  2144. public string ToNVPString(string prefix)
  2145. {
  2146. StringBuilder sb = new StringBuilder();
  2147. if (this.merchantEmail != null)
  2148. {
  2149. sb.Append(prefix).Append("merchantEmail").Append("=").Append(HttpUtility.UrlEncode(this.merchantEmail, BaseConstants.ENCODING_FORMAT)).Append("&");
  2150. }
  2151. if (this.payerEmail != null)
  2152. {
  2153. sb.Append(prefix).Append("payerEmail").Append("=").Append(HttpUtility.UrlEncode(this.payerEmail, BaseConstants.ENCODING_FORMAT)).Append("&");
  2154. }
  2155. if (this.number != null)
  2156. {
  2157. sb.Append(prefix).Append("number").Append("=").Append(HttpUtility.UrlEncode(this.number, BaseConstants.ENCODING_FORMAT)).Append("&");
  2158. }
  2159. if (this.merchantInfo != null)
  2160. {
  2161. string newPrefix = prefix + "merchantInfo" + ".";
  2162. sb.Append(this.merchantInfoField.ToNVPString(newPrefix));
  2163. }
  2164. if (this.itemList != null)
  2165. {
  2166. string newPrefix = prefix + "itemList" + ".";
  2167. sb.Append(this.itemListField.ToNVPString(newPrefix));
  2168. }
  2169. if (this.taxCalculatedAfterDiscount != null)
  2170. {
  2171. sb.Append(prefix).Append("taxCalculatedAfterDiscount").Append("=").Append(Convert.ToString(this.taxCalculatedAfterDiscount, DefaultCulture)).Append("&");
  2172. }
  2173. if (this.currencyCode != null)
  2174. {
  2175. sb.Append(prefix).Append("currencyCode").Append("=").Append(HttpUtility.UrlEncode(this.currencyCode, BaseConstants.ENCODING_FORMAT)).Append("&");
  2176. }
  2177. if (this.invoiceDate != null)
  2178. {
  2179. sb.Append(prefix).Append("invoiceDate").Append("=").Append(HttpUtility.UrlEncode(this.invoiceDate, BaseConstants.ENCODING_FORMAT)).Append("&");
  2180. }
  2181. if (this.dueDate != null)
  2182. {
  2183. sb.Append(prefix).Append("dueDate").Append("=").Append(HttpUtility.UrlEncode(this.dueDate, BaseConstants.ENCODING_FORMAT)).Append("&");
  2184. }
  2185. if (this.paymentTerms != null)
  2186. {
  2187. sb.Append(prefix).Append("paymentTerms").Append("=").Append(EnumUtils.GetDescription(this.paymentTerms));
  2188. sb.Append("&");
  2189. }
  2190. if (this.discountPercent != null)
  2191. {
  2192. sb.Append(prefix).Append("discountPercent").Append("=").Append(Convert.ToString(this.discountPercent, DefaultCulture)).Append("&");
  2193. }
  2194. if (this.discountAmount != null)
  2195. {
  2196. sb.Append(prefix).Append("discountAmount").Append("=").Append(Convert.ToString(this.discountAmount, DefaultCulture)).Append("&");
  2197. }
  2198. if (this.totalItemDiscountAmount != null)
  2199. {
  2200. sb.Append(prefix).Append("totalItemDiscountAmount").Append("=").Append(Convert.ToString(this.totalItemDiscountAmount, DefaultCulture)).Append("&");
  2201. }
  2202. if (this.taxInclusive != null)
  2203. {
  2204. sb.Append(prefix).Append("taxInclusive").Append("=").Append(Convert.ToString(this.taxInclusive, DefaultCulture)).Append("&");
  2205. }
  2206. if (this.terms != null)
  2207. {
  2208. sb.Append(prefix).Append("terms").Append("=").Append(HttpUtility.UrlEncode(this.terms, BaseConstants.ENCODING_FORMAT)).Append("&");
  2209. }
  2210. if (this.note != null)
  2211. {
  2212. sb.Append(prefix).Append("note").Append("=").Append(HttpUtility.UrlEncode(this.note, BaseConstants.ENCODING_FORMAT)).Append("&");
  2213. }
  2214. if (this.merchantMemo != null)
  2215. {
  2216. sb.Append(prefix).Append("merchantMemo").Append("=").Append(HttpUtility.UrlEncode(this.merchantMemo, BaseConstants.ENCODING_FORMAT)).Append("&");
  2217. }
  2218. if (this.receiptDetails != null)
  2219. {
  2220. sb.Append(prefix).Append("receiptDetails").Append("=").Append(HttpUtility.UrlEncode(this.receiptDetails, BaseConstants.ENCODING_FORMAT)).Append("&");
  2221. }
  2222. if (this.billingInfo != null)
  2223. {
  2224. string newPrefix = prefix + "billingInfo" + ".";
  2225. sb.Append(this.billingInfoField.ToNVPString(newPrefix));
  2226. }
  2227. if (this.shippingInfo != null)
  2228. {
  2229. string newPrefix = prefix + "shippingInfo" + ".";
  2230. sb.Append(this.shippingInfoField.ToNVPString(newPrefix));
  2231. }
  2232. if (this.shippingAmount != null)
  2233. {
  2234. sb.Append(prefix).Append("shippingAmount").Append("=").Append(Convert.ToString(this.shippingAmount, DefaultCulture)).Append("&");
  2235. }
  2236. if (this.shippingTaxName != null)
  2237. {
  2238. sb.Append(prefix).Append("shippingTaxName").Append("=").Append(HttpUtility.UrlEncode(this.shippingTaxName, BaseConstants.ENCODING_FORMAT)).Append("&");
  2239. }
  2240. if (this.shippingTaxRate != null)
  2241. {
  2242. sb.Append(prefix).Append("shippingTaxRate").Append("=").Append(Convert.ToString(this.shippingTaxRate, DefaultCulture)).Append("&");
  2243. }
  2244. if (this.shippingTaxAmount != null)
  2245. {
  2246. sb.Append(prefix).Append("shippingTaxAmount").Append("=").Append(Convert.ToString(this.shippingTaxAmount, DefaultCulture)).Append("&");
  2247. }
  2248. if (this.logoUrl != null)
  2249. {
  2250. sb.Append(prefix).Append("logoUrl").Append("=").Append(HttpUtility.UrlEncode(this.logoUrl, BaseConstants.ENCODING_FORMAT)).Append("&");
  2251. }
  2252. if (this.referrerCode != null)
  2253. {
  2254. sb.Append(prefix).Append("referrerCode").Append("=").Append(HttpUtility.UrlEncode(this.referrerCode, BaseConstants.ENCODING_FORMAT)).Append("&");
  2255. }
  2256. if (this.customAmountLabel != null)
  2257. {
  2258. sb.Append(prefix).Append("customAmountLabel").Append("=").Append(HttpUtility.UrlEncode(this.customAmountLabel, BaseConstants.ENCODING_FORMAT)).Append("&");
  2259. }
  2260. if (this.customAmountValue != null)
  2261. {
  2262. sb.Append(prefix).Append("customAmountValue").Append("=").Append(Convert.ToString(this.customAmountValue, DefaultCulture)).Append("&");
  2263. }
  2264. return sb.ToString();
  2265. }
  2266. /// <summary>
  2267. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  2268. /// </summary>
  2269. /// <param name="map">NVP map as returned by an API call</param>
  2270. /// <param name="prefix">NVP prefix for this class in the response</param>
  2271. /// <param name="index">For array elements, index of this element in the response</param>
  2272. /// <returns>
  2273. /// A new InvoiceType object created from the passed in NVP map
  2274. /// </returns>
  2275. public static InvoiceType CreateInstance(Dictionary<string, string> map, string prefix, int index)
  2276. {
  2277. InvoiceType invoiceType = null;
  2278. string key;
  2279. int i = 0;
  2280. if(index != -1)
  2281. {
  2282. if (prefix.Length > 0 && !prefix.EndsWith("."))
  2283. {
  2284. prefix = prefix + "(" + index + ").";
  2285. }
  2286. }
  2287. else
  2288. {
  2289. if (prefix.Length > 0 && !prefix.EndsWith("."))
  2290. {
  2291. prefix = prefix + ".";
  2292. }
  2293. }
  2294. key = prefix + "merchantEmail";
  2295. if (map.ContainsKey(key))
  2296. {
  2297. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2298. invoiceType.merchantEmail = map[key];
  2299. }
  2300. key = prefix + "payerEmail";
  2301. if (map.ContainsKey(key))
  2302. {
  2303. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2304. invoiceType.payerEmail = map[key];
  2305. }
  2306. key = prefix + "number";
  2307. if (map.ContainsKey(key))
  2308. {
  2309. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2310. invoiceType.number = map[key];
  2311. }
  2312. BusinessInfoType merchantInfo = BusinessInfoType.CreateInstance(map, prefix + "merchantInfo", -1);
  2313. if (merchantInfo != null)
  2314. {
  2315. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2316. invoiceType.merchantInfo = merchantInfo;
  2317. }
  2318. InvoiceItemListType itemList = InvoiceItemListType.CreateInstance(map, prefix + "itemList", -1);
  2319. if (itemList != null)
  2320. {
  2321. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2322. invoiceType.itemList = itemList;
  2323. }
  2324. key = prefix + "taxCalculatedAfterDiscount";
  2325. if (map.ContainsKey(key))
  2326. {
  2327. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2328. invoiceType.taxCalculatedAfterDiscount = System.Convert.ToBoolean(map[key], DefaultCulture);
  2329. }
  2330. key = prefix + "currencyCode";
  2331. if (map.ContainsKey(key))
  2332. {
  2333. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2334. invoiceType.currencyCode = map[key];
  2335. }
  2336. key = prefix + "invoiceDate";
  2337. if (map.ContainsKey(key))
  2338. {
  2339. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2340. invoiceType.invoiceDate = map[key];
  2341. }
  2342. key = prefix + "dueDate";
  2343. if (map.ContainsKey(key))
  2344. {
  2345. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2346. invoiceType.dueDate = map[key];
  2347. }
  2348. key = prefix + "paymentTerms";
  2349. if (map.ContainsKey(key))
  2350. {
  2351. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2352. invoiceType.paymentTerms = (PaymentTermsType)EnumUtils.GetValue(map[key],typeof(PaymentTermsType));
  2353. }
  2354. key = prefix + "discountPercent";
  2355. if (map.ContainsKey(key))
  2356. {
  2357. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2358. invoiceType.discountPercent = System.Convert.ToDecimal(map[key], DefaultCulture);
  2359. }
  2360. key = prefix + "discountAmount";
  2361. if (map.ContainsKey(key))
  2362. {
  2363. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2364. invoiceType.discountAmount = System.Convert.ToDecimal(map[key], DefaultCulture);
  2365. }
  2366. key = prefix + "totalItemDiscountAmount";
  2367. if (map.ContainsKey(key))
  2368. {
  2369. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2370. invoiceType.totalItemDiscountAmount = System.Convert.ToDecimal(map[key], DefaultCulture);
  2371. }
  2372. key = prefix + "taxInclusive";
  2373. if (map.ContainsKey(key))
  2374. {
  2375. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2376. invoiceType.taxInclusive = System.Convert.ToBoolean(map[key], DefaultCulture);
  2377. }
  2378. key = prefix + "terms";
  2379. if (map.ContainsKey(key))
  2380. {
  2381. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2382. invoiceType.terms = map[key];
  2383. }
  2384. key = prefix + "note";
  2385. if (map.ContainsKey(key))
  2386. {
  2387. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2388. invoiceType.note = map[key];
  2389. }
  2390. key = prefix + "merchantMemo";
  2391. if (map.ContainsKey(key))
  2392. {
  2393. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2394. invoiceType.merchantMemo = map[key];
  2395. }
  2396. key = prefix + "receiptDetails";
  2397. if (map.ContainsKey(key))
  2398. {
  2399. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2400. invoiceType.receiptDetails = map[key];
  2401. }
  2402. BusinessInfoType billingInfo = BusinessInfoType.CreateInstance(map, prefix + "billingInfo", -1);
  2403. if (billingInfo != null)
  2404. {
  2405. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2406. invoiceType.billingInfo = billingInfo;
  2407. }
  2408. BusinessInfoType shippingInfo = BusinessInfoType.CreateInstance(map, prefix + "shippingInfo", -1);
  2409. if (shippingInfo != null)
  2410. {
  2411. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2412. invoiceType.shippingInfo = shippingInfo;
  2413. }
  2414. key = prefix + "shippingAmount";
  2415. if (map.ContainsKey(key))
  2416. {
  2417. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2418. invoiceType.shippingAmount = System.Convert.ToDecimal(map[key], DefaultCulture);
  2419. }
  2420. key = prefix + "shippingTaxName";
  2421. if (map.ContainsKey(key))
  2422. {
  2423. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2424. invoiceType.shippingTaxName = map[key];
  2425. }
  2426. key = prefix + "shippingTaxRate";
  2427. if (map.ContainsKey(key))
  2428. {
  2429. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2430. invoiceType.shippingTaxRate = System.Convert.ToDecimal(map[key], DefaultCulture);
  2431. }
  2432. key = prefix + "shippingTaxAmount";
  2433. if (map.ContainsKey(key))
  2434. {
  2435. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2436. invoiceType.shippingTaxAmount = System.Convert.ToDecimal(map[key], DefaultCulture);
  2437. }
  2438. key = prefix + "logoUrl";
  2439. if (map.ContainsKey(key))
  2440. {
  2441. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2442. invoiceType.logoUrl = map[key];
  2443. }
  2444. key = prefix + "referrerCode";
  2445. if (map.ContainsKey(key))
  2446. {
  2447. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2448. invoiceType.referrerCode = map[key];
  2449. }
  2450. key = prefix + "customAmountLabel";
  2451. if (map.ContainsKey(key))
  2452. {
  2453. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2454. invoiceType.customAmountLabel = map[key];
  2455. }
  2456. key = prefix + "customAmountValue";
  2457. if (map.ContainsKey(key))
  2458. {
  2459. invoiceType = (invoiceType == null) ? new InvoiceType() : invoiceType;
  2460. invoiceType.customAmountValue = System.Convert.ToDecimal(map[key], DefaultCulture);
  2461. }
  2462. return invoiceType;
  2463. }
  2464. }
  2465. /// <summary>
  2466. /// Invoice details about the invoice status and state change
  2467. /// dates.
  2468. /// </summary>
  2469. public partial class InvoiceDetailsType {
  2470. // Default US culture info
  2471. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  2472. /// <summary>
  2473. ///
  2474. /// </summary>
  2475. private StatusType? statusField;
  2476. public StatusType? status
  2477. {
  2478. get
  2479. {
  2480. return this.statusField;
  2481. }
  2482. set
  2483. {
  2484. this.statusField = value;
  2485. }
  2486. }
  2487. /// <summary>
  2488. ///
  2489. /// </summary>
  2490. private decimal? totalDiscountAmountField;
  2491. public decimal? totalDiscountAmount
  2492. {
  2493. get
  2494. {
  2495. return this.totalDiscountAmountField;
  2496. }
  2497. set
  2498. {
  2499. this.totalDiscountAmountField = value;
  2500. }
  2501. }
  2502. /// <summary>
  2503. ///
  2504. /// </summary>
  2505. private decimal? totalAmountField;
  2506. public decimal? totalAmount
  2507. {
  2508. get
  2509. {
  2510. return this.totalAmountField;
  2511. }
  2512. set
  2513. {
  2514. this.totalAmountField = value;
  2515. }
  2516. }
  2517. /// <summary>
  2518. ///
  2519. /// </summary>
  2520. private OriginType? originField;
  2521. public OriginType? origin
  2522. {
  2523. get
  2524. {
  2525. return this.originField;
  2526. }
  2527. set
  2528. {
  2529. this.originField = value;
  2530. }
  2531. }
  2532. /// <summary>
  2533. ///
  2534. /// </summary>
  2535. private string createdDateField;
  2536. public string createdDate
  2537. {
  2538. get
  2539. {
  2540. return this.createdDateField;
  2541. }
  2542. set
  2543. {
  2544. this.createdDateField = value;
  2545. }
  2546. }
  2547. /// <summary>
  2548. ///
  2549. /// </summary>
  2550. private string createdByField;
  2551. public string createdBy
  2552. {
  2553. get
  2554. {
  2555. return this.createdByField;
  2556. }
  2557. set
  2558. {
  2559. this.createdByField = value;
  2560. }
  2561. }
  2562. /// <summary>
  2563. ///
  2564. /// </summary>
  2565. private string canceledDateField;
  2566. public string canceledDate
  2567. {
  2568. get
  2569. {
  2570. return this.canceledDateField;
  2571. }
  2572. set
  2573. {
  2574. this.canceledDateField = value;
  2575. }
  2576. }
  2577. /// <summary>
  2578. ///
  2579. /// </summary>
  2580. private ActorType? canceledByActorField;
  2581. public ActorType? canceledByActor
  2582. {
  2583. get
  2584. {
  2585. return this.canceledByActorField;
  2586. }
  2587. set
  2588. {
  2589. this.canceledByActorField = value;
  2590. }
  2591. }
  2592. /// <summary>
  2593. ///
  2594. /// </summary>
  2595. private string canceledByField;
  2596. public string canceledBy
  2597. {
  2598. get
  2599. {
  2600. return this.canceledByField;
  2601. }
  2602. set
  2603. {
  2604. this.canceledByField = value;
  2605. }
  2606. }
  2607. /// <summary>
  2608. ///
  2609. /// </summary>
  2610. private string lastUpdatedDateField;
  2611. public string lastUpdatedDate
  2612. {
  2613. get
  2614. {
  2615. return this.lastUpdatedDateField;
  2616. }
  2617. set
  2618. {
  2619. this.lastUpdatedDateField = value;
  2620. }
  2621. }
  2622. /// <summary>
  2623. ///
  2624. /// </summary>
  2625. private string lastUpdatedByField;
  2626. public string lastUpdatedBy
  2627. {
  2628. get
  2629. {
  2630. return this.lastUpdatedByField;
  2631. }
  2632. set
  2633. {
  2634. this.lastUpdatedByField = value;
  2635. }
  2636. }
  2637. /// <summary>
  2638. ///
  2639. /// </summary>
  2640. private string firstSentDateField;
  2641. public string firstSentDate
  2642. {
  2643. get
  2644. {
  2645. return this.firstSentDateField;
  2646. }
  2647. set
  2648. {
  2649. this.firstSentDateField = value;
  2650. }
  2651. }
  2652. /// <summary>
  2653. ///
  2654. /// </summary>
  2655. private string lastSentDateField;
  2656. public string lastSentDate
  2657. {
  2658. get
  2659. {
  2660. return this.lastSentDateField;
  2661. }
  2662. set
  2663. {
  2664. this.lastSentDateField = value;
  2665. }
  2666. }
  2667. /// <summary>
  2668. ///
  2669. /// </summary>
  2670. private string lastSentByField;
  2671. public string lastSentBy
  2672. {
  2673. get
  2674. {
  2675. return this.lastSentByField;
  2676. }
  2677. set
  2678. {
  2679. this.lastSentByField = value;
  2680. }
  2681. }
  2682. /// <summary>
  2683. ///
  2684. /// </summary>
  2685. private string paidDateField;
  2686. public string paidDate
  2687. {
  2688. get
  2689. {
  2690. return this.paidDateField;
  2691. }
  2692. set
  2693. {
  2694. this.paidDateField = value;
  2695. }
  2696. }
  2697. /// <summary>
  2698. /// Default Constructor
  2699. /// </summary>
  2700. public InvoiceDetailsType()
  2701. {
  2702. }
  2703. /// <summary>
  2704. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  2705. /// </summary>
  2706. /// <param name="map">NVP map as returned by an API call</param>
  2707. /// <param name="prefix">NVP prefix for this class in the response</param>
  2708. /// <param name="index">For array elements, index of this element in the response</param>
  2709. /// <returns>
  2710. /// A new InvoiceDetailsType object created from the passed in NVP map
  2711. /// </returns>
  2712. public static InvoiceDetailsType CreateInstance(Dictionary<string, string> map, string prefix, int index)
  2713. {
  2714. InvoiceDetailsType invoiceDetailsType = null;
  2715. string key;
  2716. int i = 0;
  2717. if(index != -1)
  2718. {
  2719. if (prefix.Length > 0 && !prefix.EndsWith("."))
  2720. {
  2721. prefix = prefix + "(" + index + ").";
  2722. }
  2723. }
  2724. else
  2725. {
  2726. if (prefix.Length > 0 && !prefix.EndsWith("."))
  2727. {
  2728. prefix = prefix + ".";
  2729. }
  2730. }
  2731. key = prefix + "status";
  2732. if (map.ContainsKey(key))
  2733. {
  2734. invoiceDetailsType = (invoiceDetailsType == null) ? new InvoiceDetailsType() : invoiceDetailsType;
  2735. invoiceDetailsType.status = (StatusType)EnumUtils.GetValue(map[key],typeof(StatusType));
  2736. }
  2737. key = prefix + "totalDiscountAmount";
  2738. if (map.ContainsKey(key))
  2739. {
  2740. invoiceDetailsType = (invoiceDetailsType == null) ? new InvoiceDetailsType() : invoiceDetailsType;
  2741. invoiceDetailsType.totalDiscountAmount = System.Convert.ToDecimal(map[key], DefaultCulture);
  2742. }
  2743. key = prefix + "totalAmount";
  2744. if (map.ContainsKey(key))
  2745. {
  2746. invoiceDetailsType = (invoiceDetailsType == null) ? new InvoiceDetailsType() : invoiceDetailsType;
  2747. invoiceDetailsType.totalAmount = System.Convert.ToDecimal(map[key], DefaultCulture);
  2748. }
  2749. key = prefix + "origin";
  2750. if (map.ContainsKey(key))
  2751. {
  2752. invoiceDetailsType = (invoiceDetailsType == null) ? new InvoiceDetailsType() : invoiceDetailsType;
  2753. invoiceDetailsType.origin = (OriginType)EnumUtils.GetValue(map[key],typeof(OriginType));
  2754. }
  2755. key = prefix + "createdDate";
  2756. if (map.ContainsKey(key))
  2757. {
  2758. invoiceDetailsType = (invoiceDetailsType == null) ? new InvoiceDetailsType() : invoiceDetailsType;
  2759. invoiceDetailsType.createdDate = map[key];
  2760. }
  2761. key = prefix + "createdBy";
  2762. if (map.ContainsKey(key))
  2763. {
  2764. invoiceDetailsType = (invoiceDetailsType == null) ? new InvoiceDetailsType() : invoiceDetailsType;
  2765. invoiceDetailsType.createdBy = map[key];
  2766. }
  2767. key = prefix + "canceledDate";
  2768. if (map.ContainsKey(key))
  2769. {
  2770. invoiceDetailsType = (invoiceDetailsType == null) ? new InvoiceDetailsType() : invoiceDetailsType;
  2771. invoiceDetailsType.canceledDate = map[key];
  2772. }
  2773. key = prefix + "canceledByActor";
  2774. if (map.ContainsKey(key))
  2775. {
  2776. invoiceDetailsType = (invoiceDetailsType == null) ? new InvoiceDetailsType() : invoiceDetailsType;
  2777. invoiceDetailsType.canceledByActor = (ActorType)EnumUtils.GetValue(map[key],typeof(ActorType));
  2778. }
  2779. key = prefix + "canceledBy";
  2780. if (map.ContainsKey(key))
  2781. {
  2782. invoiceDetailsType = (invoiceDetailsType == null) ? new InvoiceDetailsType() : invoiceDetailsType;
  2783. invoiceDetailsType.canceledBy = map[key];
  2784. }
  2785. key = prefix + "lastUpdatedDate";
  2786. if (map.ContainsKey(key))
  2787. {
  2788. invoiceDetailsType = (invoiceDetailsType == null) ? new InvoiceDetailsType() : invoiceDetailsType;
  2789. invoiceDetailsType.lastUpdatedDate = map[key];
  2790. }
  2791. key = prefix + "lastUpdatedBy";
  2792. if (map.ContainsKey(key))
  2793. {
  2794. invoiceDetailsType = (invoiceDetailsType == null) ? new InvoiceDetailsType() : invoiceDetailsType;
  2795. invoiceDetailsType.lastUpdatedBy = map[key];
  2796. }
  2797. key = prefix + "firstSentDate";
  2798. if (map.ContainsKey(key))
  2799. {
  2800. invoiceDetailsType = (invoiceDetailsType == null) ? new InvoiceDetailsType() : invoiceDetailsType;
  2801. invoiceDetailsType.firstSentDate = map[key];
  2802. }
  2803. key = prefix + "lastSentDate";
  2804. if (map.ContainsKey(key))
  2805. {
  2806. invoiceDetailsType = (invoiceDetailsType == null) ? new InvoiceDetailsType() : invoiceDetailsType;
  2807. invoiceDetailsType.lastSentDate = map[key];
  2808. }
  2809. key = prefix + "lastSentBy";
  2810. if (map.ContainsKey(key))
  2811. {
  2812. invoiceDetailsType = (invoiceDetailsType == null) ? new InvoiceDetailsType() : invoiceDetailsType;
  2813. invoiceDetailsType.lastSentBy = map[key];
  2814. }
  2815. key = prefix + "paidDate";
  2816. if (map.ContainsKey(key))
  2817. {
  2818. invoiceDetailsType = (invoiceDetailsType == null) ? new InvoiceDetailsType() : invoiceDetailsType;
  2819. invoiceDetailsType.paidDate = map[key];
  2820. }
  2821. return invoiceDetailsType;
  2822. }
  2823. }
  2824. /// <summary>
  2825. /// Details of the refund made against this invoice.
  2826. /// </summary>
  2827. public partial class OtherPaymentRefundDetailsType {
  2828. // Default US culture info
  2829. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  2830. /// <summary>
  2831. ///
  2832. /// </summary>
  2833. private string noteField;
  2834. public string note
  2835. {
  2836. get
  2837. {
  2838. return this.noteField;
  2839. }
  2840. set
  2841. {
  2842. this.noteField = value;
  2843. }
  2844. }
  2845. /// <summary>
  2846. ///
  2847. /// </summary>
  2848. private string dateField;
  2849. public string date
  2850. {
  2851. get
  2852. {
  2853. return this.dateField;
  2854. }
  2855. set
  2856. {
  2857. this.dateField = value;
  2858. }
  2859. }
  2860. /// <summary>
  2861. /// Default Constructor
  2862. /// </summary>
  2863. public OtherPaymentRefundDetailsType()
  2864. {
  2865. }
  2866. public string ToNVPString(string prefix)
  2867. {
  2868. StringBuilder sb = new StringBuilder();
  2869. if (this.note != null)
  2870. {
  2871. sb.Append(prefix).Append("note").Append("=").Append(HttpUtility.UrlEncode(this.note, BaseConstants.ENCODING_FORMAT)).Append("&");
  2872. }
  2873. if (this.date != null)
  2874. {
  2875. sb.Append(prefix).Append("date").Append("=").Append(HttpUtility.UrlEncode(this.date, BaseConstants.ENCODING_FORMAT)).Append("&");
  2876. }
  2877. return sb.ToString();
  2878. }
  2879. /// <summary>
  2880. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  2881. /// </summary>
  2882. /// <param name="map">NVP map as returned by an API call</param>
  2883. /// <param name="prefix">NVP prefix for this class in the response</param>
  2884. /// <param name="index">For array elements, index of this element in the response</param>
  2885. /// <returns>
  2886. /// A new OtherPaymentRefundDetailsType object created from the passed in NVP map
  2887. /// </returns>
  2888. public static OtherPaymentRefundDetailsType CreateInstance(Dictionary<string, string> map, string prefix, int index)
  2889. {
  2890. OtherPaymentRefundDetailsType otherPaymentRefundDetailsType = null;
  2891. string key;
  2892. int i = 0;
  2893. if(index != -1)
  2894. {
  2895. if (prefix.Length > 0 && !prefix.EndsWith("."))
  2896. {
  2897. prefix = prefix + "(" + index + ").";
  2898. }
  2899. }
  2900. else
  2901. {
  2902. if (prefix.Length > 0 && !prefix.EndsWith("."))
  2903. {
  2904. prefix = prefix + ".";
  2905. }
  2906. }
  2907. key = prefix + "note";
  2908. if (map.ContainsKey(key))
  2909. {
  2910. otherPaymentRefundDetailsType = (otherPaymentRefundDetailsType == null) ? new OtherPaymentRefundDetailsType() : otherPaymentRefundDetailsType;
  2911. otherPaymentRefundDetailsType.note = map[key];
  2912. }
  2913. key = prefix + "date";
  2914. if (map.ContainsKey(key))
  2915. {
  2916. otherPaymentRefundDetailsType = (otherPaymentRefundDetailsType == null) ? new OtherPaymentRefundDetailsType() : otherPaymentRefundDetailsType;
  2917. otherPaymentRefundDetailsType.date = map[key];
  2918. }
  2919. return otherPaymentRefundDetailsType;
  2920. }
  2921. }
  2922. /// <summary>
  2923. /// Details of the paypal refund made against this invoice.
  2924. /// </summary>
  2925. public partial class PayPalPaymentRefundDetailsType {
  2926. // Default US culture info
  2927. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  2928. /// <summary>
  2929. ///
  2930. /// </summary>
  2931. private string dateField;
  2932. public string date
  2933. {
  2934. get
  2935. {
  2936. return this.dateField;
  2937. }
  2938. set
  2939. {
  2940. this.dateField = value;
  2941. }
  2942. }
  2943. /// <summary>
  2944. /// Default Constructor
  2945. /// </summary>
  2946. public PayPalPaymentRefundDetailsType()
  2947. {
  2948. }
  2949. /// <summary>
  2950. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  2951. /// </summary>
  2952. /// <param name="map">NVP map as returned by an API call</param>
  2953. /// <param name="prefix">NVP prefix for this class in the response</param>
  2954. /// <param name="index">For array elements, index of this element in the response</param>
  2955. /// <returns>
  2956. /// A new PayPalPaymentRefundDetailsType object created from the passed in NVP map
  2957. /// </returns>
  2958. public static PayPalPaymentRefundDetailsType CreateInstance(Dictionary<string, string> map, string prefix, int index)
  2959. {
  2960. PayPalPaymentRefundDetailsType payPalPaymentRefundDetailsType = null;
  2961. string key;
  2962. int i = 0;
  2963. if(index != -1)
  2964. {
  2965. if (prefix.Length > 0 && !prefix.EndsWith("."))
  2966. {
  2967. prefix = prefix + "(" + index + ").";
  2968. }
  2969. }
  2970. else
  2971. {
  2972. if (prefix.Length > 0 && !prefix.EndsWith("."))
  2973. {
  2974. prefix = prefix + ".";
  2975. }
  2976. }
  2977. key = prefix + "date";
  2978. if (map.ContainsKey(key))
  2979. {
  2980. payPalPaymentRefundDetailsType = (payPalPaymentRefundDetailsType == null) ? new PayPalPaymentRefundDetailsType() : payPalPaymentRefundDetailsType;
  2981. payPalPaymentRefundDetailsType.date = map[key];
  2982. }
  2983. return payPalPaymentRefundDetailsType;
  2984. }
  2985. }
  2986. /// <summary>
  2987. /// PayPal payment details about the invoice.
  2988. /// </summary>
  2989. public partial class PayPalPaymentDetailsType {
  2990. // Default US culture info
  2991. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  2992. /// <summary>
  2993. ///
  2994. /// </summary>
  2995. private string transactionIDField;
  2996. public string transactionID
  2997. {
  2998. get
  2999. {
  3000. return this.transactionIDField;
  3001. }
  3002. set
  3003. {
  3004. this.transactionIDField = value;
  3005. }
  3006. }
  3007. /// <summary>
  3008. ///
  3009. /// </summary>
  3010. private string dateField;
  3011. public string date
  3012. {
  3013. get
  3014. {
  3015. return this.dateField;
  3016. }
  3017. set
  3018. {
  3019. this.dateField = value;
  3020. }
  3021. }
  3022. /// <summary>
  3023. /// Default Constructor
  3024. /// </summary>
  3025. public PayPalPaymentDetailsType()
  3026. {
  3027. }
  3028. /// <summary>
  3029. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  3030. /// </summary>
  3031. /// <param name="map">NVP map as returned by an API call</param>
  3032. /// <param name="prefix">NVP prefix for this class in the response</param>
  3033. /// <param name="index">For array elements, index of this element in the response</param>
  3034. /// <returns>
  3035. /// A new PayPalPaymentDetailsType object created from the passed in NVP map
  3036. /// </returns>
  3037. public static PayPalPaymentDetailsType CreateInstance(Dictionary<string, string> map, string prefix, int index)
  3038. {
  3039. PayPalPaymentDetailsType payPalPaymentDetailsType = null;
  3040. string key;
  3041. int i = 0;
  3042. if(index != -1)
  3043. {
  3044. if (prefix.Length > 0 && !prefix.EndsWith("."))
  3045. {
  3046. prefix = prefix + "(" + index + ").";
  3047. }
  3048. }
  3049. else
  3050. {
  3051. if (prefix.Length > 0 && !prefix.EndsWith("."))
  3052. {
  3053. prefix = prefix + ".";
  3054. }
  3055. }
  3056. key = prefix + "transactionID";
  3057. if (map.ContainsKey(key))
  3058. {
  3059. payPalPaymentDetailsType = (payPalPaymentDetailsType == null) ? new PayPalPaymentDetailsType() : payPalPaymentDetailsType;
  3060. payPalPaymentDetailsType.transactionID = map[key];
  3061. }
  3062. key = prefix + "date";
  3063. if (map.ContainsKey(key))
  3064. {
  3065. payPalPaymentDetailsType = (payPalPaymentDetailsType == null) ? new PayPalPaymentDetailsType() : payPalPaymentDetailsType;
  3066. payPalPaymentDetailsType.date = map[key];
  3067. }
  3068. return payPalPaymentDetailsType;
  3069. }
  3070. }
  3071. /// <summary>
  3072. /// Offline payment details about the invoice.
  3073. /// </summary>
  3074. public partial class OtherPaymentDetailsType {
  3075. // Default US culture info
  3076. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  3077. /// <summary>
  3078. ///
  3079. /// </summary>
  3080. private PaymentMethodsType? methodField;
  3081. public PaymentMethodsType? method
  3082. {
  3083. get
  3084. {
  3085. return this.methodField;
  3086. }
  3087. set
  3088. {
  3089. this.methodField = value;
  3090. }
  3091. }
  3092. /// <summary>
  3093. ///
  3094. /// </summary>
  3095. private string noteField;
  3096. public string note
  3097. {
  3098. get
  3099. {
  3100. return this.noteField;
  3101. }
  3102. set
  3103. {
  3104. this.noteField = value;
  3105. }
  3106. }
  3107. /// <summary>
  3108. ///
  3109. /// </summary>
  3110. private string dateField;
  3111. public string date
  3112. {
  3113. get
  3114. {
  3115. return this.dateField;
  3116. }
  3117. set
  3118. {
  3119. this.dateField = value;
  3120. }
  3121. }
  3122. /// <summary>
  3123. /// Default Constructor
  3124. /// </summary>
  3125. public OtherPaymentDetailsType()
  3126. {
  3127. }
  3128. public string ToNVPString(string prefix)
  3129. {
  3130. StringBuilder sb = new StringBuilder();
  3131. if (this.method != null)
  3132. {
  3133. sb.Append(prefix).Append("method").Append("=").Append(EnumUtils.GetDescription(this.method));
  3134. sb.Append("&");
  3135. }
  3136. if (this.note != null)
  3137. {
  3138. sb.Append(prefix).Append("note").Append("=").Append(HttpUtility.UrlEncode(this.note, BaseConstants.ENCODING_FORMAT)).Append("&");
  3139. }
  3140. if (this.date != null)
  3141. {
  3142. sb.Append(prefix).Append("date").Append("=").Append(HttpUtility.UrlEncode(this.date, BaseConstants.ENCODING_FORMAT)).Append("&");
  3143. }
  3144. return sb.ToString();
  3145. }
  3146. /// <summary>
  3147. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  3148. /// </summary>
  3149. /// <param name="map">NVP map as returned by an API call</param>
  3150. /// <param name="prefix">NVP prefix for this class in the response</param>
  3151. /// <param name="index">For array elements, index of this element in the response</param>
  3152. /// <returns>
  3153. /// A new OtherPaymentDetailsType object created from the passed in NVP map
  3154. /// </returns>
  3155. public static OtherPaymentDetailsType CreateInstance(Dictionary<string, string> map, string prefix, int index)
  3156. {
  3157. OtherPaymentDetailsType otherPaymentDetailsType = null;
  3158. string key;
  3159. int i = 0;
  3160. if(index != -1)
  3161. {
  3162. if (prefix.Length > 0 && !prefix.EndsWith("."))
  3163. {
  3164. prefix = prefix + "(" + index + ").";
  3165. }
  3166. }
  3167. else
  3168. {
  3169. if (prefix.Length > 0 && !prefix.EndsWith("."))
  3170. {
  3171. prefix = prefix + ".";
  3172. }
  3173. }
  3174. key = prefix + "method";
  3175. if (map.ContainsKey(key))
  3176. {
  3177. otherPaymentDetailsType = (otherPaymentDetailsType == null) ? new OtherPaymentDetailsType() : otherPaymentDetailsType;
  3178. otherPaymentDetailsType.method = (PaymentMethodsType)EnumUtils.GetValue(map[key],typeof(PaymentMethodsType));
  3179. }
  3180. key = prefix + "note";
  3181. if (map.ContainsKey(key))
  3182. {
  3183. otherPaymentDetailsType = (otherPaymentDetailsType == null) ? new OtherPaymentDetailsType() : otherPaymentDetailsType;
  3184. otherPaymentDetailsType.note = map[key];
  3185. }
  3186. key = prefix + "date";
  3187. if (map.ContainsKey(key))
  3188. {
  3189. otherPaymentDetailsType = (otherPaymentDetailsType == null) ? new OtherPaymentDetailsType() : otherPaymentDetailsType;
  3190. otherPaymentDetailsType.date = map[key];
  3191. }
  3192. return otherPaymentDetailsType;
  3193. }
  3194. }
  3195. /// <summary>
  3196. /// Payment details about the invoice.
  3197. /// </summary>
  3198. public partial class PaymentDetailsType {
  3199. // Default US culture info
  3200. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  3201. /// <summary>
  3202. ///
  3203. /// </summary>
  3204. private bool? viaPayPalField;
  3205. public bool? viaPayPal
  3206. {
  3207. get
  3208. {
  3209. return this.viaPayPalField;
  3210. }
  3211. set
  3212. {
  3213. this.viaPayPalField = value;
  3214. }
  3215. }
  3216. /// <summary>
  3217. ///
  3218. /// </summary>
  3219. private PayPalPaymentDetailsType paypalPaymentField;
  3220. public PayPalPaymentDetailsType paypalPayment
  3221. {
  3222. get
  3223. {
  3224. return this.paypalPaymentField;
  3225. }
  3226. set
  3227. {
  3228. this.paypalPaymentField = value;
  3229. }
  3230. }
  3231. /// <summary>
  3232. ///
  3233. /// </summary>
  3234. private OtherPaymentDetailsType otherPaymentField;
  3235. public OtherPaymentDetailsType otherPayment
  3236. {
  3237. get
  3238. {
  3239. return this.otherPaymentField;
  3240. }
  3241. set
  3242. {
  3243. this.otherPaymentField = value;
  3244. }
  3245. }
  3246. /// <summary>
  3247. /// Default Constructor
  3248. /// </summary>
  3249. public PaymentDetailsType()
  3250. {
  3251. }
  3252. /// <summary>
  3253. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  3254. /// </summary>
  3255. /// <param name="map">NVP map as returned by an API call</param>
  3256. /// <param name="prefix">NVP prefix for this class in the response</param>
  3257. /// <param name="index">For array elements, index of this element in the response</param>
  3258. /// <returns>
  3259. /// A new PaymentDetailsType object created from the passed in NVP map
  3260. /// </returns>
  3261. public static PaymentDetailsType CreateInstance(Dictionary<string, string> map, string prefix, int index)
  3262. {
  3263. PaymentDetailsType paymentDetailsType = null;
  3264. string key;
  3265. int i = 0;
  3266. if(index != -1)
  3267. {
  3268. if (prefix.Length > 0 && !prefix.EndsWith("."))
  3269. {
  3270. prefix = prefix + "(" + index + ").";
  3271. }
  3272. }
  3273. else
  3274. {
  3275. if (prefix.Length > 0 && !prefix.EndsWith("."))
  3276. {
  3277. prefix = prefix + ".";
  3278. }
  3279. }
  3280. key = prefix + "viaPayPal";
  3281. if (map.ContainsKey(key))
  3282. {
  3283. paymentDetailsType = (paymentDetailsType == null) ? new PaymentDetailsType() : paymentDetailsType;
  3284. paymentDetailsType.viaPayPal = System.Convert.ToBoolean(map[key], DefaultCulture);
  3285. }
  3286. PayPalPaymentDetailsType paypalPayment = PayPalPaymentDetailsType.CreateInstance(map, prefix + "paypalPayment", -1);
  3287. if (paypalPayment != null)
  3288. {
  3289. paymentDetailsType = (paymentDetailsType == null) ? new PaymentDetailsType() : paymentDetailsType;
  3290. paymentDetailsType.paypalPayment = paypalPayment;
  3291. }
  3292. OtherPaymentDetailsType otherPayment = OtherPaymentDetailsType.CreateInstance(map, prefix + "otherPayment", -1);
  3293. if (otherPayment != null)
  3294. {
  3295. paymentDetailsType = (paymentDetailsType == null) ? new PaymentDetailsType() : paymentDetailsType;
  3296. paymentDetailsType.otherPayment = otherPayment;
  3297. }
  3298. return paymentDetailsType;
  3299. }
  3300. }
  3301. /// <summary>
  3302. /// Determines an inclusive date range.
  3303. /// </summary>
  3304. public partial class DateRangeType {
  3305. // Default US culture info
  3306. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  3307. /// <summary>
  3308. ///
  3309. /// </summary>
  3310. private string startDateField;
  3311. public string startDate
  3312. {
  3313. get
  3314. {
  3315. return this.startDateField;
  3316. }
  3317. set
  3318. {
  3319. this.startDateField = value;
  3320. }
  3321. }
  3322. /// <summary>
  3323. ///
  3324. /// </summary>
  3325. private string endDateField;
  3326. public string endDate
  3327. {
  3328. get
  3329. {
  3330. return this.endDateField;
  3331. }
  3332. set
  3333. {
  3334. this.endDateField = value;
  3335. }
  3336. }
  3337. /// <summary>
  3338. /// Default Constructor
  3339. /// </summary>
  3340. public DateRangeType()
  3341. {
  3342. }
  3343. public string ToNVPString(string prefix)
  3344. {
  3345. StringBuilder sb = new StringBuilder();
  3346. if (this.startDate != null)
  3347. {
  3348. sb.Append(prefix).Append("startDate").Append("=").Append(HttpUtility.UrlEncode(this.startDate, BaseConstants.ENCODING_FORMAT)).Append("&");
  3349. }
  3350. if (this.endDate != null)
  3351. {
  3352. sb.Append(prefix).Append("endDate").Append("=").Append(HttpUtility.UrlEncode(this.endDate, BaseConstants.ENCODING_FORMAT)).Append("&");
  3353. }
  3354. return sb.ToString();
  3355. }
  3356. }
  3357. /// <summary>
  3358. /// Search parameters criteria.
  3359. /// </summary>
  3360. public partial class SearchParametersType {
  3361. // Default US culture info
  3362. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  3363. /// <summary>
  3364. ///
  3365. /// </summary>
  3366. private string emailField;
  3367. public string email
  3368. {
  3369. get
  3370. {
  3371. return this.emailField;
  3372. }
  3373. set
  3374. {
  3375. this.emailField = value;
  3376. }
  3377. }
  3378. /// <summary>
  3379. ///
  3380. /// </summary>
  3381. private string recipientNameField;
  3382. public string recipientName
  3383. {
  3384. get
  3385. {
  3386. return this.recipientNameField;
  3387. }
  3388. set
  3389. {
  3390. this.recipientNameField = value;
  3391. }
  3392. }
  3393. /// <summary>
  3394. ///
  3395. /// </summary>
  3396. private string businessNameField;
  3397. public string businessName
  3398. {
  3399. get
  3400. {
  3401. return this.businessNameField;
  3402. }
  3403. set
  3404. {
  3405. this.businessNameField = value;
  3406. }
  3407. }
  3408. /// <summary>
  3409. ///
  3410. /// </summary>
  3411. private string invoiceNumberField;
  3412. public string invoiceNumber
  3413. {
  3414. get
  3415. {
  3416. return this.invoiceNumberField;
  3417. }
  3418. set
  3419. {
  3420. this.invoiceNumberField = value;
  3421. }
  3422. }
  3423. /// <summary>
  3424. ///
  3425. /// </summary>
  3426. private List<StatusType?> statusField = new List<StatusType?>();
  3427. public List<StatusType?> status
  3428. {
  3429. get
  3430. {
  3431. return this.statusField;
  3432. }
  3433. set
  3434. {
  3435. this.statusField = value;
  3436. }
  3437. }
  3438. /// <summary>
  3439. ///
  3440. /// </summary>
  3441. private decimal? lowerAmountField;
  3442. public decimal? lowerAmount
  3443. {
  3444. get
  3445. {
  3446. return this.lowerAmountField;
  3447. }
  3448. set
  3449. {
  3450. this.lowerAmountField = value;
  3451. }
  3452. }
  3453. /// <summary>
  3454. ///
  3455. /// </summary>
  3456. private decimal? upperAmountField;
  3457. public decimal? upperAmount
  3458. {
  3459. get
  3460. {
  3461. return this.upperAmountField;
  3462. }
  3463. set
  3464. {
  3465. this.upperAmountField = value;
  3466. }
  3467. }
  3468. /// <summary>
  3469. ///
  3470. /// </summary>
  3471. private string currencyCodeField;
  3472. public string currencyCode
  3473. {
  3474. get
  3475. {
  3476. return this.currencyCodeField;
  3477. }
  3478. set
  3479. {
  3480. this.currencyCodeField = value;
  3481. }
  3482. }
  3483. /// <summary>
  3484. ///
  3485. /// </summary>
  3486. private string memoField;
  3487. public string memo
  3488. {
  3489. get
  3490. {
  3491. return this.memoField;
  3492. }
  3493. set
  3494. {
  3495. this.memoField = value;
  3496. }
  3497. }
  3498. /// <summary>
  3499. ///
  3500. /// </summary>
  3501. private OriginType? originField;
  3502. public OriginType? origin
  3503. {
  3504. get
  3505. {
  3506. return this.originField;
  3507. }
  3508. set
  3509. {
  3510. this.originField = value;
  3511. }
  3512. }
  3513. /// <summary>
  3514. ///
  3515. /// </summary>
  3516. private DateRangeType invoiceDateField;
  3517. public DateRangeType invoiceDate
  3518. {
  3519. get
  3520. {
  3521. return this.invoiceDateField;
  3522. }
  3523. set
  3524. {
  3525. this.invoiceDateField = value;
  3526. }
  3527. }
  3528. /// <summary>
  3529. ///
  3530. /// </summary>
  3531. private DateRangeType dueDateField;
  3532. public DateRangeType dueDate
  3533. {
  3534. get
  3535. {
  3536. return this.dueDateField;
  3537. }
  3538. set
  3539. {
  3540. this.dueDateField = value;
  3541. }
  3542. }
  3543. /// <summary>
  3544. ///
  3545. /// </summary>
  3546. private DateRangeType paymentDateField;
  3547. public DateRangeType paymentDate
  3548. {
  3549. get
  3550. {
  3551. return this.paymentDateField;
  3552. }
  3553. set
  3554. {
  3555. this.paymentDateField = value;
  3556. }
  3557. }
  3558. /// <summary>
  3559. ///
  3560. /// </summary>
  3561. private DateRangeType creationDateField;
  3562. public DateRangeType creationDate
  3563. {
  3564. get
  3565. {
  3566. return this.creationDateField;
  3567. }
  3568. set
  3569. {
  3570. this.creationDateField = value;
  3571. }
  3572. }
  3573. /// <summary>
  3574. /// Default Constructor
  3575. /// </summary>
  3576. public SearchParametersType()
  3577. {
  3578. }
  3579. public string ToNVPString(string prefix)
  3580. {
  3581. StringBuilder sb = new StringBuilder();
  3582. if (this.email != null)
  3583. {
  3584. sb.Append(prefix).Append("email").Append("=").Append(HttpUtility.UrlEncode(this.email, BaseConstants.ENCODING_FORMAT)).Append("&");
  3585. }
  3586. if (this.recipientName != null)
  3587. {
  3588. sb.Append(prefix).Append("recipientName").Append("=").Append(HttpUtility.UrlEncode(this.recipientName, BaseConstants.ENCODING_FORMAT)).Append("&");
  3589. }
  3590. if (this.businessName != null)
  3591. {
  3592. sb.Append(prefix).Append("businessName").Append("=").Append(HttpUtility.UrlEncode(this.businessName, BaseConstants.ENCODING_FORMAT)).Append("&");
  3593. }
  3594. if (this.invoiceNumber != null)
  3595. {
  3596. sb.Append(prefix).Append("invoiceNumber").Append("=").Append(HttpUtility.UrlEncode(this.invoiceNumber, BaseConstants.ENCODING_FORMAT)).Append("&");
  3597. }
  3598. for (int i = 0; i < this.status.Count; i++)
  3599. {
  3600. if (this.status[i] != null)
  3601. {
  3602. sb.Append(prefix).Append("status(").Append(i).Append(")=").Append(EnumUtils.GetDescription(this.status[i]));
  3603. sb.Append("&");
  3604. }
  3605. }
  3606. if (this.lowerAmount != null)
  3607. {
  3608. sb.Append(prefix).Append("lowerAmount").Append("=").Append(Convert.ToString(this.lowerAmount, DefaultCulture)).Append("&");
  3609. }
  3610. if (this.upperAmount != null)
  3611. {
  3612. sb.Append(prefix).Append("upperAmount").Append("=").Append(Convert.ToString(this.upperAmount, DefaultCulture)).Append("&");
  3613. }
  3614. if (this.currencyCode != null)
  3615. {
  3616. sb.Append(prefix).Append("currencyCode").Append("=").Append(HttpUtility.UrlEncode(this.currencyCode, BaseConstants.ENCODING_FORMAT)).Append("&");
  3617. }
  3618. if (this.memo != null)
  3619. {
  3620. sb.Append(prefix).Append("memo").Append("=").Append(HttpUtility.UrlEncode(this.memo, BaseConstants.ENCODING_FORMAT)).Append("&");
  3621. }
  3622. if (this.origin != null)
  3623. {
  3624. sb.Append(prefix).Append("origin").Append("=").Append(EnumUtils.GetDescription(this.origin));
  3625. sb.Append("&");
  3626. }
  3627. if (this.invoiceDate != null)
  3628. {
  3629. string newPrefix = prefix + "invoiceDate" + ".";
  3630. sb.Append(this.invoiceDateField.ToNVPString(newPrefix));
  3631. }
  3632. if (this.dueDate != null)
  3633. {
  3634. string newPrefix = prefix + "dueDate" + ".";
  3635. sb.Append(this.dueDateField.ToNVPString(newPrefix));
  3636. }
  3637. if (this.paymentDate != null)
  3638. {
  3639. string newPrefix = prefix + "paymentDate" + ".";
  3640. sb.Append(this.paymentDateField.ToNVPString(newPrefix));
  3641. }
  3642. if (this.creationDate != null)
  3643. {
  3644. string newPrefix = prefix + "creationDate" + ".";
  3645. sb.Append(this.creationDateField.ToNVPString(newPrefix));
  3646. }
  3647. return sb.ToString();
  3648. }
  3649. }
  3650. /// <summary>
  3651. /// Summary of invoice information.
  3652. /// </summary>
  3653. public partial class InvoiceSummaryType {
  3654. // Default US culture info
  3655. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  3656. /// <summary>
  3657. ///
  3658. /// </summary>
  3659. private string invoiceIDField;
  3660. public string invoiceID
  3661. {
  3662. get
  3663. {
  3664. return this.invoiceIDField;
  3665. }
  3666. set
  3667. {
  3668. this.invoiceIDField = value;
  3669. }
  3670. }
  3671. /// <summary>
  3672. ///
  3673. /// </summary>
  3674. private string merchantEmailField;
  3675. public string merchantEmail
  3676. {
  3677. get
  3678. {
  3679. return this.merchantEmailField;
  3680. }
  3681. set
  3682. {
  3683. this.merchantEmailField = value;
  3684. }
  3685. }
  3686. /// <summary>
  3687. ///
  3688. /// </summary>
  3689. private string payerEmailField;
  3690. public string payerEmail
  3691. {
  3692. get
  3693. {
  3694. return this.payerEmailField;
  3695. }
  3696. set
  3697. {
  3698. this.payerEmailField = value;
  3699. }
  3700. }
  3701. /// <summary>
  3702. ///
  3703. /// </summary>
  3704. private string numberField;
  3705. public string number
  3706. {
  3707. get
  3708. {
  3709. return this.numberField;
  3710. }
  3711. set
  3712. {
  3713. this.numberField = value;
  3714. }
  3715. }
  3716. /// <summary>
  3717. ///
  3718. /// </summary>
  3719. private string billingBusinessNameField;
  3720. public string billingBusinessName
  3721. {
  3722. get
  3723. {
  3724. return this.billingBusinessNameField;
  3725. }
  3726. set
  3727. {
  3728. this.billingBusinessNameField = value;
  3729. }
  3730. }
  3731. /// <summary>
  3732. ///
  3733. /// </summary>
  3734. private string billingFirstNameField;
  3735. public string billingFirstName
  3736. {
  3737. get
  3738. {
  3739. return this.billingFirstNameField;
  3740. }
  3741. set
  3742. {
  3743. this.billingFirstNameField = value;
  3744. }
  3745. }
  3746. /// <summary>
  3747. ///
  3748. /// </summary>
  3749. private string billingLastNameField;
  3750. public string billingLastName
  3751. {
  3752. get
  3753. {
  3754. return this.billingLastNameField;
  3755. }
  3756. set
  3757. {
  3758. this.billingLastNameField = value;
  3759. }
  3760. }
  3761. /// <summary>
  3762. ///
  3763. /// </summary>
  3764. private string shippingBusinessNameField;
  3765. public string shippingBusinessName
  3766. {
  3767. get
  3768. {
  3769. return this.shippingBusinessNameField;
  3770. }
  3771. set
  3772. {
  3773. this.shippingBusinessNameField = value;
  3774. }
  3775. }
  3776. /// <summary>
  3777. ///
  3778. /// </summary>
  3779. private string shippingFirstNameField;
  3780. public string shippingFirstName
  3781. {
  3782. get
  3783. {
  3784. return this.shippingFirstNameField;
  3785. }
  3786. set
  3787. {
  3788. this.shippingFirstNameField = value;
  3789. }
  3790. }
  3791. /// <summary>
  3792. ///
  3793. /// </summary>
  3794. private string shippingLastNameField;
  3795. public string shippingLastName
  3796. {
  3797. get
  3798. {
  3799. return this.shippingLastNameField;
  3800. }
  3801. set
  3802. {
  3803. this.shippingLastNameField = value;
  3804. }
  3805. }
  3806. /// <summary>
  3807. ///
  3808. /// </summary>
  3809. private decimal? totalAmountField;
  3810. public decimal? totalAmount
  3811. {
  3812. get
  3813. {
  3814. return this.totalAmountField;
  3815. }
  3816. set
  3817. {
  3818. this.totalAmountField = value;
  3819. }
  3820. }
  3821. /// <summary>
  3822. ///
  3823. /// </summary>
  3824. private string currencyCodeField;
  3825. public string currencyCode
  3826. {
  3827. get
  3828. {
  3829. return this.currencyCodeField;
  3830. }
  3831. set
  3832. {
  3833. this.currencyCodeField = value;
  3834. }
  3835. }
  3836. /// <summary>
  3837. ///
  3838. /// </summary>
  3839. private string invoiceDateField;
  3840. public string invoiceDate
  3841. {
  3842. get
  3843. {
  3844. return this.invoiceDateField;
  3845. }
  3846. set
  3847. {
  3848. this.invoiceDateField = value;
  3849. }
  3850. }
  3851. /// <summary>
  3852. ///
  3853. /// </summary>
  3854. private string dueDateField;
  3855. public string dueDate
  3856. {
  3857. get
  3858. {
  3859. return this.dueDateField;
  3860. }
  3861. set
  3862. {
  3863. this.dueDateField = value;
  3864. }
  3865. }
  3866. /// <summary>
  3867. ///
  3868. /// </summary>
  3869. private StatusType? statusField;
  3870. public StatusType? status
  3871. {
  3872. get
  3873. {
  3874. return this.statusField;
  3875. }
  3876. set
  3877. {
  3878. this.statusField = value;
  3879. }
  3880. }
  3881. /// <summary>
  3882. ///
  3883. /// </summary>
  3884. private OriginType? originField;
  3885. public OriginType? origin
  3886. {
  3887. get
  3888. {
  3889. return this.originField;
  3890. }
  3891. set
  3892. {
  3893. this.originField = value;
  3894. }
  3895. }
  3896. /// <summary>
  3897. ///
  3898. /// </summary>
  3899. private string referrerCodeField;
  3900. public string referrerCode
  3901. {
  3902. get
  3903. {
  3904. return this.referrerCodeField;
  3905. }
  3906. set
  3907. {
  3908. this.referrerCodeField = value;
  3909. }
  3910. }
  3911. /// <summary>
  3912. /// Default Constructor
  3913. /// </summary>
  3914. public InvoiceSummaryType()
  3915. {
  3916. }
  3917. /// <summary>
  3918. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  3919. /// </summary>
  3920. /// <param name="map">NVP map as returned by an API call</param>
  3921. /// <param name="prefix">NVP prefix for this class in the response</param>
  3922. /// <param name="index">For array elements, index of this element in the response</param>
  3923. /// <returns>
  3924. /// A new InvoiceSummaryType object created from the passed in NVP map
  3925. /// </returns>
  3926. public static InvoiceSummaryType CreateInstance(Dictionary<string, string> map, string prefix, int index)
  3927. {
  3928. InvoiceSummaryType invoiceSummaryType = null;
  3929. string key;
  3930. int i = 0;
  3931. if(index != -1)
  3932. {
  3933. if (prefix.Length > 0 && !prefix.EndsWith("."))
  3934. {
  3935. prefix = prefix + "(" + index + ").";
  3936. }
  3937. }
  3938. else
  3939. {
  3940. if (prefix.Length > 0 && !prefix.EndsWith("."))
  3941. {
  3942. prefix = prefix + ".";
  3943. }
  3944. }
  3945. key = prefix + "invoiceID";
  3946. if (map.ContainsKey(key))
  3947. {
  3948. invoiceSummaryType = (invoiceSummaryType == null) ? new InvoiceSummaryType() : invoiceSummaryType;
  3949. invoiceSummaryType.invoiceID = map[key];
  3950. }
  3951. key = prefix + "merchantEmail";
  3952. if (map.ContainsKey(key))
  3953. {
  3954. invoiceSummaryType = (invoiceSummaryType == null) ? new InvoiceSummaryType() : invoiceSummaryType;
  3955. invoiceSummaryType.merchantEmail = map[key];
  3956. }
  3957. key = prefix + "payerEmail";
  3958. if (map.ContainsKey(key))
  3959. {
  3960. invoiceSummaryType = (invoiceSummaryType == null) ? new InvoiceSummaryType() : invoiceSummaryType;
  3961. invoiceSummaryType.payerEmail = map[key];
  3962. }
  3963. key = prefix + "number";
  3964. if (map.ContainsKey(key))
  3965. {
  3966. invoiceSummaryType = (invoiceSummaryType == null) ? new InvoiceSummaryType() : invoiceSummaryType;
  3967. invoiceSummaryType.number = map[key];
  3968. }
  3969. key = prefix + "billingBusinessName";
  3970. if (map.ContainsKey(key))
  3971. {
  3972. invoiceSummaryType = (invoiceSummaryType == null) ? new InvoiceSummaryType() : invoiceSummaryType;
  3973. invoiceSummaryType.billingBusinessName = map[key];
  3974. }
  3975. key = prefix + "billingFirstName";
  3976. if (map.ContainsKey(key))
  3977. {
  3978. invoiceSummaryType = (invoiceSummaryType == null) ? new InvoiceSummaryType() : invoiceSummaryType;
  3979. invoiceSummaryType.billingFirstName = map[key];
  3980. }
  3981. key = prefix + "billingLastName";
  3982. if (map.ContainsKey(key))
  3983. {
  3984. invoiceSummaryType = (invoiceSummaryType == null) ? new InvoiceSummaryType() : invoiceSummaryType;
  3985. invoiceSummaryType.billingLastName = map[key];
  3986. }
  3987. key = prefix + "shippingBusinessName";
  3988. if (map.ContainsKey(key))
  3989. {
  3990. invoiceSummaryType = (invoiceSummaryType == null) ? new InvoiceSummaryType() : invoiceSummaryType;
  3991. invoiceSummaryType.shippingBusinessName = map[key];
  3992. }
  3993. key = prefix + "shippingFirstName";
  3994. if (map.ContainsKey(key))
  3995. {
  3996. invoiceSummaryType = (invoiceSummaryType == null) ? new InvoiceSummaryType() : invoiceSummaryType;
  3997. invoiceSummaryType.shippingFirstName = map[key];
  3998. }
  3999. key = prefix + "shippingLastName";
  4000. if (map.ContainsKey(key))
  4001. {
  4002. invoiceSummaryType = (invoiceSummaryType == null) ? new InvoiceSummaryType() : invoiceSummaryType;
  4003. invoiceSummaryType.shippingLastName = map[key];
  4004. }
  4005. key = prefix + "totalAmount";
  4006. if (map.ContainsKey(key))
  4007. {
  4008. invoiceSummaryType = (invoiceSummaryType == null) ? new InvoiceSummaryType() : invoiceSummaryType;
  4009. invoiceSummaryType.totalAmount = System.Convert.ToDecimal(map[key], DefaultCulture);
  4010. }
  4011. key = prefix + "currencyCode";
  4012. if (map.ContainsKey(key))
  4013. {
  4014. invoiceSummaryType = (invoiceSummaryType == null) ? new InvoiceSummaryType() : invoiceSummaryType;
  4015. invoiceSummaryType.currencyCode = map[key];
  4016. }
  4017. key = prefix + "invoiceDate";
  4018. if (map.ContainsKey(key))
  4019. {
  4020. invoiceSummaryType = (invoiceSummaryType == null) ? new InvoiceSummaryType() : invoiceSummaryType;
  4021. invoiceSummaryType.invoiceDate = map[key];
  4022. }
  4023. key = prefix + "dueDate";
  4024. if (map.ContainsKey(key))
  4025. {
  4026. invoiceSummaryType = (invoiceSummaryType == null) ? new InvoiceSummaryType() : invoiceSummaryType;
  4027. invoiceSummaryType.dueDate = map[key];
  4028. }
  4029. key = prefix + "status";
  4030. if (map.ContainsKey(key))
  4031. {
  4032. invoiceSummaryType = (invoiceSummaryType == null) ? new InvoiceSummaryType() : invoiceSummaryType;
  4033. invoiceSummaryType.status = (StatusType)EnumUtils.GetValue(map[key],typeof(StatusType));
  4034. }
  4035. key = prefix + "origin";
  4036. if (map.ContainsKey(key))
  4037. {
  4038. invoiceSummaryType = (invoiceSummaryType == null) ? new InvoiceSummaryType() : invoiceSummaryType;
  4039. invoiceSummaryType.origin = (OriginType)EnumUtils.GetValue(map[key],typeof(OriginType));
  4040. }
  4041. key = prefix + "referrerCode";
  4042. if (map.ContainsKey(key))
  4043. {
  4044. invoiceSummaryType = (invoiceSummaryType == null) ? new InvoiceSummaryType() : invoiceSummaryType;
  4045. invoiceSummaryType.referrerCode = map[key];
  4046. }
  4047. return invoiceSummaryType;
  4048. }
  4049. }
  4050. /// <summary>
  4051. /// A list of invoice summaries.
  4052. /// </summary>
  4053. public partial class InvoiceSummaryListType {
  4054. // Default US culture info
  4055. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  4056. /// <summary>
  4057. ///
  4058. /// </summary>
  4059. private List<InvoiceSummaryType> invoiceField = new List<InvoiceSummaryType>();
  4060. public List<InvoiceSummaryType> invoice
  4061. {
  4062. get
  4063. {
  4064. return this.invoiceField;
  4065. }
  4066. set
  4067. {
  4068. this.invoiceField = value;
  4069. }
  4070. }
  4071. /// <summary>
  4072. /// Default Constructor
  4073. /// </summary>
  4074. public InvoiceSummaryListType()
  4075. {
  4076. }
  4077. /// <summary>
  4078. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  4079. /// </summary>
  4080. /// <param name="map">NVP map as returned by an API call</param>
  4081. /// <param name="prefix">NVP prefix for this class in the response</param>
  4082. /// <param name="index">For array elements, index of this element in the response</param>
  4083. /// <returns>
  4084. /// A new InvoiceSummaryListType object created from the passed in NVP map
  4085. /// </returns>
  4086. public static InvoiceSummaryListType CreateInstance(Dictionary<string, string> map, string prefix, int index)
  4087. {
  4088. InvoiceSummaryListType invoiceSummaryListType = null;
  4089. string key;
  4090. int i = 0;
  4091. if(index != -1)
  4092. {
  4093. if (prefix.Length > 0 && !prefix.EndsWith("."))
  4094. {
  4095. prefix = prefix + "(" + index + ").";
  4096. }
  4097. }
  4098. else
  4099. {
  4100. if (prefix.Length > 0 && !prefix.EndsWith("."))
  4101. {
  4102. prefix = prefix + ".";
  4103. }
  4104. }
  4105. i = 0;
  4106. while(true)
  4107. {
  4108. InvoiceSummaryType invoice = InvoiceSummaryType.CreateInstance(map, prefix + "invoice", i);
  4109. if (invoice != null)
  4110. {
  4111. invoiceSummaryListType = (invoiceSummaryListType == null) ? new InvoiceSummaryListType() : invoiceSummaryListType;
  4112. invoiceSummaryListType.invoice.Add(invoice);
  4113. i++;
  4114. }
  4115. else
  4116. {
  4117. break;
  4118. }
  4119. }
  4120. return invoiceSummaryListType;
  4121. }
  4122. }
  4123. /// <summary>
  4124. /// The request object for CreateInvoice.
  4125. /// </summary>
  4126. public partial class CreateInvoiceRequest {
  4127. // Default US culture info
  4128. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  4129. /// <summary>
  4130. ///
  4131. /// </summary>
  4132. private RequestEnvelope requestEnvelopeField;
  4133. public RequestEnvelope requestEnvelope
  4134. {
  4135. get
  4136. {
  4137. return this.requestEnvelopeField;
  4138. }
  4139. set
  4140. {
  4141. this.requestEnvelopeField = value;
  4142. }
  4143. }
  4144. /// <summary>
  4145. ///
  4146. /// </summary>
  4147. private InvoiceType invoiceField;
  4148. public InvoiceType invoice
  4149. {
  4150. get
  4151. {
  4152. return this.invoiceField;
  4153. }
  4154. set
  4155. {
  4156. this.invoiceField = value;
  4157. }
  4158. }
  4159. /// <summary>
  4160. /// Constructor with arguments
  4161. /// </summary>
  4162. public CreateInvoiceRequest(RequestEnvelope requestEnvelope, InvoiceType invoice)
  4163. {
  4164. this.requestEnvelope = requestEnvelope;
  4165. this.invoice = invoice;
  4166. }
  4167. /// <summary>
  4168. /// Default Constructor
  4169. /// </summary>
  4170. public CreateInvoiceRequest()
  4171. {
  4172. }
  4173. public string ToNVPString(string prefix)
  4174. {
  4175. StringBuilder sb = new StringBuilder();
  4176. if (this.requestEnvelope != null)
  4177. {
  4178. string newPrefix = prefix + "requestEnvelope" + ".";
  4179. sb.Append(this.requestEnvelopeField.ToNVPString(newPrefix));
  4180. }
  4181. if (this.invoice != null)
  4182. {
  4183. string newPrefix = prefix + "invoice" + ".";
  4184. sb.Append(this.invoiceField.ToNVPString(newPrefix));
  4185. }
  4186. return sb.ToString();
  4187. }
  4188. }
  4189. /// <summary>
  4190. /// The response object for CreateInvoice.
  4191. /// </summary>
  4192. public partial class CreateInvoiceResponse {
  4193. // Default US culture info
  4194. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  4195. /// <summary>
  4196. ///
  4197. /// </summary>
  4198. private ResponseEnvelope responseEnvelopeField;
  4199. public ResponseEnvelope responseEnvelope
  4200. {
  4201. get
  4202. {
  4203. return this.responseEnvelopeField;
  4204. }
  4205. set
  4206. {
  4207. this.responseEnvelopeField = value;
  4208. }
  4209. }
  4210. /// <summary>
  4211. ///
  4212. /// </summary>
  4213. private string invoiceIDField;
  4214. public string invoiceID
  4215. {
  4216. get
  4217. {
  4218. return this.invoiceIDField;
  4219. }
  4220. set
  4221. {
  4222. this.invoiceIDField = value;
  4223. }
  4224. }
  4225. /// <summary>
  4226. ///
  4227. /// </summary>
  4228. private string invoiceNumberField;
  4229. public string invoiceNumber
  4230. {
  4231. get
  4232. {
  4233. return this.invoiceNumberField;
  4234. }
  4235. set
  4236. {
  4237. this.invoiceNumberField = value;
  4238. }
  4239. }
  4240. /// <summary>
  4241. ///
  4242. /// </summary>
  4243. private string invoiceURLField;
  4244. public string invoiceURL
  4245. {
  4246. get
  4247. {
  4248. return this.invoiceURLField;
  4249. }
  4250. set
  4251. {
  4252. this.invoiceURLField = value;
  4253. }
  4254. }
  4255. /// <summary>
  4256. ///
  4257. /// </summary>
  4258. private long? totalAmountField;
  4259. public long? totalAmount
  4260. {
  4261. get
  4262. {
  4263. return this.totalAmountField;
  4264. }
  4265. set
  4266. {
  4267. this.totalAmountField = value;
  4268. }
  4269. }
  4270. /// <summary>
  4271. ///
  4272. /// </summary>
  4273. private List<ErrorData> errorField = new List<ErrorData>();
  4274. public List<ErrorData> error
  4275. {
  4276. get
  4277. {
  4278. return this.errorField;
  4279. }
  4280. set
  4281. {
  4282. this.errorField = value;
  4283. }
  4284. }
  4285. /// <summary>
  4286. /// Default Constructor
  4287. /// </summary>
  4288. public CreateInvoiceResponse()
  4289. {
  4290. }
  4291. /// <summary>
  4292. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  4293. /// </summary>
  4294. /// <param name="map">NVP map as returned by an API call</param>
  4295. /// <param name="prefix">NVP prefix for this class in the response</param>
  4296. /// <param name="index">For array elements, index of this element in the response</param>
  4297. /// <returns>
  4298. /// A new CreateInvoiceResponse object created from the passed in NVP map
  4299. /// </returns>
  4300. public static CreateInvoiceResponse CreateInstance(Dictionary<string, string> map, string prefix, int index)
  4301. {
  4302. CreateInvoiceResponse createInvoiceResponse = null;
  4303. string key;
  4304. int i = 0;
  4305. if(index != -1)
  4306. {
  4307. if (prefix.Length > 0 && !prefix.EndsWith("."))
  4308. {
  4309. prefix = prefix + "(" + index + ").";
  4310. }
  4311. }
  4312. else
  4313. {
  4314. if (prefix.Length > 0 && !prefix.EndsWith("."))
  4315. {
  4316. prefix = prefix + ".";
  4317. }
  4318. }
  4319. ResponseEnvelope responseEnvelope = ResponseEnvelope.CreateInstance(map, prefix + "responseEnvelope", -1);
  4320. if (responseEnvelope != null)
  4321. {
  4322. createInvoiceResponse = (createInvoiceResponse == null) ? new CreateInvoiceResponse() : createInvoiceResponse;
  4323. createInvoiceResponse.responseEnvelope = responseEnvelope;
  4324. }
  4325. key = prefix + "invoiceID";
  4326. if (map.ContainsKey(key))
  4327. {
  4328. createInvoiceResponse = (createInvoiceResponse == null) ? new CreateInvoiceResponse() : createInvoiceResponse;
  4329. createInvoiceResponse.invoiceID = map[key];
  4330. }
  4331. key = prefix + "invoiceNumber";
  4332. if (map.ContainsKey(key))
  4333. {
  4334. createInvoiceResponse = (createInvoiceResponse == null) ? new CreateInvoiceResponse() : createInvoiceResponse;
  4335. createInvoiceResponse.invoiceNumber = map[key];
  4336. }
  4337. key = prefix + "invoiceURL";
  4338. if (map.ContainsKey(key))
  4339. {
  4340. createInvoiceResponse = (createInvoiceResponse == null) ? new CreateInvoiceResponse() : createInvoiceResponse;
  4341. createInvoiceResponse.invoiceURL = map[key];
  4342. }
  4343. key = prefix + "totalAmount";
  4344. if (map.ContainsKey(key))
  4345. {
  4346. createInvoiceResponse = (createInvoiceResponse == null) ? new CreateInvoiceResponse() : createInvoiceResponse;
  4347. createInvoiceResponse.totalAmount = System.Convert.ToInt64(map[key], DefaultCulture);
  4348. }
  4349. i = 0;
  4350. while(true)
  4351. {
  4352. ErrorData error = ErrorData.CreateInstance(map, prefix + "error", i);
  4353. if (error != null)
  4354. {
  4355. createInvoiceResponse = (createInvoiceResponse == null) ? new CreateInvoiceResponse() : createInvoiceResponse;
  4356. createInvoiceResponse.error.Add(error);
  4357. i++;
  4358. }
  4359. else
  4360. {
  4361. break;
  4362. }
  4363. }
  4364. return createInvoiceResponse;
  4365. }
  4366. }
  4367. /// <summary>
  4368. /// The request object for SendInvoice.
  4369. /// </summary>
  4370. public partial class SendInvoiceRequest {
  4371. // Default US culture info
  4372. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  4373. /// <summary>
  4374. ///
  4375. /// </summary>
  4376. private RequestEnvelope requestEnvelopeField;
  4377. public RequestEnvelope requestEnvelope
  4378. {
  4379. get
  4380. {
  4381. return this.requestEnvelopeField;
  4382. }
  4383. set
  4384. {
  4385. this.requestEnvelopeField = value;
  4386. }
  4387. }
  4388. /// <summary>
  4389. ///
  4390. /// </summary>
  4391. private string invoiceIDField;
  4392. public string invoiceID
  4393. {
  4394. get
  4395. {
  4396. return this.invoiceIDField;
  4397. }
  4398. set
  4399. {
  4400. this.invoiceIDField = value;
  4401. }
  4402. }
  4403. /// <summary>
  4404. /// Constructor with arguments
  4405. /// </summary>
  4406. public SendInvoiceRequest(RequestEnvelope requestEnvelope, string invoiceID)
  4407. {
  4408. this.requestEnvelope = requestEnvelope;
  4409. this.invoiceID = invoiceID;
  4410. }
  4411. /// <summary>
  4412. /// Default Constructor
  4413. /// </summary>
  4414. public SendInvoiceRequest()
  4415. {
  4416. }
  4417. public string ToNVPString(string prefix)
  4418. {
  4419. StringBuilder sb = new StringBuilder();
  4420. if (this.requestEnvelope != null)
  4421. {
  4422. string newPrefix = prefix + "requestEnvelope" + ".";
  4423. sb.Append(this.requestEnvelopeField.ToNVPString(newPrefix));
  4424. }
  4425. if (this.invoiceID != null)
  4426. {
  4427. sb.Append(prefix).Append("invoiceID").Append("=").Append(HttpUtility.UrlEncode(this.invoiceID, BaseConstants.ENCODING_FORMAT)).Append("&");
  4428. }
  4429. return sb.ToString();
  4430. }
  4431. }
  4432. /// <summary>
  4433. /// The response object for SendInvoice.
  4434. /// </summary>
  4435. public partial class SendInvoiceResponse {
  4436. // Default US culture info
  4437. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  4438. /// <summary>
  4439. ///
  4440. /// </summary>
  4441. private ResponseEnvelope responseEnvelopeField;
  4442. public ResponseEnvelope responseEnvelope
  4443. {
  4444. get
  4445. {
  4446. return this.responseEnvelopeField;
  4447. }
  4448. set
  4449. {
  4450. this.responseEnvelopeField = value;
  4451. }
  4452. }
  4453. /// <summary>
  4454. ///
  4455. /// </summary>
  4456. private string invoiceIDField;
  4457. public string invoiceID
  4458. {
  4459. get
  4460. {
  4461. return this.invoiceIDField;
  4462. }
  4463. set
  4464. {
  4465. this.invoiceIDField = value;
  4466. }
  4467. }
  4468. /// <summary>
  4469. ///
  4470. /// </summary>
  4471. private string invoiceURLField;
  4472. public string invoiceURL
  4473. {
  4474. get
  4475. {
  4476. return this.invoiceURLField;
  4477. }
  4478. set
  4479. {
  4480. this.invoiceURLField = value;
  4481. }
  4482. }
  4483. /// <summary>
  4484. ///
  4485. /// </summary>
  4486. private List<ErrorData> errorField = new List<ErrorData>();
  4487. public List<ErrorData> error
  4488. {
  4489. get
  4490. {
  4491. return this.errorField;
  4492. }
  4493. set
  4494. {
  4495. this.errorField = value;
  4496. }
  4497. }
  4498. /// <summary>
  4499. /// Default Constructor
  4500. /// </summary>
  4501. public SendInvoiceResponse()
  4502. {
  4503. }
  4504. /// <summary>
  4505. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  4506. /// </summary>
  4507. /// <param name="map">NVP map as returned by an API call</param>
  4508. /// <param name="prefix">NVP prefix for this class in the response</param>
  4509. /// <param name="index">For array elements, index of this element in the response</param>
  4510. /// <returns>
  4511. /// A new SendInvoiceResponse object created from the passed in NVP map
  4512. /// </returns>
  4513. public static SendInvoiceResponse CreateInstance(Dictionary<string, string> map, string prefix, int index)
  4514. {
  4515. SendInvoiceResponse sendInvoiceResponse = null;
  4516. string key;
  4517. int i = 0;
  4518. if(index != -1)
  4519. {
  4520. if (prefix.Length > 0 && !prefix.EndsWith("."))
  4521. {
  4522. prefix = prefix + "(" + index + ").";
  4523. }
  4524. }
  4525. else
  4526. {
  4527. if (prefix.Length > 0 && !prefix.EndsWith("."))
  4528. {
  4529. prefix = prefix + ".";
  4530. }
  4531. }
  4532. ResponseEnvelope responseEnvelope = ResponseEnvelope.CreateInstance(map, prefix + "responseEnvelope", -1);
  4533. if (responseEnvelope != null)
  4534. {
  4535. sendInvoiceResponse = (sendInvoiceResponse == null) ? new SendInvoiceResponse() : sendInvoiceResponse;
  4536. sendInvoiceResponse.responseEnvelope = responseEnvelope;
  4537. }
  4538. key = prefix + "invoiceID";
  4539. if (map.ContainsKey(key))
  4540. {
  4541. sendInvoiceResponse = (sendInvoiceResponse == null) ? new SendInvoiceResponse() : sendInvoiceResponse;
  4542. sendInvoiceResponse.invoiceID = map[key];
  4543. }
  4544. key = prefix + "invoiceURL";
  4545. if (map.ContainsKey(key))
  4546. {
  4547. sendInvoiceResponse = (sendInvoiceResponse == null) ? new SendInvoiceResponse() : sendInvoiceResponse;
  4548. sendInvoiceResponse.invoiceURL = map[key];
  4549. }
  4550. i = 0;
  4551. while(true)
  4552. {
  4553. ErrorData error = ErrorData.CreateInstance(map, prefix + "error", i);
  4554. if (error != null)
  4555. {
  4556. sendInvoiceResponse = (sendInvoiceResponse == null) ? new SendInvoiceResponse() : sendInvoiceResponse;
  4557. sendInvoiceResponse.error.Add(error);
  4558. i++;
  4559. }
  4560. else
  4561. {
  4562. break;
  4563. }
  4564. }
  4565. return sendInvoiceResponse;
  4566. }
  4567. }
  4568. /// <summary>
  4569. /// The request object for RemindInvoice.
  4570. /// </summary>
  4571. public partial class RemindInvoiceRequest {
  4572. // Default US culture info
  4573. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  4574. /// <summary>
  4575. ///
  4576. /// </summary>
  4577. private RequestEnvelope requestEnvelopeField;
  4578. public RequestEnvelope requestEnvelope
  4579. {
  4580. get
  4581. {
  4582. return this.requestEnvelopeField;
  4583. }
  4584. set
  4585. {
  4586. this.requestEnvelopeField = value;
  4587. }
  4588. }
  4589. /// <summary>
  4590. ///
  4591. /// </summary>
  4592. private string invoiceIDField;
  4593. public string invoiceID
  4594. {
  4595. get
  4596. {
  4597. return this.invoiceIDField;
  4598. }
  4599. set
  4600. {
  4601. this.invoiceIDField = value;
  4602. }
  4603. }
  4604. /// <summary>
  4605. ///
  4606. /// </summary>
  4607. private string subjectField;
  4608. public string subject
  4609. {
  4610. get
  4611. {
  4612. return this.subjectField;
  4613. }
  4614. set
  4615. {
  4616. this.subjectField = value;
  4617. }
  4618. }
  4619. /// <summary>
  4620. ///
  4621. /// </summary>
  4622. private string noteForPayerField;
  4623. public string noteForPayer
  4624. {
  4625. get
  4626. {
  4627. return this.noteForPayerField;
  4628. }
  4629. set
  4630. {
  4631. this.noteForPayerField = value;
  4632. }
  4633. }
  4634. /// <summary>
  4635. /// Constructor with arguments
  4636. /// </summary>
  4637. public RemindInvoiceRequest(RequestEnvelope requestEnvelope, string invoiceID)
  4638. {
  4639. this.requestEnvelope = requestEnvelope;
  4640. this.invoiceID = invoiceID;
  4641. }
  4642. /// <summary>
  4643. /// Default Constructor
  4644. /// </summary>
  4645. public RemindInvoiceRequest()
  4646. {
  4647. }
  4648. public string ToNVPString(string prefix)
  4649. {
  4650. StringBuilder sb = new StringBuilder();
  4651. if (this.requestEnvelope != null)
  4652. {
  4653. string newPrefix = prefix + "requestEnvelope" + ".";
  4654. sb.Append(this.requestEnvelopeField.ToNVPString(newPrefix));
  4655. }
  4656. if (this.invoiceID != null)
  4657. {
  4658. sb.Append(prefix).Append("invoiceID").Append("=").Append(HttpUtility.UrlEncode(this.invoiceID, BaseConstants.ENCODING_FORMAT)).Append("&");
  4659. }
  4660. if (this.subject != null)
  4661. {
  4662. sb.Append(prefix).Append("subject").Append("=").Append(HttpUtility.UrlEncode(this.subject, BaseConstants.ENCODING_FORMAT)).Append("&");
  4663. }
  4664. if (this.noteForPayer != null)
  4665. {
  4666. sb.Append(prefix).Append("noteForPayer").Append("=").Append(HttpUtility.UrlEncode(this.noteForPayer, BaseConstants.ENCODING_FORMAT)).Append("&");
  4667. }
  4668. return sb.ToString();
  4669. }
  4670. }
  4671. /// <summary>
  4672. /// The response object for RemindInvoice.
  4673. /// </summary>
  4674. public partial class RemindInvoiceResponse {
  4675. // Default US culture info
  4676. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  4677. /// <summary>
  4678. ///
  4679. /// </summary>
  4680. private ResponseEnvelope responseEnvelopeField;
  4681. public ResponseEnvelope responseEnvelope
  4682. {
  4683. get
  4684. {
  4685. return this.responseEnvelopeField;
  4686. }
  4687. set
  4688. {
  4689. this.responseEnvelopeField = value;
  4690. }
  4691. }
  4692. /// <summary>
  4693. ///
  4694. /// </summary>
  4695. private string invoiceIDField;
  4696. public string invoiceID
  4697. {
  4698. get
  4699. {
  4700. return this.invoiceIDField;
  4701. }
  4702. set
  4703. {
  4704. this.invoiceIDField = value;
  4705. }
  4706. }
  4707. /// <summary>
  4708. ///
  4709. /// </summary>
  4710. private string invoiceURLField;
  4711. public string invoiceURL
  4712. {
  4713. get
  4714. {
  4715. return this.invoiceURLField;
  4716. }
  4717. set
  4718. {
  4719. this.invoiceURLField = value;
  4720. }
  4721. }
  4722. /// <summary>
  4723. ///
  4724. /// </summary>
  4725. private List<ErrorData> errorField = new List<ErrorData>();
  4726. public List<ErrorData> error
  4727. {
  4728. get
  4729. {
  4730. return this.errorField;
  4731. }
  4732. set
  4733. {
  4734. this.errorField = value;
  4735. }
  4736. }
  4737. /// <summary>
  4738. /// Default Constructor
  4739. /// </summary>
  4740. public RemindInvoiceResponse()
  4741. {
  4742. }
  4743. /// <summary>
  4744. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  4745. /// </summary>
  4746. /// <param name="map">NVP map as returned by an API call</param>
  4747. /// <param name="prefix">NVP prefix for this class in the response</param>
  4748. /// <param name="index">For array elements, index of this element in the response</param>
  4749. /// <returns>
  4750. /// A new RemindInvoiceResponse object created from the passed in NVP map
  4751. /// </returns>
  4752. public static RemindInvoiceResponse CreateInstance(Dictionary<string, string> map, string prefix, int index)
  4753. {
  4754. RemindInvoiceResponse remindInvoiceResponse = null;
  4755. string key;
  4756. int i = 0;
  4757. if(index != -1)
  4758. {
  4759. if (prefix.Length > 0 && !prefix.EndsWith("."))
  4760. {
  4761. prefix = prefix + "(" + index + ").";
  4762. }
  4763. }
  4764. else
  4765. {
  4766. if (prefix.Length > 0 && !prefix.EndsWith("."))
  4767. {
  4768. prefix = prefix + ".";
  4769. }
  4770. }
  4771. ResponseEnvelope responseEnvelope = ResponseEnvelope.CreateInstance(map, prefix + "responseEnvelope", -1);
  4772. if (responseEnvelope != null)
  4773. {
  4774. remindInvoiceResponse = (remindInvoiceResponse == null) ? new RemindInvoiceResponse() : remindInvoiceResponse;
  4775. remindInvoiceResponse.responseEnvelope = responseEnvelope;
  4776. }
  4777. key = prefix + "invoiceID";
  4778. if (map.ContainsKey(key))
  4779. {
  4780. remindInvoiceResponse = (remindInvoiceResponse == null) ? new RemindInvoiceResponse() : remindInvoiceResponse;
  4781. remindInvoiceResponse.invoiceID = map[key];
  4782. }
  4783. key = prefix + "invoiceURL";
  4784. if (map.ContainsKey(key))
  4785. {
  4786. remindInvoiceResponse = (remindInvoiceResponse == null) ? new RemindInvoiceResponse() : remindInvoiceResponse;
  4787. remindInvoiceResponse.invoiceURL = map[key];
  4788. }
  4789. i = 0;
  4790. while(true)
  4791. {
  4792. ErrorData error = ErrorData.CreateInstance(map, prefix + "error", i);
  4793. if (error != null)
  4794. {
  4795. remindInvoiceResponse = (remindInvoiceResponse == null) ? new RemindInvoiceResponse() : remindInvoiceResponse;
  4796. remindInvoiceResponse.error.Add(error);
  4797. i++;
  4798. }
  4799. else
  4800. {
  4801. break;
  4802. }
  4803. }
  4804. return remindInvoiceResponse;
  4805. }
  4806. }
  4807. /// <summary>
  4808. /// The request object for GenerateInvoiceNumber.
  4809. /// </summary>
  4810. public partial class GenerateInvoiceNumberRequest {
  4811. // Default US culture info
  4812. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  4813. /// <summary>
  4814. ///
  4815. /// </summary>
  4816. private RequestEnvelope requestEnvelopeField;
  4817. public RequestEnvelope requestEnvelope
  4818. {
  4819. get
  4820. {
  4821. return this.requestEnvelopeField;
  4822. }
  4823. set
  4824. {
  4825. this.requestEnvelopeField = value;
  4826. }
  4827. }
  4828. /// <summary>
  4829. /// Constructor with arguments
  4830. /// </summary>
  4831. public GenerateInvoiceNumberRequest(RequestEnvelope requestEnvelope)
  4832. {
  4833. this.requestEnvelope = requestEnvelope;
  4834. }
  4835. /// <summary>
  4836. /// Default Constructor
  4837. /// </summary>
  4838. public GenerateInvoiceNumberRequest()
  4839. {
  4840. }
  4841. public string ToNVPString(string prefix)
  4842. {
  4843. StringBuilder sb = new StringBuilder();
  4844. if (this.requestEnvelope != null)
  4845. {
  4846. string newPrefix = prefix + "requestEnvelope" + ".";
  4847. sb.Append(this.requestEnvelopeField.ToNVPString(newPrefix));
  4848. }
  4849. return sb.ToString();
  4850. }
  4851. }
  4852. /// <summary>
  4853. /// The response object for GenerateInvoiceNumber.
  4854. /// </summary>
  4855. public partial class GenerateInvoiceNumberResponse {
  4856. // Default US culture info
  4857. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  4858. /// <summary>
  4859. ///
  4860. /// </summary>
  4861. private ResponseEnvelope responseEnvelopeField;
  4862. public ResponseEnvelope responseEnvelope
  4863. {
  4864. get
  4865. {
  4866. return this.responseEnvelopeField;
  4867. }
  4868. set
  4869. {
  4870. this.responseEnvelopeField = value;
  4871. }
  4872. }
  4873. /// <summary>
  4874. ///
  4875. /// </summary>
  4876. private string invoiceNumberField;
  4877. public string invoiceNumber
  4878. {
  4879. get
  4880. {
  4881. return this.invoiceNumberField;
  4882. }
  4883. set
  4884. {
  4885. this.invoiceNumberField = value;
  4886. }
  4887. }
  4888. /// <summary>
  4889. ///
  4890. /// </summary>
  4891. private List<ErrorData> errorField = new List<ErrorData>();
  4892. public List<ErrorData> error
  4893. {
  4894. get
  4895. {
  4896. return this.errorField;
  4897. }
  4898. set
  4899. {
  4900. this.errorField = value;
  4901. }
  4902. }
  4903. /// <summary>
  4904. /// Default Constructor
  4905. /// </summary>
  4906. public GenerateInvoiceNumberResponse()
  4907. {
  4908. }
  4909. /// <summary>
  4910. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  4911. /// </summary>
  4912. /// <param name="map">NVP map as returned by an API call</param>
  4913. /// <param name="prefix">NVP prefix for this class in the response</param>
  4914. /// <param name="index">For array elements, index of this element in the response</param>
  4915. /// <returns>
  4916. /// A new GenerateInvoiceNumberResponse object created from the passed in NVP map
  4917. /// </returns>
  4918. public static GenerateInvoiceNumberResponse CreateInstance(Dictionary<string, string> map, string prefix, int index)
  4919. {
  4920. GenerateInvoiceNumberResponse generateInvoiceNumberResponse = null;
  4921. string key;
  4922. int i = 0;
  4923. if(index != -1)
  4924. {
  4925. if (prefix.Length > 0 && !prefix.EndsWith("."))
  4926. {
  4927. prefix = prefix + "(" + index + ").";
  4928. }
  4929. }
  4930. else
  4931. {
  4932. if (prefix.Length > 0 && !prefix.EndsWith("."))
  4933. {
  4934. prefix = prefix + ".";
  4935. }
  4936. }
  4937. ResponseEnvelope responseEnvelope = ResponseEnvelope.CreateInstance(map, prefix + "responseEnvelope", -1);
  4938. if (responseEnvelope != null)
  4939. {
  4940. generateInvoiceNumberResponse = (generateInvoiceNumberResponse == null) ? new GenerateInvoiceNumberResponse() : generateInvoiceNumberResponse;
  4941. generateInvoiceNumberResponse.responseEnvelope = responseEnvelope;
  4942. }
  4943. key = prefix + "invoiceNumber";
  4944. if (map.ContainsKey(key))
  4945. {
  4946. generateInvoiceNumberResponse = (generateInvoiceNumberResponse == null) ? new GenerateInvoiceNumberResponse() : generateInvoiceNumberResponse;
  4947. generateInvoiceNumberResponse.invoiceNumber = map[key];
  4948. }
  4949. i = 0;
  4950. while(true)
  4951. {
  4952. ErrorData error = ErrorData.CreateInstance(map, prefix + "error", i);
  4953. if (error != null)
  4954. {
  4955. generateInvoiceNumberResponse = (generateInvoiceNumberResponse == null) ? new GenerateInvoiceNumberResponse() : generateInvoiceNumberResponse;
  4956. generateInvoiceNumberResponse.error.Add(error);
  4957. i++;
  4958. }
  4959. else
  4960. {
  4961. break;
  4962. }
  4963. }
  4964. return generateInvoiceNumberResponse;
  4965. }
  4966. }
  4967. /// <summary>
  4968. /// The request object for CreateAndSendInvoice.
  4969. /// </summary>
  4970. public partial class CreateAndSendInvoiceRequest {
  4971. // Default US culture info
  4972. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  4973. /// <summary>
  4974. ///
  4975. /// </summary>
  4976. private RequestEnvelope requestEnvelopeField;
  4977. public RequestEnvelope requestEnvelope
  4978. {
  4979. get
  4980. {
  4981. return this.requestEnvelopeField;
  4982. }
  4983. set
  4984. {
  4985. this.requestEnvelopeField = value;
  4986. }
  4987. }
  4988. /// <summary>
  4989. ///
  4990. /// </summary>
  4991. private InvoiceType invoiceField;
  4992. public InvoiceType invoice
  4993. {
  4994. get
  4995. {
  4996. return this.invoiceField;
  4997. }
  4998. set
  4999. {
  5000. this.invoiceField = value;
  5001. }
  5002. }
  5003. /// <summary>
  5004. /// Constructor with arguments
  5005. /// </summary>
  5006. public CreateAndSendInvoiceRequest(RequestEnvelope requestEnvelope, InvoiceType invoice)
  5007. {
  5008. this.requestEnvelope = requestEnvelope;
  5009. this.invoice = invoice;
  5010. }
  5011. /// <summary>
  5012. /// Default Constructor
  5013. /// </summary>
  5014. public CreateAndSendInvoiceRequest()
  5015. {
  5016. }
  5017. public string ToNVPString(string prefix)
  5018. {
  5019. StringBuilder sb = new StringBuilder();
  5020. if (this.requestEnvelope != null)
  5021. {
  5022. string newPrefix = prefix + "requestEnvelope" + ".";
  5023. sb.Append(this.requestEnvelopeField.ToNVPString(newPrefix));
  5024. }
  5025. if (this.invoice != null)
  5026. {
  5027. string newPrefix = prefix + "invoice" + ".";
  5028. sb.Append(this.invoiceField.ToNVPString(newPrefix));
  5029. }
  5030. return sb.ToString();
  5031. }
  5032. }
  5033. /// <summary>
  5034. /// The response object for CreateAndSendInvoice.
  5035. /// </summary>
  5036. public partial class CreateAndSendInvoiceResponse {
  5037. // Default US culture info
  5038. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  5039. /// <summary>
  5040. ///
  5041. /// </summary>
  5042. private ResponseEnvelope responseEnvelopeField;
  5043. public ResponseEnvelope responseEnvelope
  5044. {
  5045. get
  5046. {
  5047. return this.responseEnvelopeField;
  5048. }
  5049. set
  5050. {
  5051. this.responseEnvelopeField = value;
  5052. }
  5053. }
  5054. /// <summary>
  5055. ///
  5056. /// </summary>
  5057. private string invoiceIDField;
  5058. public string invoiceID
  5059. {
  5060. get
  5061. {
  5062. return this.invoiceIDField;
  5063. }
  5064. set
  5065. {
  5066. this.invoiceIDField = value;
  5067. }
  5068. }
  5069. /// <summary>
  5070. ///
  5071. /// </summary>
  5072. private string invoiceNumberField;
  5073. public string invoiceNumber
  5074. {
  5075. get
  5076. {
  5077. return this.invoiceNumberField;
  5078. }
  5079. set
  5080. {
  5081. this.invoiceNumberField = value;
  5082. }
  5083. }
  5084. /// <summary>
  5085. ///
  5086. /// </summary>
  5087. private string invoiceURLField;
  5088. public string invoiceURL
  5089. {
  5090. get
  5091. {
  5092. return this.invoiceURLField;
  5093. }
  5094. set
  5095. {
  5096. this.invoiceURLField = value;
  5097. }
  5098. }
  5099. /// <summary>
  5100. ///
  5101. /// </summary>
  5102. private long? totalAmountField;
  5103. public long? totalAmount
  5104. {
  5105. get
  5106. {
  5107. return this.totalAmountField;
  5108. }
  5109. set
  5110. {
  5111. this.totalAmountField = value;
  5112. }
  5113. }
  5114. /// <summary>
  5115. ///
  5116. /// </summary>
  5117. private List<ErrorData> errorField = new List<ErrorData>();
  5118. public List<ErrorData> error
  5119. {
  5120. get
  5121. {
  5122. return this.errorField;
  5123. }
  5124. set
  5125. {
  5126. this.errorField = value;
  5127. }
  5128. }
  5129. /// <summary>
  5130. /// Default Constructor
  5131. /// </summary>
  5132. public CreateAndSendInvoiceResponse()
  5133. {
  5134. }
  5135. /// <summary>
  5136. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  5137. /// </summary>
  5138. /// <param name="map">NVP map as returned by an API call</param>
  5139. /// <param name="prefix">NVP prefix for this class in the response</param>
  5140. /// <param name="index">For array elements, index of this element in the response</param>
  5141. /// <returns>
  5142. /// A new CreateAndSendInvoiceResponse object created from the passed in NVP map
  5143. /// </returns>
  5144. public static CreateAndSendInvoiceResponse CreateInstance(Dictionary<string, string> map, string prefix, int index)
  5145. {
  5146. CreateAndSendInvoiceResponse createAndSendInvoiceResponse = null;
  5147. string key;
  5148. int i = 0;
  5149. if(index != -1)
  5150. {
  5151. if (prefix.Length > 0 && !prefix.EndsWith("."))
  5152. {
  5153. prefix = prefix + "(" + index + ").";
  5154. }
  5155. }
  5156. else
  5157. {
  5158. if (prefix.Length > 0 && !prefix.EndsWith("."))
  5159. {
  5160. prefix = prefix + ".";
  5161. }
  5162. }
  5163. ResponseEnvelope responseEnvelope = ResponseEnvelope.CreateInstance(map, prefix + "responseEnvelope", -1);
  5164. if (responseEnvelope != null)
  5165. {
  5166. createAndSendInvoiceResponse = (createAndSendInvoiceResponse == null) ? new CreateAndSendInvoiceResponse() : createAndSendInvoiceResponse;
  5167. createAndSendInvoiceResponse.responseEnvelope = responseEnvelope;
  5168. }
  5169. key = prefix + "invoiceID";
  5170. if (map.ContainsKey(key))
  5171. {
  5172. createAndSendInvoiceResponse = (createAndSendInvoiceResponse == null) ? new CreateAndSendInvoiceResponse() : createAndSendInvoiceResponse;
  5173. createAndSendInvoiceResponse.invoiceID = map[key];
  5174. }
  5175. key = prefix + "invoiceNumber";
  5176. if (map.ContainsKey(key))
  5177. {
  5178. createAndSendInvoiceResponse = (createAndSendInvoiceResponse == null) ? new CreateAndSendInvoiceResponse() : createAndSendInvoiceResponse;
  5179. createAndSendInvoiceResponse.invoiceNumber = map[key];
  5180. }
  5181. key = prefix + "invoiceURL";
  5182. if (map.ContainsKey(key))
  5183. {
  5184. createAndSendInvoiceResponse = (createAndSendInvoiceResponse == null) ? new CreateAndSendInvoiceResponse() : createAndSendInvoiceResponse;
  5185. createAndSendInvoiceResponse.invoiceURL = map[key];
  5186. }
  5187. key = prefix + "totalAmount";
  5188. if (map.ContainsKey(key))
  5189. {
  5190. createAndSendInvoiceResponse = (createAndSendInvoiceResponse == null) ? new CreateAndSendInvoiceResponse() : createAndSendInvoiceResponse;
  5191. createAndSendInvoiceResponse.totalAmount = System.Convert.ToInt64(map[key], DefaultCulture);
  5192. }
  5193. i = 0;
  5194. while(true)
  5195. {
  5196. ErrorData error = ErrorData.CreateInstance(map, prefix + "error", i);
  5197. if (error != null)
  5198. {
  5199. createAndSendInvoiceResponse = (createAndSendInvoiceResponse == null) ? new CreateAndSendInvoiceResponse() : createAndSendInvoiceResponse;
  5200. createAndSendInvoiceResponse.error.Add(error);
  5201. i++;
  5202. }
  5203. else
  5204. {
  5205. break;
  5206. }
  5207. }
  5208. return createAndSendInvoiceResponse;
  5209. }
  5210. }
  5211. /// <summary>
  5212. /// The request object for UpdateInvoice.
  5213. /// </summary>
  5214. public partial class UpdateInvoiceRequest {
  5215. // Default US culture info
  5216. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  5217. /// <summary>
  5218. ///
  5219. /// </summary>
  5220. private RequestEnvelope requestEnvelopeField;
  5221. public RequestEnvelope requestEnvelope
  5222. {
  5223. get
  5224. {
  5225. return this.requestEnvelopeField;
  5226. }
  5227. set
  5228. {
  5229. this.requestEnvelopeField = value;
  5230. }
  5231. }
  5232. /// <summary>
  5233. ///
  5234. /// </summary>
  5235. private string invoiceIDField;
  5236. public string invoiceID
  5237. {
  5238. get
  5239. {
  5240. return this.invoiceIDField;
  5241. }
  5242. set
  5243. {
  5244. this.invoiceIDField = value;
  5245. }
  5246. }
  5247. /// <summary>
  5248. ///
  5249. /// </summary>
  5250. private InvoiceType invoiceField;
  5251. public InvoiceType invoice
  5252. {
  5253. get
  5254. {
  5255. return this.invoiceField;
  5256. }
  5257. set
  5258. {
  5259. this.invoiceField = value;
  5260. }
  5261. }
  5262. /// <summary>
  5263. /// Constructor with arguments
  5264. /// </summary>
  5265. public UpdateInvoiceRequest(RequestEnvelope requestEnvelope, string invoiceID, InvoiceType invoice)
  5266. {
  5267. this.requestEnvelope = requestEnvelope;
  5268. this.invoiceID = invoiceID;
  5269. this.invoice = invoice;
  5270. }
  5271. /// <summary>
  5272. /// Default Constructor
  5273. /// </summary>
  5274. public UpdateInvoiceRequest()
  5275. {
  5276. }
  5277. public string ToNVPString(string prefix)
  5278. {
  5279. StringBuilder sb = new StringBuilder();
  5280. if (this.requestEnvelope != null)
  5281. {
  5282. string newPrefix = prefix + "requestEnvelope" + ".";
  5283. sb.Append(this.requestEnvelopeField.ToNVPString(newPrefix));
  5284. }
  5285. if (this.invoiceID != null)
  5286. {
  5287. sb.Append(prefix).Append("invoiceID").Append("=").Append(HttpUtility.UrlEncode(this.invoiceID, BaseConstants.ENCODING_FORMAT)).Append("&");
  5288. }
  5289. if (this.invoice != null)
  5290. {
  5291. string newPrefix = prefix + "invoice" + ".";
  5292. sb.Append(this.invoiceField.ToNVPString(newPrefix));
  5293. }
  5294. return sb.ToString();
  5295. }
  5296. }
  5297. /// <summary>
  5298. /// The response object for UpdateInvoice.
  5299. /// </summary>
  5300. public partial class UpdateInvoiceResponse {
  5301. // Default US culture info
  5302. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  5303. /// <summary>
  5304. ///
  5305. /// </summary>
  5306. private ResponseEnvelope responseEnvelopeField;
  5307. public ResponseEnvelope responseEnvelope
  5308. {
  5309. get
  5310. {
  5311. return this.responseEnvelopeField;
  5312. }
  5313. set
  5314. {
  5315. this.responseEnvelopeField = value;
  5316. }
  5317. }
  5318. /// <summary>
  5319. ///
  5320. /// </summary>
  5321. private string invoiceIDField;
  5322. public string invoiceID
  5323. {
  5324. get
  5325. {
  5326. return this.invoiceIDField;
  5327. }
  5328. set
  5329. {
  5330. this.invoiceIDField = value;
  5331. }
  5332. }
  5333. /// <summary>
  5334. ///
  5335. /// </summary>
  5336. private string invoiceNumberField;
  5337. public string invoiceNumber
  5338. {
  5339. get
  5340. {
  5341. return this.invoiceNumberField;
  5342. }
  5343. set
  5344. {
  5345. this.invoiceNumberField = value;
  5346. }
  5347. }
  5348. /// <summary>
  5349. ///
  5350. /// </summary>
  5351. private string invoiceURLField;
  5352. public string invoiceURL
  5353. {
  5354. get
  5355. {
  5356. return this.invoiceURLField;
  5357. }
  5358. set
  5359. {
  5360. this.invoiceURLField = value;
  5361. }
  5362. }
  5363. /// <summary>
  5364. ///
  5365. /// </summary>
  5366. private long? totalAmountField;
  5367. public long? totalAmount
  5368. {
  5369. get
  5370. {
  5371. return this.totalAmountField;
  5372. }
  5373. set
  5374. {
  5375. this.totalAmountField = value;
  5376. }
  5377. }
  5378. /// <summary>
  5379. ///
  5380. /// </summary>
  5381. private List<ErrorData> errorField = new List<ErrorData>();
  5382. public List<ErrorData> error
  5383. {
  5384. get
  5385. {
  5386. return this.errorField;
  5387. }
  5388. set
  5389. {
  5390. this.errorField = value;
  5391. }
  5392. }
  5393. /// <summary>
  5394. /// Default Constructor
  5395. /// </summary>
  5396. public UpdateInvoiceResponse()
  5397. {
  5398. }
  5399. /// <summary>
  5400. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  5401. /// </summary>
  5402. /// <param name="map">NVP map as returned by an API call</param>
  5403. /// <param name="prefix">NVP prefix for this class in the response</param>
  5404. /// <param name="index">For array elements, index of this element in the response</param>
  5405. /// <returns>
  5406. /// A new UpdateInvoiceResponse object created from the passed in NVP map
  5407. /// </returns>
  5408. public static UpdateInvoiceResponse CreateInstance(Dictionary<string, string> map, string prefix, int index)
  5409. {
  5410. UpdateInvoiceResponse updateInvoiceResponse = null;
  5411. string key;
  5412. int i = 0;
  5413. if(index != -1)
  5414. {
  5415. if (prefix.Length > 0 && !prefix.EndsWith("."))
  5416. {
  5417. prefix = prefix + "(" + index + ").";
  5418. }
  5419. }
  5420. else
  5421. {
  5422. if (prefix.Length > 0 && !prefix.EndsWith("."))
  5423. {
  5424. prefix = prefix + ".";
  5425. }
  5426. }
  5427. ResponseEnvelope responseEnvelope = ResponseEnvelope.CreateInstance(map, prefix + "responseEnvelope", -1);
  5428. if (responseEnvelope != null)
  5429. {
  5430. updateInvoiceResponse = (updateInvoiceResponse == null) ? new UpdateInvoiceResponse() : updateInvoiceResponse;
  5431. updateInvoiceResponse.responseEnvelope = responseEnvelope;
  5432. }
  5433. key = prefix + "invoiceID";
  5434. if (map.ContainsKey(key))
  5435. {
  5436. updateInvoiceResponse = (updateInvoiceResponse == null) ? new UpdateInvoiceResponse() : updateInvoiceResponse;
  5437. updateInvoiceResponse.invoiceID = map[key];
  5438. }
  5439. key = prefix + "invoiceNumber";
  5440. if (map.ContainsKey(key))
  5441. {
  5442. updateInvoiceResponse = (updateInvoiceResponse == null) ? new UpdateInvoiceResponse() : updateInvoiceResponse;
  5443. updateInvoiceResponse.invoiceNumber = map[key];
  5444. }
  5445. key = prefix + "invoiceURL";
  5446. if (map.ContainsKey(key))
  5447. {
  5448. updateInvoiceResponse = (updateInvoiceResponse == null) ? new UpdateInvoiceResponse() : updateInvoiceResponse;
  5449. updateInvoiceResponse.invoiceURL = map[key];
  5450. }
  5451. key = prefix + "totalAmount";
  5452. if (map.ContainsKey(key))
  5453. {
  5454. updateInvoiceResponse = (updateInvoiceResponse == null) ? new UpdateInvoiceResponse() : updateInvoiceResponse;
  5455. updateInvoiceResponse.totalAmount = System.Convert.ToInt64(map[key], DefaultCulture);
  5456. }
  5457. i = 0;
  5458. while(true)
  5459. {
  5460. ErrorData error = ErrorData.CreateInstance(map, prefix + "error", i);
  5461. if (error != null)
  5462. {
  5463. updateInvoiceResponse = (updateInvoiceResponse == null) ? new UpdateInvoiceResponse() : updateInvoiceResponse;
  5464. updateInvoiceResponse.error.Add(error);
  5465. i++;
  5466. }
  5467. else
  5468. {
  5469. break;
  5470. }
  5471. }
  5472. return updateInvoiceResponse;
  5473. }
  5474. }
  5475. /// <summary>
  5476. /// The request object for GetInvoiceDetails.
  5477. /// </summary>
  5478. public partial class GetInvoiceDetailsRequest {
  5479. // Default US culture info
  5480. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  5481. /// <summary>
  5482. ///
  5483. /// </summary>
  5484. private RequestEnvelope requestEnvelopeField;
  5485. public RequestEnvelope requestEnvelope
  5486. {
  5487. get
  5488. {
  5489. return this.requestEnvelopeField;
  5490. }
  5491. set
  5492. {
  5493. this.requestEnvelopeField = value;
  5494. }
  5495. }
  5496. /// <summary>
  5497. ///
  5498. /// </summary>
  5499. private string invoiceIDField;
  5500. public string invoiceID
  5501. {
  5502. get
  5503. {
  5504. return this.invoiceIDField;
  5505. }
  5506. set
  5507. {
  5508. this.invoiceIDField = value;
  5509. }
  5510. }
  5511. /// <summary>
  5512. /// Constructor with arguments
  5513. /// </summary>
  5514. public GetInvoiceDetailsRequest(RequestEnvelope requestEnvelope, string invoiceID)
  5515. {
  5516. this.requestEnvelope = requestEnvelope;
  5517. this.invoiceID = invoiceID;
  5518. }
  5519. /// <summary>
  5520. /// Default Constructor
  5521. /// </summary>
  5522. public GetInvoiceDetailsRequest()
  5523. {
  5524. }
  5525. public string ToNVPString(string prefix)
  5526. {
  5527. StringBuilder sb = new StringBuilder();
  5528. if (this.requestEnvelope != null)
  5529. {
  5530. string newPrefix = prefix + "requestEnvelope" + ".";
  5531. sb.Append(this.requestEnvelopeField.ToNVPString(newPrefix));
  5532. }
  5533. if (this.invoiceID != null)
  5534. {
  5535. sb.Append(prefix).Append("invoiceID").Append("=").Append(HttpUtility.UrlEncode(this.invoiceID, BaseConstants.ENCODING_FORMAT)).Append("&");
  5536. }
  5537. return sb.ToString();
  5538. }
  5539. }
  5540. /// <summary>
  5541. /// The response object for CreateInvoice.
  5542. /// </summary>
  5543. public partial class GetInvoiceDetailsResponse {
  5544. // Default US culture info
  5545. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  5546. /// <summary>
  5547. ///
  5548. /// </summary>
  5549. private ResponseEnvelope responseEnvelopeField;
  5550. public ResponseEnvelope responseEnvelope
  5551. {
  5552. get
  5553. {
  5554. return this.responseEnvelopeField;
  5555. }
  5556. set
  5557. {
  5558. this.responseEnvelopeField = value;
  5559. }
  5560. }
  5561. /// <summary>
  5562. ///
  5563. /// </summary>
  5564. private InvoiceType invoiceField;
  5565. public InvoiceType invoice
  5566. {
  5567. get
  5568. {
  5569. return this.invoiceField;
  5570. }
  5571. set
  5572. {
  5573. this.invoiceField = value;
  5574. }
  5575. }
  5576. /// <summary>
  5577. ///
  5578. /// </summary>
  5579. private InvoiceDetailsType invoiceDetailsField;
  5580. public InvoiceDetailsType invoiceDetails
  5581. {
  5582. get
  5583. {
  5584. return this.invoiceDetailsField;
  5585. }
  5586. set
  5587. {
  5588. this.invoiceDetailsField = value;
  5589. }
  5590. }
  5591. /// <summary>
  5592. ///
  5593. /// </summary>
  5594. private PaymentDetailsType paymentDetailsField;
  5595. public PaymentDetailsType paymentDetails
  5596. {
  5597. get
  5598. {
  5599. return this.paymentDetailsField;
  5600. }
  5601. set
  5602. {
  5603. this.paymentDetailsField = value;
  5604. }
  5605. }
  5606. /// <summary>
  5607. ///
  5608. /// </summary>
  5609. private PaymentRefundDetailsType refundDetailsField;
  5610. public PaymentRefundDetailsType refundDetails
  5611. {
  5612. get
  5613. {
  5614. return this.refundDetailsField;
  5615. }
  5616. set
  5617. {
  5618. this.refundDetailsField = value;
  5619. }
  5620. }
  5621. /// <summary>
  5622. ///
  5623. /// </summary>
  5624. private string invoiceURLField;
  5625. public string invoiceURL
  5626. {
  5627. get
  5628. {
  5629. return this.invoiceURLField;
  5630. }
  5631. set
  5632. {
  5633. this.invoiceURLField = value;
  5634. }
  5635. }
  5636. /// <summary>
  5637. ///
  5638. /// </summary>
  5639. private List<ErrorData> errorField = new List<ErrorData>();
  5640. public List<ErrorData> error
  5641. {
  5642. get
  5643. {
  5644. return this.errorField;
  5645. }
  5646. set
  5647. {
  5648. this.errorField = value;
  5649. }
  5650. }
  5651. /// <summary>
  5652. /// Default Constructor
  5653. /// </summary>
  5654. public GetInvoiceDetailsResponse()
  5655. {
  5656. }
  5657. /// <summary>
  5658. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  5659. /// </summary>
  5660. /// <param name="map">NVP map as returned by an API call</param>
  5661. /// <param name="prefix">NVP prefix for this class in the response</param>
  5662. /// <param name="index">For array elements, index of this element in the response</param>
  5663. /// <returns>
  5664. /// A new GetInvoiceDetailsResponse object created from the passed in NVP map
  5665. /// </returns>
  5666. public static GetInvoiceDetailsResponse CreateInstance(Dictionary<string, string> map, string prefix, int index)
  5667. {
  5668. GetInvoiceDetailsResponse getInvoiceDetailsResponse = null;
  5669. string key;
  5670. int i = 0;
  5671. if(index != -1)
  5672. {
  5673. if (prefix.Length > 0 && !prefix.EndsWith("."))
  5674. {
  5675. prefix = prefix + "(" + index + ").";
  5676. }
  5677. }
  5678. else
  5679. {
  5680. if (prefix.Length > 0 && !prefix.EndsWith("."))
  5681. {
  5682. prefix = prefix + ".";
  5683. }
  5684. }
  5685. ResponseEnvelope responseEnvelope = ResponseEnvelope.CreateInstance(map, prefix + "responseEnvelope", -1);
  5686. if (responseEnvelope != null)
  5687. {
  5688. getInvoiceDetailsResponse = (getInvoiceDetailsResponse == null) ? new GetInvoiceDetailsResponse() : getInvoiceDetailsResponse;
  5689. getInvoiceDetailsResponse.responseEnvelope = responseEnvelope;
  5690. }
  5691. InvoiceType invoice = InvoiceType.CreateInstance(map, prefix + "invoice", -1);
  5692. if (invoice != null)
  5693. {
  5694. getInvoiceDetailsResponse = (getInvoiceDetailsResponse == null) ? new GetInvoiceDetailsResponse() : getInvoiceDetailsResponse;
  5695. getInvoiceDetailsResponse.invoice = invoice;
  5696. }
  5697. InvoiceDetailsType invoiceDetails = InvoiceDetailsType.CreateInstance(map, prefix + "invoiceDetails", -1);
  5698. if (invoiceDetails != null)
  5699. {
  5700. getInvoiceDetailsResponse = (getInvoiceDetailsResponse == null) ? new GetInvoiceDetailsResponse() : getInvoiceDetailsResponse;
  5701. getInvoiceDetailsResponse.invoiceDetails = invoiceDetails;
  5702. }
  5703. PaymentDetailsType paymentDetails = PaymentDetailsType.CreateInstance(map, prefix + "paymentDetails", -1);
  5704. if (paymentDetails != null)
  5705. {
  5706. getInvoiceDetailsResponse = (getInvoiceDetailsResponse == null) ? new GetInvoiceDetailsResponse() : getInvoiceDetailsResponse;
  5707. getInvoiceDetailsResponse.paymentDetails = paymentDetails;
  5708. }
  5709. PaymentRefundDetailsType refundDetails = PaymentRefundDetailsType.CreateInstance(map, prefix + "refundDetails", -1);
  5710. if (refundDetails != null)
  5711. {
  5712. getInvoiceDetailsResponse = (getInvoiceDetailsResponse == null) ? new GetInvoiceDetailsResponse() : getInvoiceDetailsResponse;
  5713. getInvoiceDetailsResponse.refundDetails = refundDetails;
  5714. }
  5715. key = prefix + "invoiceURL";
  5716. if (map.ContainsKey(key))
  5717. {
  5718. getInvoiceDetailsResponse = (getInvoiceDetailsResponse == null) ? new GetInvoiceDetailsResponse() : getInvoiceDetailsResponse;
  5719. getInvoiceDetailsResponse.invoiceURL = map[key];
  5720. }
  5721. i = 0;
  5722. while(true)
  5723. {
  5724. ErrorData error = ErrorData.CreateInstance(map, prefix + "error", i);
  5725. if (error != null)
  5726. {
  5727. getInvoiceDetailsResponse = (getInvoiceDetailsResponse == null) ? new GetInvoiceDetailsResponse() : getInvoiceDetailsResponse;
  5728. getInvoiceDetailsResponse.error.Add(error);
  5729. i++;
  5730. }
  5731. else
  5732. {
  5733. break;
  5734. }
  5735. }
  5736. return getInvoiceDetailsResponse;
  5737. }
  5738. }
  5739. /// <summary>
  5740. /// The request object for CancelInvoice.
  5741. /// </summary>
  5742. public partial class CancelInvoiceRequest {
  5743. // Default US culture info
  5744. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  5745. /// <summary>
  5746. ///
  5747. /// </summary>
  5748. private RequestEnvelope requestEnvelopeField;
  5749. public RequestEnvelope requestEnvelope
  5750. {
  5751. get
  5752. {
  5753. return this.requestEnvelopeField;
  5754. }
  5755. set
  5756. {
  5757. this.requestEnvelopeField = value;
  5758. }
  5759. }
  5760. /// <summary>
  5761. ///
  5762. /// </summary>
  5763. private string invoiceIDField;
  5764. public string invoiceID
  5765. {
  5766. get
  5767. {
  5768. return this.invoiceIDField;
  5769. }
  5770. set
  5771. {
  5772. this.invoiceIDField = value;
  5773. }
  5774. }
  5775. /// <summary>
  5776. ///
  5777. /// </summary>
  5778. private string subjectField;
  5779. public string subject
  5780. {
  5781. get
  5782. {
  5783. return this.subjectField;
  5784. }
  5785. set
  5786. {
  5787. this.subjectField = value;
  5788. }
  5789. }
  5790. /// <summary>
  5791. ///
  5792. /// </summary>
  5793. private string noteForPayerField;
  5794. public string noteForPayer
  5795. {
  5796. get
  5797. {
  5798. return this.noteForPayerField;
  5799. }
  5800. set
  5801. {
  5802. this.noteForPayerField = value;
  5803. }
  5804. }
  5805. /// <summary>
  5806. ///
  5807. /// </summary>
  5808. private bool? sendCopyToMerchantField;
  5809. public bool? sendCopyToMerchant
  5810. {
  5811. get
  5812. {
  5813. return this.sendCopyToMerchantField;
  5814. }
  5815. set
  5816. {
  5817. this.sendCopyToMerchantField = value;
  5818. }
  5819. }
  5820. /// <summary>
  5821. ///
  5822. /// </summary>
  5823. private bool? sendPayerNotificationField;
  5824. public bool? sendPayerNotification
  5825. {
  5826. get
  5827. {
  5828. return this.sendPayerNotificationField;
  5829. }
  5830. set
  5831. {
  5832. this.sendPayerNotificationField = value;
  5833. }
  5834. }
  5835. /// <summary>
  5836. /// Constructor with arguments
  5837. /// </summary>
  5838. public CancelInvoiceRequest(RequestEnvelope requestEnvelope)
  5839. {
  5840. this.requestEnvelope = requestEnvelope;
  5841. }
  5842. /// <summary>
  5843. /// Default Constructor
  5844. /// </summary>
  5845. public CancelInvoiceRequest()
  5846. {
  5847. }
  5848. public string ToNVPString(string prefix)
  5849. {
  5850. StringBuilder sb = new StringBuilder();
  5851. if (this.requestEnvelope != null)
  5852. {
  5853. string newPrefix = prefix + "requestEnvelope" + ".";
  5854. sb.Append(this.requestEnvelopeField.ToNVPString(newPrefix));
  5855. }
  5856. if (this.invoiceID != null)
  5857. {
  5858. sb.Append(prefix).Append("invoiceID").Append("=").Append(HttpUtility.UrlEncode(this.invoiceID, BaseConstants.ENCODING_FORMAT)).Append("&");
  5859. }
  5860. if (this.subject != null)
  5861. {
  5862. sb.Append(prefix).Append("subject").Append("=").Append(HttpUtility.UrlEncode(this.subject, BaseConstants.ENCODING_FORMAT)).Append("&");
  5863. }
  5864. if (this.noteForPayer != null)
  5865. {
  5866. sb.Append(prefix).Append("noteForPayer").Append("=").Append(HttpUtility.UrlEncode(this.noteForPayer, BaseConstants.ENCODING_FORMAT)).Append("&");
  5867. }
  5868. if (this.sendCopyToMerchant != null)
  5869. {
  5870. sb.Append(prefix).Append("sendCopyToMerchant").Append("=").Append(Convert.ToString(this.sendCopyToMerchant, DefaultCulture)).Append("&");
  5871. }
  5872. if (this.sendPayerNotification != null)
  5873. {
  5874. sb.Append(prefix).Append("sendPayerNotification").Append("=").Append(Convert.ToString(this.sendPayerNotification, DefaultCulture)).Append("&");
  5875. }
  5876. return sb.ToString();
  5877. }
  5878. }
  5879. /// <summary>
  5880. /// The response object for CancelInvoice.
  5881. /// </summary>
  5882. public partial class CancelInvoiceResponse {
  5883. // Default US culture info
  5884. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  5885. /// <summary>
  5886. ///
  5887. /// </summary>
  5888. private ResponseEnvelope responseEnvelopeField;
  5889. public ResponseEnvelope responseEnvelope
  5890. {
  5891. get
  5892. {
  5893. return this.responseEnvelopeField;
  5894. }
  5895. set
  5896. {
  5897. this.responseEnvelopeField = value;
  5898. }
  5899. }
  5900. /// <summary>
  5901. ///
  5902. /// </summary>
  5903. private string invoiceIDField;
  5904. public string invoiceID
  5905. {
  5906. get
  5907. {
  5908. return this.invoiceIDField;
  5909. }
  5910. set
  5911. {
  5912. this.invoiceIDField = value;
  5913. }
  5914. }
  5915. /// <summary>
  5916. ///
  5917. /// </summary>
  5918. private string invoiceNumberField;
  5919. public string invoiceNumber
  5920. {
  5921. get
  5922. {
  5923. return this.invoiceNumberField;
  5924. }
  5925. set
  5926. {
  5927. this.invoiceNumberField = value;
  5928. }
  5929. }
  5930. /// <summary>
  5931. ///
  5932. /// </summary>
  5933. private string invoiceURLField;
  5934. public string invoiceURL
  5935. {
  5936. get
  5937. {
  5938. return this.invoiceURLField;
  5939. }
  5940. set
  5941. {
  5942. this.invoiceURLField = value;
  5943. }
  5944. }
  5945. /// <summary>
  5946. ///
  5947. /// </summary>
  5948. private List<ErrorData> errorField = new List<ErrorData>();
  5949. public List<ErrorData> error
  5950. {
  5951. get
  5952. {
  5953. return this.errorField;
  5954. }
  5955. set
  5956. {
  5957. this.errorField = value;
  5958. }
  5959. }
  5960. /// <summary>
  5961. /// Default Constructor
  5962. /// </summary>
  5963. public CancelInvoiceResponse()
  5964. {
  5965. }
  5966. /// <summary>
  5967. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  5968. /// </summary>
  5969. /// <param name="map">NVP map as returned by an API call</param>
  5970. /// <param name="prefix">NVP prefix for this class in the response</param>
  5971. /// <param name="index">For array elements, index of this element in the response</param>
  5972. /// <returns>
  5973. /// A new CancelInvoiceResponse object created from the passed in NVP map
  5974. /// </returns>
  5975. public static CancelInvoiceResponse CreateInstance(Dictionary<string, string> map, string prefix, int index)
  5976. {
  5977. CancelInvoiceResponse cancelInvoiceResponse = null;
  5978. string key;
  5979. int i = 0;
  5980. if(index != -1)
  5981. {
  5982. if (prefix.Length > 0 && !prefix.EndsWith("."))
  5983. {
  5984. prefix = prefix + "(" + index + ").";
  5985. }
  5986. }
  5987. else
  5988. {
  5989. if (prefix.Length > 0 && !prefix.EndsWith("."))
  5990. {
  5991. prefix = prefix + ".";
  5992. }
  5993. }
  5994. ResponseEnvelope responseEnvelope = ResponseEnvelope.CreateInstance(map, prefix + "responseEnvelope", -1);
  5995. if (responseEnvelope != null)
  5996. {
  5997. cancelInvoiceResponse = (cancelInvoiceResponse == null) ? new CancelInvoiceResponse() : cancelInvoiceResponse;
  5998. cancelInvoiceResponse.responseEnvelope = responseEnvelope;
  5999. }
  6000. key = prefix + "invoiceID";
  6001. if (map.ContainsKey(key))
  6002. {
  6003. cancelInvoiceResponse = (cancelInvoiceResponse == null) ? new CancelInvoiceResponse() : cancelInvoiceResponse;
  6004. cancelInvoiceResponse.invoiceID = map[key];
  6005. }
  6006. key = prefix + "invoiceNumber";
  6007. if (map.ContainsKey(key))
  6008. {
  6009. cancelInvoiceResponse = (cancelInvoiceResponse == null) ? new CancelInvoiceResponse() : cancelInvoiceResponse;
  6010. cancelInvoiceResponse.invoiceNumber = map[key];
  6011. }
  6012. key = prefix + "invoiceURL";
  6013. if (map.ContainsKey(key))
  6014. {
  6015. cancelInvoiceResponse = (cancelInvoiceResponse == null) ? new CancelInvoiceResponse() : cancelInvoiceResponse;
  6016. cancelInvoiceResponse.invoiceURL = map[key];
  6017. }
  6018. i = 0;
  6019. while(true)
  6020. {
  6021. ErrorData error = ErrorData.CreateInstance(map, prefix + "error", i);
  6022. if (error != null)
  6023. {
  6024. cancelInvoiceResponse = (cancelInvoiceResponse == null) ? new CancelInvoiceResponse() : cancelInvoiceResponse;
  6025. cancelInvoiceResponse.error.Add(error);
  6026. i++;
  6027. }
  6028. else
  6029. {
  6030. break;
  6031. }
  6032. }
  6033. return cancelInvoiceResponse;
  6034. }
  6035. }
  6036. /// <summary>
  6037. /// The request object for SearchInvoices.
  6038. /// </summary>
  6039. public partial class SearchInvoicesRequest {
  6040. // Default US culture info
  6041. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  6042. /// <summary>
  6043. ///
  6044. /// </summary>
  6045. private RequestEnvelope requestEnvelopeField;
  6046. public RequestEnvelope requestEnvelope
  6047. {
  6048. get
  6049. {
  6050. return this.requestEnvelopeField;
  6051. }
  6052. set
  6053. {
  6054. this.requestEnvelopeField = value;
  6055. }
  6056. }
  6057. /// <summary>
  6058. ///
  6059. /// </summary>
  6060. private string merchantEmailField;
  6061. public string merchantEmail
  6062. {
  6063. get
  6064. {
  6065. return this.merchantEmailField;
  6066. }
  6067. set
  6068. {
  6069. this.merchantEmailField = value;
  6070. }
  6071. }
  6072. /// <summary>
  6073. ///
  6074. /// </summary>
  6075. private SearchParametersType parametersField;
  6076. public SearchParametersType parameters
  6077. {
  6078. get
  6079. {
  6080. return this.parametersField;
  6081. }
  6082. set
  6083. {
  6084. this.parametersField = value;
  6085. }
  6086. }
  6087. /// <summary>
  6088. ///
  6089. /// </summary>
  6090. private int? pageField;
  6091. public int? page
  6092. {
  6093. get
  6094. {
  6095. return this.pageField;
  6096. }
  6097. set
  6098. {
  6099. this.pageField = value;
  6100. }
  6101. }
  6102. /// <summary>
  6103. ///
  6104. /// </summary>
  6105. private int? pageSizeField;
  6106. public int? pageSize
  6107. {
  6108. get
  6109. {
  6110. return this.pageSizeField;
  6111. }
  6112. set
  6113. {
  6114. this.pageSizeField = value;
  6115. }
  6116. }
  6117. /// <summary>
  6118. /// Constructor with arguments
  6119. /// </summary>
  6120. public SearchInvoicesRequest(RequestEnvelope requestEnvelope, string merchantEmail, SearchParametersType parameters, int? page, int? pageSize)
  6121. {
  6122. this.requestEnvelope = requestEnvelope;
  6123. this.merchantEmail = merchantEmail;
  6124. this.parameters = parameters;
  6125. this.page = page;
  6126. this.pageSize = pageSize;
  6127. }
  6128. /// <summary>
  6129. /// Default Constructor
  6130. /// </summary>
  6131. public SearchInvoicesRequest()
  6132. {
  6133. }
  6134. public string ToNVPString(string prefix)
  6135. {
  6136. StringBuilder sb = new StringBuilder();
  6137. if (this.requestEnvelope != null)
  6138. {
  6139. string newPrefix = prefix + "requestEnvelope" + ".";
  6140. sb.Append(this.requestEnvelopeField.ToNVPString(newPrefix));
  6141. }
  6142. if (this.merchantEmail != null)
  6143. {
  6144. sb.Append(prefix).Append("merchantEmail").Append("=").Append(HttpUtility.UrlEncode(this.merchantEmail, BaseConstants.ENCODING_FORMAT)).Append("&");
  6145. }
  6146. if (this.parameters != null)
  6147. {
  6148. string newPrefix = prefix + "parameters" + ".";
  6149. sb.Append(this.parametersField.ToNVPString(newPrefix));
  6150. }
  6151. if (this.page != null)
  6152. {
  6153. sb.Append(prefix).Append("page").Append("=").Append(Convert.ToString(this.page, DefaultCulture)).Append("&");
  6154. }
  6155. if (this.pageSize != null)
  6156. {
  6157. sb.Append(prefix).Append("pageSize").Append("=").Append(Convert.ToString(this.pageSize, DefaultCulture)).Append("&");
  6158. }
  6159. return sb.ToString();
  6160. }
  6161. }
  6162. /// <summary>
  6163. /// The response object for SearchInvoices.
  6164. /// </summary>
  6165. public partial class SearchInvoicesResponse {
  6166. // Default US culture info
  6167. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  6168. /// <summary>
  6169. ///
  6170. /// </summary>
  6171. private ResponseEnvelope responseEnvelopeField;
  6172. public ResponseEnvelope responseEnvelope
  6173. {
  6174. get
  6175. {
  6176. return this.responseEnvelopeField;
  6177. }
  6178. set
  6179. {
  6180. this.responseEnvelopeField = value;
  6181. }
  6182. }
  6183. /// <summary>
  6184. ///
  6185. /// </summary>
  6186. private int? countField;
  6187. public int? count
  6188. {
  6189. get
  6190. {
  6191. return this.countField;
  6192. }
  6193. set
  6194. {
  6195. this.countField = value;
  6196. }
  6197. }
  6198. /// <summary>
  6199. ///
  6200. /// </summary>
  6201. private InvoiceSummaryListType invoiceListField;
  6202. public InvoiceSummaryListType invoiceList
  6203. {
  6204. get
  6205. {
  6206. return this.invoiceListField;
  6207. }
  6208. set
  6209. {
  6210. this.invoiceListField = value;
  6211. }
  6212. }
  6213. /// <summary>
  6214. ///
  6215. /// </summary>
  6216. private int? pageField;
  6217. public int? page
  6218. {
  6219. get
  6220. {
  6221. return this.pageField;
  6222. }
  6223. set
  6224. {
  6225. this.pageField = value;
  6226. }
  6227. }
  6228. /// <summary>
  6229. ///
  6230. /// </summary>
  6231. private bool? hasNextPageField;
  6232. public bool? hasNextPage
  6233. {
  6234. get
  6235. {
  6236. return this.hasNextPageField;
  6237. }
  6238. set
  6239. {
  6240. this.hasNextPageField = value;
  6241. }
  6242. }
  6243. /// <summary>
  6244. ///
  6245. /// </summary>
  6246. private bool? hasPreviousPageField;
  6247. public bool? hasPreviousPage
  6248. {
  6249. get
  6250. {
  6251. return this.hasPreviousPageField;
  6252. }
  6253. set
  6254. {
  6255. this.hasPreviousPageField = value;
  6256. }
  6257. }
  6258. /// <summary>
  6259. ///
  6260. /// </summary>
  6261. private List<ErrorData> errorField = new List<ErrorData>();
  6262. public List<ErrorData> error
  6263. {
  6264. get
  6265. {
  6266. return this.errorField;
  6267. }
  6268. set
  6269. {
  6270. this.errorField = value;
  6271. }
  6272. }
  6273. /// <summary>
  6274. /// Default Constructor
  6275. /// </summary>
  6276. public SearchInvoicesResponse()
  6277. {
  6278. }
  6279. /// <summary>
  6280. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  6281. /// </summary>
  6282. /// <param name="map">NVP map as returned by an API call</param>
  6283. /// <param name="prefix">NVP prefix for this class in the response</param>
  6284. /// <param name="index">For array elements, index of this element in the response</param>
  6285. /// <returns>
  6286. /// A new SearchInvoicesResponse object created from the passed in NVP map
  6287. /// </returns>
  6288. public static SearchInvoicesResponse CreateInstance(Dictionary<string, string> map, string prefix, int index)
  6289. {
  6290. SearchInvoicesResponse searchInvoicesResponse = null;
  6291. string key;
  6292. int i = 0;
  6293. if(index != -1)
  6294. {
  6295. if (prefix.Length > 0 && !prefix.EndsWith("."))
  6296. {
  6297. prefix = prefix + "(" + index + ").";
  6298. }
  6299. }
  6300. else
  6301. {
  6302. if (prefix.Length > 0 && !prefix.EndsWith("."))
  6303. {
  6304. prefix = prefix + ".";
  6305. }
  6306. }
  6307. ResponseEnvelope responseEnvelope = ResponseEnvelope.CreateInstance(map, prefix + "responseEnvelope", -1);
  6308. if (responseEnvelope != null)
  6309. {
  6310. searchInvoicesResponse = (searchInvoicesResponse == null) ? new SearchInvoicesResponse() : searchInvoicesResponse;
  6311. searchInvoicesResponse.responseEnvelope = responseEnvelope;
  6312. }
  6313. key = prefix + "count";
  6314. if (map.ContainsKey(key))
  6315. {
  6316. searchInvoicesResponse = (searchInvoicesResponse == null) ? new SearchInvoicesResponse() : searchInvoicesResponse;
  6317. searchInvoicesResponse.count = System.Convert.ToInt32(map[key], DefaultCulture);
  6318. }
  6319. InvoiceSummaryListType invoiceList = InvoiceSummaryListType.CreateInstance(map, prefix + "invoiceList", -1);
  6320. if (invoiceList != null)
  6321. {
  6322. searchInvoicesResponse = (searchInvoicesResponse == null) ? new SearchInvoicesResponse() : searchInvoicesResponse;
  6323. searchInvoicesResponse.invoiceList = invoiceList;
  6324. }
  6325. key = prefix + "page";
  6326. if (map.ContainsKey(key))
  6327. {
  6328. searchInvoicesResponse = (searchInvoicesResponse == null) ? new SearchInvoicesResponse() : searchInvoicesResponse;
  6329. searchInvoicesResponse.page = System.Convert.ToInt32(map[key], DefaultCulture);
  6330. }
  6331. key = prefix + "hasNextPage";
  6332. if (map.ContainsKey(key))
  6333. {
  6334. searchInvoicesResponse = (searchInvoicesResponse == null) ? new SearchInvoicesResponse() : searchInvoicesResponse;
  6335. searchInvoicesResponse.hasNextPage = System.Convert.ToBoolean(map[key], DefaultCulture);
  6336. }
  6337. key = prefix + "hasPreviousPage";
  6338. if (map.ContainsKey(key))
  6339. {
  6340. searchInvoicesResponse = (searchInvoicesResponse == null) ? new SearchInvoicesResponse() : searchInvoicesResponse;
  6341. searchInvoicesResponse.hasPreviousPage = System.Convert.ToBoolean(map[key], DefaultCulture);
  6342. }
  6343. i = 0;
  6344. while(true)
  6345. {
  6346. ErrorData error = ErrorData.CreateInstance(map, prefix + "error", i);
  6347. if (error != null)
  6348. {
  6349. searchInvoicesResponse = (searchInvoicesResponse == null) ? new SearchInvoicesResponse() : searchInvoicesResponse;
  6350. searchInvoicesResponse.error.Add(error);
  6351. i++;
  6352. }
  6353. else
  6354. {
  6355. break;
  6356. }
  6357. }
  6358. return searchInvoicesResponse;
  6359. }
  6360. }
  6361. /// <summary>
  6362. /// The request object for MarkInvoiceAsPaid.
  6363. /// </summary>
  6364. public partial class MarkInvoiceAsPaidRequest {
  6365. // Default US culture info
  6366. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  6367. /// <summary>
  6368. ///
  6369. /// </summary>
  6370. private RequestEnvelope requestEnvelopeField;
  6371. public RequestEnvelope requestEnvelope
  6372. {
  6373. get
  6374. {
  6375. return this.requestEnvelopeField;
  6376. }
  6377. set
  6378. {
  6379. this.requestEnvelopeField = value;
  6380. }
  6381. }
  6382. /// <summary>
  6383. ///
  6384. /// </summary>
  6385. private string invoiceIDField;
  6386. public string invoiceID
  6387. {
  6388. get
  6389. {
  6390. return this.invoiceIDField;
  6391. }
  6392. set
  6393. {
  6394. this.invoiceIDField = value;
  6395. }
  6396. }
  6397. /// <summary>
  6398. ///
  6399. /// </summary>
  6400. private OtherPaymentDetailsType paymentField;
  6401. public OtherPaymentDetailsType payment
  6402. {
  6403. get
  6404. {
  6405. return this.paymentField;
  6406. }
  6407. set
  6408. {
  6409. this.paymentField = value;
  6410. }
  6411. }
  6412. /// <summary>
  6413. /// Constructor with arguments
  6414. /// </summary>
  6415. public MarkInvoiceAsPaidRequest(RequestEnvelope requestEnvelope, string invoiceID, OtherPaymentDetailsType payment)
  6416. {
  6417. this.requestEnvelope = requestEnvelope;
  6418. this.invoiceID = invoiceID;
  6419. this.payment = payment;
  6420. }
  6421. /// <summary>
  6422. /// Default Constructor
  6423. /// </summary>
  6424. public MarkInvoiceAsPaidRequest()
  6425. {
  6426. }
  6427. public string ToNVPString(string prefix)
  6428. {
  6429. StringBuilder sb = new StringBuilder();
  6430. if (this.requestEnvelope != null)
  6431. {
  6432. string newPrefix = prefix + "requestEnvelope" + ".";
  6433. sb.Append(this.requestEnvelopeField.ToNVPString(newPrefix));
  6434. }
  6435. if (this.invoiceID != null)
  6436. {
  6437. sb.Append(prefix).Append("invoiceID").Append("=").Append(HttpUtility.UrlEncode(this.invoiceID, BaseConstants.ENCODING_FORMAT)).Append("&");
  6438. }
  6439. if (this.payment != null)
  6440. {
  6441. string newPrefix = prefix + "payment" + ".";
  6442. sb.Append(this.paymentField.ToNVPString(newPrefix));
  6443. }
  6444. return sb.ToString();
  6445. }
  6446. }
  6447. /// <summary>
  6448. /// The response object for MarkInvoiceAsPaid.
  6449. /// </summary>
  6450. public partial class MarkInvoiceAsPaidResponse {
  6451. // Default US culture info
  6452. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  6453. /// <summary>
  6454. ///
  6455. /// </summary>
  6456. private ResponseEnvelope responseEnvelopeField;
  6457. public ResponseEnvelope responseEnvelope
  6458. {
  6459. get
  6460. {
  6461. return this.responseEnvelopeField;
  6462. }
  6463. set
  6464. {
  6465. this.responseEnvelopeField = value;
  6466. }
  6467. }
  6468. /// <summary>
  6469. ///
  6470. /// </summary>
  6471. private string invoiceIDField;
  6472. public string invoiceID
  6473. {
  6474. get
  6475. {
  6476. return this.invoiceIDField;
  6477. }
  6478. set
  6479. {
  6480. this.invoiceIDField = value;
  6481. }
  6482. }
  6483. /// <summary>
  6484. ///
  6485. /// </summary>
  6486. private string invoiceNumberField;
  6487. public string invoiceNumber
  6488. {
  6489. get
  6490. {
  6491. return this.invoiceNumberField;
  6492. }
  6493. set
  6494. {
  6495. this.invoiceNumberField = value;
  6496. }
  6497. }
  6498. /// <summary>
  6499. ///
  6500. /// </summary>
  6501. private string invoiceURLField;
  6502. public string invoiceURL
  6503. {
  6504. get
  6505. {
  6506. return this.invoiceURLField;
  6507. }
  6508. set
  6509. {
  6510. this.invoiceURLField = value;
  6511. }
  6512. }
  6513. /// <summary>
  6514. ///
  6515. /// </summary>
  6516. private List<ErrorData> errorField = new List<ErrorData>();
  6517. public List<ErrorData> error
  6518. {
  6519. get
  6520. {
  6521. return this.errorField;
  6522. }
  6523. set
  6524. {
  6525. this.errorField = value;
  6526. }
  6527. }
  6528. /// <summary>
  6529. /// Default Constructor
  6530. /// </summary>
  6531. public MarkInvoiceAsPaidResponse()
  6532. {
  6533. }
  6534. /// <summary>
  6535. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  6536. /// </summary>
  6537. /// <param name="map">NVP map as returned by an API call</param>
  6538. /// <param name="prefix">NVP prefix for this class in the response</param>
  6539. /// <param name="index">For array elements, index of this element in the response</param>
  6540. /// <returns>
  6541. /// A new MarkInvoiceAsPaidResponse object created from the passed in NVP map
  6542. /// </returns>
  6543. public static MarkInvoiceAsPaidResponse CreateInstance(Dictionary<string, string> map, string prefix, int index)
  6544. {
  6545. MarkInvoiceAsPaidResponse markInvoiceAsPaidResponse = null;
  6546. string key;
  6547. int i = 0;
  6548. if(index != -1)
  6549. {
  6550. if (prefix.Length > 0 && !prefix.EndsWith("."))
  6551. {
  6552. prefix = prefix + "(" + index + ").";
  6553. }
  6554. }
  6555. else
  6556. {
  6557. if (prefix.Length > 0 && !prefix.EndsWith("."))
  6558. {
  6559. prefix = prefix + ".";
  6560. }
  6561. }
  6562. ResponseEnvelope responseEnvelope = ResponseEnvelope.CreateInstance(map, prefix + "responseEnvelope", -1);
  6563. if (responseEnvelope != null)
  6564. {
  6565. markInvoiceAsPaidResponse = (markInvoiceAsPaidResponse == null) ? new MarkInvoiceAsPaidResponse() : markInvoiceAsPaidResponse;
  6566. markInvoiceAsPaidResponse.responseEnvelope = responseEnvelope;
  6567. }
  6568. key = prefix + "invoiceID";
  6569. if (map.ContainsKey(key))
  6570. {
  6571. markInvoiceAsPaidResponse = (markInvoiceAsPaidResponse == null) ? new MarkInvoiceAsPaidResponse() : markInvoiceAsPaidResponse;
  6572. markInvoiceAsPaidResponse.invoiceID = map[key];
  6573. }
  6574. key = prefix + "invoiceNumber";
  6575. if (map.ContainsKey(key))
  6576. {
  6577. markInvoiceAsPaidResponse = (markInvoiceAsPaidResponse == null) ? new MarkInvoiceAsPaidResponse() : markInvoiceAsPaidResponse;
  6578. markInvoiceAsPaidResponse.invoiceNumber = map[key];
  6579. }
  6580. key = prefix + "invoiceURL";
  6581. if (map.ContainsKey(key))
  6582. {
  6583. markInvoiceAsPaidResponse = (markInvoiceAsPaidResponse == null) ? new MarkInvoiceAsPaidResponse() : markInvoiceAsPaidResponse;
  6584. markInvoiceAsPaidResponse.invoiceURL = map[key];
  6585. }
  6586. i = 0;
  6587. while(true)
  6588. {
  6589. ErrorData error = ErrorData.CreateInstance(map, prefix + "error", i);
  6590. if (error != null)
  6591. {
  6592. markInvoiceAsPaidResponse = (markInvoiceAsPaidResponse == null) ? new MarkInvoiceAsPaidResponse() : markInvoiceAsPaidResponse;
  6593. markInvoiceAsPaidResponse.error.Add(error);
  6594. i++;
  6595. }
  6596. else
  6597. {
  6598. break;
  6599. }
  6600. }
  6601. return markInvoiceAsPaidResponse;
  6602. }
  6603. }
  6604. /// <summary>
  6605. /// The request object for MarkInvoiceAsRefunded.
  6606. /// </summary>
  6607. public partial class MarkInvoiceAsRefundedRequest {
  6608. // Default US culture info
  6609. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  6610. /// <summary>
  6611. ///
  6612. /// </summary>
  6613. private RequestEnvelope requestEnvelopeField;
  6614. public RequestEnvelope requestEnvelope
  6615. {
  6616. get
  6617. {
  6618. return this.requestEnvelopeField;
  6619. }
  6620. set
  6621. {
  6622. this.requestEnvelopeField = value;
  6623. }
  6624. }
  6625. /// <summary>
  6626. ///
  6627. /// </summary>
  6628. private string invoiceIDField;
  6629. public string invoiceID
  6630. {
  6631. get
  6632. {
  6633. return this.invoiceIDField;
  6634. }
  6635. set
  6636. {
  6637. this.invoiceIDField = value;
  6638. }
  6639. }
  6640. /// <summary>
  6641. ///
  6642. /// </summary>
  6643. private OtherPaymentRefundDetailsType refundDetailField;
  6644. public OtherPaymentRefundDetailsType refundDetail
  6645. {
  6646. get
  6647. {
  6648. return this.refundDetailField;
  6649. }
  6650. set
  6651. {
  6652. this.refundDetailField = value;
  6653. }
  6654. }
  6655. /// <summary>
  6656. /// Constructor with arguments
  6657. /// </summary>
  6658. public MarkInvoiceAsRefundedRequest(RequestEnvelope requestEnvelope, string invoiceID, OtherPaymentRefundDetailsType refundDetail)
  6659. {
  6660. this.requestEnvelope = requestEnvelope;
  6661. this.invoiceID = invoiceID;
  6662. this.refundDetail = refundDetail;
  6663. }
  6664. /// <summary>
  6665. /// Default Constructor
  6666. /// </summary>
  6667. public MarkInvoiceAsRefundedRequest()
  6668. {
  6669. }
  6670. public string ToNVPString(string prefix)
  6671. {
  6672. StringBuilder sb = new StringBuilder();
  6673. if (this.requestEnvelope != null)
  6674. {
  6675. string newPrefix = prefix + "requestEnvelope" + ".";
  6676. sb.Append(this.requestEnvelopeField.ToNVPString(newPrefix));
  6677. }
  6678. if (this.invoiceID != null)
  6679. {
  6680. sb.Append(prefix).Append("invoiceID").Append("=").Append(HttpUtility.UrlEncode(this.invoiceID, BaseConstants.ENCODING_FORMAT)).Append("&");
  6681. }
  6682. if (this.refundDetail != null)
  6683. {
  6684. string newPrefix = prefix + "refundDetail" + ".";
  6685. sb.Append(this.refundDetailField.ToNVPString(newPrefix));
  6686. }
  6687. return sb.ToString();
  6688. }
  6689. }
  6690. /// <summary>
  6691. /// The response object for MarkInvoiceAsRefunded.
  6692. /// </summary>
  6693. public partial class MarkInvoiceAsRefundedResponse {
  6694. // Default US culture info
  6695. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  6696. /// <summary>
  6697. ///
  6698. /// </summary>
  6699. private ResponseEnvelope responseEnvelopeField;
  6700. public ResponseEnvelope responseEnvelope
  6701. {
  6702. get
  6703. {
  6704. return this.responseEnvelopeField;
  6705. }
  6706. set
  6707. {
  6708. this.responseEnvelopeField = value;
  6709. }
  6710. }
  6711. /// <summary>
  6712. ///
  6713. /// </summary>
  6714. private string invoiceIDField;
  6715. public string invoiceID
  6716. {
  6717. get
  6718. {
  6719. return this.invoiceIDField;
  6720. }
  6721. set
  6722. {
  6723. this.invoiceIDField = value;
  6724. }
  6725. }
  6726. /// <summary>
  6727. ///
  6728. /// </summary>
  6729. private string invoiceNumberField;
  6730. public string invoiceNumber
  6731. {
  6732. get
  6733. {
  6734. return this.invoiceNumberField;
  6735. }
  6736. set
  6737. {
  6738. this.invoiceNumberField = value;
  6739. }
  6740. }
  6741. /// <summary>
  6742. ///
  6743. /// </summary>
  6744. private string invoiceURLField;
  6745. public string invoiceURL
  6746. {
  6747. get
  6748. {
  6749. return this.invoiceURLField;
  6750. }
  6751. set
  6752. {
  6753. this.invoiceURLField = value;
  6754. }
  6755. }
  6756. /// <summary>
  6757. ///
  6758. /// </summary>
  6759. private List<ErrorData> errorField = new List<ErrorData>();
  6760. public List<ErrorData> error
  6761. {
  6762. get
  6763. {
  6764. return this.errorField;
  6765. }
  6766. set
  6767. {
  6768. this.errorField = value;
  6769. }
  6770. }
  6771. /// <summary>
  6772. /// Default Constructor
  6773. /// </summary>
  6774. public MarkInvoiceAsRefundedResponse()
  6775. {
  6776. }
  6777. /// <summary>
  6778. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  6779. /// </summary>
  6780. /// <param name="map">NVP map as returned by an API call</param>
  6781. /// <param name="prefix">NVP prefix for this class in the response</param>
  6782. /// <param name="index">For array elements, index of this element in the response</param>
  6783. /// <returns>
  6784. /// A new MarkInvoiceAsRefundedResponse object created from the passed in NVP map
  6785. /// </returns>
  6786. public static MarkInvoiceAsRefundedResponse CreateInstance(Dictionary<string, string> map, string prefix, int index)
  6787. {
  6788. MarkInvoiceAsRefundedResponse markInvoiceAsRefundedResponse = null;
  6789. string key;
  6790. int i = 0;
  6791. if(index != -1)
  6792. {
  6793. if (prefix.Length > 0 && !prefix.EndsWith("."))
  6794. {
  6795. prefix = prefix + "(" + index + ").";
  6796. }
  6797. }
  6798. else
  6799. {
  6800. if (prefix.Length > 0 && !prefix.EndsWith("."))
  6801. {
  6802. prefix = prefix + ".";
  6803. }
  6804. }
  6805. ResponseEnvelope responseEnvelope = ResponseEnvelope.CreateInstance(map, prefix + "responseEnvelope", -1);
  6806. if (responseEnvelope != null)
  6807. {
  6808. markInvoiceAsRefundedResponse = (markInvoiceAsRefundedResponse == null) ? new MarkInvoiceAsRefundedResponse() : markInvoiceAsRefundedResponse;
  6809. markInvoiceAsRefundedResponse.responseEnvelope = responseEnvelope;
  6810. }
  6811. key = prefix + "invoiceID";
  6812. if (map.ContainsKey(key))
  6813. {
  6814. markInvoiceAsRefundedResponse = (markInvoiceAsRefundedResponse == null) ? new MarkInvoiceAsRefundedResponse() : markInvoiceAsRefundedResponse;
  6815. markInvoiceAsRefundedResponse.invoiceID = map[key];
  6816. }
  6817. key = prefix + "invoiceNumber";
  6818. if (map.ContainsKey(key))
  6819. {
  6820. markInvoiceAsRefundedResponse = (markInvoiceAsRefundedResponse == null) ? new MarkInvoiceAsRefundedResponse() : markInvoiceAsRefundedResponse;
  6821. markInvoiceAsRefundedResponse.invoiceNumber = map[key];
  6822. }
  6823. key = prefix + "invoiceURL";
  6824. if (map.ContainsKey(key))
  6825. {
  6826. markInvoiceAsRefundedResponse = (markInvoiceAsRefundedResponse == null) ? new MarkInvoiceAsRefundedResponse() : markInvoiceAsRefundedResponse;
  6827. markInvoiceAsRefundedResponse.invoiceURL = map[key];
  6828. }
  6829. i = 0;
  6830. while(true)
  6831. {
  6832. ErrorData error = ErrorData.CreateInstance(map, prefix + "error", i);
  6833. if (error != null)
  6834. {
  6835. markInvoiceAsRefundedResponse = (markInvoiceAsRefundedResponse == null) ? new MarkInvoiceAsRefundedResponse() : markInvoiceAsRefundedResponse;
  6836. markInvoiceAsRefundedResponse.error.Add(error);
  6837. i++;
  6838. }
  6839. else
  6840. {
  6841. break;
  6842. }
  6843. }
  6844. return markInvoiceAsRefundedResponse;
  6845. }
  6846. }
  6847. /// <summary>
  6848. /// The request object for MarkInvoiceAsUnpaid.
  6849. /// </summary>
  6850. public partial class MarkInvoiceAsUnpaidRequest {
  6851. // Default US culture info
  6852. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  6853. /// <summary>
  6854. ///
  6855. /// </summary>
  6856. private RequestEnvelope requestEnvelopeField;
  6857. public RequestEnvelope requestEnvelope
  6858. {
  6859. get
  6860. {
  6861. return this.requestEnvelopeField;
  6862. }
  6863. set
  6864. {
  6865. this.requestEnvelopeField = value;
  6866. }
  6867. }
  6868. /// <summary>
  6869. ///
  6870. /// </summary>
  6871. private string invoiceIDField;
  6872. public string invoiceID
  6873. {
  6874. get
  6875. {
  6876. return this.invoiceIDField;
  6877. }
  6878. set
  6879. {
  6880. this.invoiceIDField = value;
  6881. }
  6882. }
  6883. /// <summary>
  6884. /// Constructor with arguments
  6885. /// </summary>
  6886. public MarkInvoiceAsUnpaidRequest(RequestEnvelope requestEnvelope, string invoiceID)
  6887. {
  6888. this.requestEnvelope = requestEnvelope;
  6889. this.invoiceID = invoiceID;
  6890. }
  6891. /// <summary>
  6892. /// Default Constructor
  6893. /// </summary>
  6894. public MarkInvoiceAsUnpaidRequest()
  6895. {
  6896. }
  6897. public string ToNVPString(string prefix)
  6898. {
  6899. StringBuilder sb = new StringBuilder();
  6900. if (this.requestEnvelope != null)
  6901. {
  6902. string newPrefix = prefix + "requestEnvelope" + ".";
  6903. sb.Append(this.requestEnvelopeField.ToNVPString(newPrefix));
  6904. }
  6905. if (this.invoiceID != null)
  6906. {
  6907. sb.Append(prefix).Append("invoiceID").Append("=").Append(HttpUtility.UrlEncode(this.invoiceID, BaseConstants.ENCODING_FORMAT)).Append("&");
  6908. }
  6909. return sb.ToString();
  6910. }
  6911. }
  6912. /// <summary>
  6913. /// The response object for MarkInvoiceAsUnpaid.
  6914. /// </summary>
  6915. public partial class MarkInvoiceAsUnpaidResponse {
  6916. // Default US culture info
  6917. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  6918. /// <summary>
  6919. ///
  6920. /// </summary>
  6921. private ResponseEnvelope responseEnvelopeField;
  6922. public ResponseEnvelope responseEnvelope
  6923. {
  6924. get
  6925. {
  6926. return this.responseEnvelopeField;
  6927. }
  6928. set
  6929. {
  6930. this.responseEnvelopeField = value;
  6931. }
  6932. }
  6933. /// <summary>
  6934. ///
  6935. /// </summary>
  6936. private string invoiceIDField;
  6937. public string invoiceID
  6938. {
  6939. get
  6940. {
  6941. return this.invoiceIDField;
  6942. }
  6943. set
  6944. {
  6945. this.invoiceIDField = value;
  6946. }
  6947. }
  6948. /// <summary>
  6949. ///
  6950. /// </summary>
  6951. private string invoiceNumberField;
  6952. public string invoiceNumber
  6953. {
  6954. get
  6955. {
  6956. return this.invoiceNumberField;
  6957. }
  6958. set
  6959. {
  6960. this.invoiceNumberField = value;
  6961. }
  6962. }
  6963. /// <summary>
  6964. ///
  6965. /// </summary>
  6966. private string invoiceURLField;
  6967. public string invoiceURL
  6968. {
  6969. get
  6970. {
  6971. return this.invoiceURLField;
  6972. }
  6973. set
  6974. {
  6975. this.invoiceURLField = value;
  6976. }
  6977. }
  6978. /// <summary>
  6979. ///
  6980. /// </summary>
  6981. private List<ErrorData> errorField = new List<ErrorData>();
  6982. public List<ErrorData> error
  6983. {
  6984. get
  6985. {
  6986. return this.errorField;
  6987. }
  6988. set
  6989. {
  6990. this.errorField = value;
  6991. }
  6992. }
  6993. /// <summary>
  6994. /// Default Constructor
  6995. /// </summary>
  6996. public MarkInvoiceAsUnpaidResponse()
  6997. {
  6998. }
  6999. /// <summary>
  7000. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  7001. /// </summary>
  7002. /// <param name="map">NVP map as returned by an API call</param>
  7003. /// <param name="prefix">NVP prefix for this class in the response</param>
  7004. /// <param name="index">For array elements, index of this element in the response</param>
  7005. /// <returns>
  7006. /// A new MarkInvoiceAsUnpaidResponse object created from the passed in NVP map
  7007. /// </returns>
  7008. public static MarkInvoiceAsUnpaidResponse CreateInstance(Dictionary<string, string> map, string prefix, int index)
  7009. {
  7010. MarkInvoiceAsUnpaidResponse markInvoiceAsUnpaidResponse = null;
  7011. string key;
  7012. int i = 0;
  7013. if(index != -1)
  7014. {
  7015. if (prefix.Length > 0 && !prefix.EndsWith("."))
  7016. {
  7017. prefix = prefix + "(" + index + ").";
  7018. }
  7019. }
  7020. else
  7021. {
  7022. if (prefix.Length > 0 && !prefix.EndsWith("."))
  7023. {
  7024. prefix = prefix + ".";
  7025. }
  7026. }
  7027. ResponseEnvelope responseEnvelope = ResponseEnvelope.CreateInstance(map, prefix + "responseEnvelope", -1);
  7028. if (responseEnvelope != null)
  7029. {
  7030. markInvoiceAsUnpaidResponse = (markInvoiceAsUnpaidResponse == null) ? new MarkInvoiceAsUnpaidResponse() : markInvoiceAsUnpaidResponse;
  7031. markInvoiceAsUnpaidResponse.responseEnvelope = responseEnvelope;
  7032. }
  7033. key = prefix + "invoiceID";
  7034. if (map.ContainsKey(key))
  7035. {
  7036. markInvoiceAsUnpaidResponse = (markInvoiceAsUnpaidResponse == null) ? new MarkInvoiceAsUnpaidResponse() : markInvoiceAsUnpaidResponse;
  7037. markInvoiceAsUnpaidResponse.invoiceID = map[key];
  7038. }
  7039. key = prefix + "invoiceNumber";
  7040. if (map.ContainsKey(key))
  7041. {
  7042. markInvoiceAsUnpaidResponse = (markInvoiceAsUnpaidResponse == null) ? new MarkInvoiceAsUnpaidResponse() : markInvoiceAsUnpaidResponse;
  7043. markInvoiceAsUnpaidResponse.invoiceNumber = map[key];
  7044. }
  7045. key = prefix + "invoiceURL";
  7046. if (map.ContainsKey(key))
  7047. {
  7048. markInvoiceAsUnpaidResponse = (markInvoiceAsUnpaidResponse == null) ? new MarkInvoiceAsUnpaidResponse() : markInvoiceAsUnpaidResponse;
  7049. markInvoiceAsUnpaidResponse.invoiceURL = map[key];
  7050. }
  7051. i = 0;
  7052. while(true)
  7053. {
  7054. ErrorData error = ErrorData.CreateInstance(map, prefix + "error", i);
  7055. if (error != null)
  7056. {
  7057. markInvoiceAsUnpaidResponse = (markInvoiceAsUnpaidResponse == null) ? new MarkInvoiceAsUnpaidResponse() : markInvoiceAsUnpaidResponse;
  7058. markInvoiceAsUnpaidResponse.error.Add(error);
  7059. i++;
  7060. }
  7061. else
  7062. {
  7063. break;
  7064. }
  7065. }
  7066. return markInvoiceAsUnpaidResponse;
  7067. }
  7068. }
  7069. /// <summary>
  7070. /// Payment refund details about the invoice.
  7071. /// </summary>
  7072. public partial class PaymentRefundDetailsType {
  7073. // Default US culture info
  7074. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  7075. /// <summary>
  7076. ///
  7077. /// </summary>
  7078. private bool? viaPayPalField;
  7079. public bool? viaPayPal
  7080. {
  7081. get
  7082. {
  7083. return this.viaPayPalField;
  7084. }
  7085. set
  7086. {
  7087. this.viaPayPalField = value;
  7088. }
  7089. }
  7090. /// <summary>
  7091. ///
  7092. /// </summary>
  7093. private PayPalPaymentRefundDetailsType paypalPaymentField;
  7094. public PayPalPaymentRefundDetailsType paypalPayment
  7095. {
  7096. get
  7097. {
  7098. return this.paypalPaymentField;
  7099. }
  7100. set
  7101. {
  7102. this.paypalPaymentField = value;
  7103. }
  7104. }
  7105. /// <summary>
  7106. ///
  7107. /// </summary>
  7108. private OtherPaymentRefundDetailsType otherPaymentField;
  7109. public OtherPaymentRefundDetailsType otherPayment
  7110. {
  7111. get
  7112. {
  7113. return this.otherPaymentField;
  7114. }
  7115. set
  7116. {
  7117. this.otherPaymentField = value;
  7118. }
  7119. }
  7120. /// <summary>
  7121. /// Default Constructor
  7122. /// </summary>
  7123. public PaymentRefundDetailsType()
  7124. {
  7125. }
  7126. /// <summary>
  7127. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  7128. /// </summary>
  7129. /// <param name="map">NVP map as returned by an API call</param>
  7130. /// <param name="prefix">NVP prefix for this class in the response</param>
  7131. /// <param name="index">For array elements, index of this element in the response</param>
  7132. /// <returns>
  7133. /// A new PaymentRefundDetailsType object created from the passed in NVP map
  7134. /// </returns>
  7135. public static PaymentRefundDetailsType CreateInstance(Dictionary<string, string> map, string prefix, int index)
  7136. {
  7137. PaymentRefundDetailsType paymentRefundDetailsType = null;
  7138. string key;
  7139. int i = 0;
  7140. if(index != -1)
  7141. {
  7142. if (prefix.Length > 0 && !prefix.EndsWith("."))
  7143. {
  7144. prefix = prefix + "(" + index + ").";
  7145. }
  7146. }
  7147. else
  7148. {
  7149. if (prefix.Length > 0 && !prefix.EndsWith("."))
  7150. {
  7151. prefix = prefix + ".";
  7152. }
  7153. }
  7154. key = prefix + "viaPayPal";
  7155. if (map.ContainsKey(key))
  7156. {
  7157. paymentRefundDetailsType = (paymentRefundDetailsType == null) ? new PaymentRefundDetailsType() : paymentRefundDetailsType;
  7158. paymentRefundDetailsType.viaPayPal = System.Convert.ToBoolean(map[key], DefaultCulture);
  7159. }
  7160. PayPalPaymentRefundDetailsType paypalPayment = PayPalPaymentRefundDetailsType.CreateInstance(map, prefix + "paypalPayment", -1);
  7161. if (paypalPayment != null)
  7162. {
  7163. paymentRefundDetailsType = (paymentRefundDetailsType == null) ? new PaymentRefundDetailsType() : paymentRefundDetailsType;
  7164. paymentRefundDetailsType.paypalPayment = paypalPayment;
  7165. }
  7166. OtherPaymentRefundDetailsType otherPayment = OtherPaymentRefundDetailsType.CreateInstance(map, prefix + "otherPayment", -1);
  7167. if (otherPayment != null)
  7168. {
  7169. paymentRefundDetailsType = (paymentRefundDetailsType == null) ? new PaymentRefundDetailsType() : paymentRefundDetailsType;
  7170. paymentRefundDetailsType.otherPayment = otherPayment;
  7171. }
  7172. return paymentRefundDetailsType;
  7173. }
  7174. }
  7175. /// <summary>
  7176. /// The request object for DeleteInvoice.
  7177. /// </summary>
  7178. public partial class DeleteInvoiceRequest {
  7179. // Default US culture info
  7180. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  7181. /// <summary>
  7182. ///
  7183. /// </summary>
  7184. private RequestEnvelope requestEnvelopeField;
  7185. public RequestEnvelope requestEnvelope
  7186. {
  7187. get
  7188. {
  7189. return this.requestEnvelopeField;
  7190. }
  7191. set
  7192. {
  7193. this.requestEnvelopeField = value;
  7194. }
  7195. }
  7196. /// <summary>
  7197. ///
  7198. /// </summary>
  7199. private string invoiceIDField;
  7200. public string invoiceID
  7201. {
  7202. get
  7203. {
  7204. return this.invoiceIDField;
  7205. }
  7206. set
  7207. {
  7208. this.invoiceIDField = value;
  7209. }
  7210. }
  7211. /// <summary>
  7212. /// Constructor with arguments
  7213. /// </summary>
  7214. public DeleteInvoiceRequest(RequestEnvelope requestEnvelope, string invoiceID)
  7215. {
  7216. this.requestEnvelope = requestEnvelope;
  7217. this.invoiceID = invoiceID;
  7218. }
  7219. /// <summary>
  7220. /// Default Constructor
  7221. /// </summary>
  7222. public DeleteInvoiceRequest()
  7223. {
  7224. }
  7225. public string ToNVPString(string prefix)
  7226. {
  7227. StringBuilder sb = new StringBuilder();
  7228. if (this.requestEnvelope != null)
  7229. {
  7230. string newPrefix = prefix + "requestEnvelope" + ".";
  7231. sb.Append(this.requestEnvelopeField.ToNVPString(newPrefix));
  7232. }
  7233. if (this.invoiceID != null)
  7234. {
  7235. sb.Append(prefix).Append("invoiceID").Append("=").Append(HttpUtility.UrlEncode(this.invoiceID, BaseConstants.ENCODING_FORMAT)).Append("&");
  7236. }
  7237. return sb.ToString();
  7238. }
  7239. }
  7240. /// <summary>
  7241. /// The response object for DeleteInvoice.
  7242. /// </summary>
  7243. public partial class DeleteInvoiceResponse {
  7244. // Default US culture info
  7245. private static CultureInfo DefaultCulture = new CultureInfo("en-US");
  7246. /// <summary>
  7247. ///
  7248. /// </summary>
  7249. private ResponseEnvelope responseEnvelopeField;
  7250. public ResponseEnvelope responseEnvelope
  7251. {
  7252. get
  7253. {
  7254. return this.responseEnvelopeField;
  7255. }
  7256. set
  7257. {
  7258. this.responseEnvelopeField = value;
  7259. }
  7260. }
  7261. /// <summary>
  7262. ///
  7263. /// </summary>
  7264. private List<ErrorData> errorField = new List<ErrorData>();
  7265. public List<ErrorData> error
  7266. {
  7267. get
  7268. {
  7269. return this.errorField;
  7270. }
  7271. set
  7272. {
  7273. this.errorField = value;
  7274. }
  7275. }
  7276. /// <summary>
  7277. /// Default Constructor
  7278. /// </summary>
  7279. public DeleteInvoiceResponse()
  7280. {
  7281. }
  7282. /// <summary>
  7283. /// Factory method for creating new object instances. For use by the de-serialization classes only.
  7284. /// </summary>
  7285. /// <param name="map">NVP map as returned by an API call</param>
  7286. /// <param name="prefix">NVP prefix for this class in the response</param>
  7287. /// <param name="index">For array elements, index of this element in the response</param>
  7288. /// <returns>
  7289. /// A new DeleteInvoiceResponse object created from the passed in NVP map
  7290. /// </returns>
  7291. public static DeleteInvoiceResponse CreateInstance(Dictionary<string, string> map, string prefix, int index)
  7292. {
  7293. DeleteInvoiceResponse deleteInvoiceResponse = null;
  7294. string key;
  7295. int i = 0;
  7296. if(index != -1)
  7297. {
  7298. if (prefix.Length > 0 && !prefix.EndsWith("."))
  7299. {
  7300. prefix = prefix + "(" + index + ").";
  7301. }
  7302. }
  7303. else
  7304. {
  7305. if (prefix.Length > 0 && !prefix.EndsWith("."))
  7306. {
  7307. prefix = prefix + ".";
  7308. }
  7309. }
  7310. ResponseEnvelope responseEnvelope = ResponseEnvelope.CreateInstance(map, prefix + "responseEnvelope", -1);
  7311. if (responseEnvelope != null)
  7312. {
  7313. deleteInvoiceResponse = (deleteInvoiceResponse == null) ? new DeleteInvoiceResponse() : deleteInvoiceResponse;
  7314. deleteInvoiceResponse.responseEnvelope = responseEnvelope;
  7315. }
  7316. i = 0;
  7317. while(true)
  7318. {
  7319. ErrorData error = ErrorData.CreateInstance(map, prefix + "error", i);
  7320. if (error != null)
  7321. {
  7322. deleteInvoiceResponse = (deleteInvoiceResponse == null) ? new DeleteInvoiceResponse() : deleteInvoiceResponse;
  7323. deleteInvoiceResponse.error.Add(error);
  7324. i++;
  7325. }
  7326. else
  7327. {
  7328. break;
  7329. }
  7330. }
  7331. return deleteInvoiceResponse;
  7332. }
  7333. }
  7334. }