/PayPalMobilePayment/binding/paypal.cs

https://github.com/mono/monotouch-bindings · C# · 403 lines · 279 code · 116 blank · 8 comment · 0 complexity · 23a51042fea53a04f9a2d2aaaba00682 MD5 · raw file

  1. /*
  2. * paypal.cs: API definitions
  3. *
  4. * Author:
  5. * Miguel de Icaza (miguel@xamarin.com)
  6. *
  7. * Copyright 2011 Xamarin, Inc.
  8. */
  9. using System;
  10. using MonoTouch.Foundation;
  11. using MonoTouch.UIKit;
  12. using MonoTouch.ObjCRuntime;
  13. namespace MonoTouch.PayPal {
  14. [BaseType (typeof (NSObject))]
  15. [Model]
  16. [Protocol]
  17. interface PayPalPaymentDelegate {
  18. [Abstract]
  19. [Export ("paymentSuccessWithKey:andStatus:")]
  20. void PaymentSuccess (string payKey, PayPalPaymentStatus paymentStatus);
  21. [Abstract]
  22. [Export ("paymentFailedWithCorrelationID:")]
  23. void PaymentFailed (string correlationID);
  24. [Abstract]
  25. [Export ("paymentCanceled")]
  26. void PaymentCanceled ();
  27. [Abstract]
  28. [Export ("paymentLibraryExit")]
  29. void PaymentLibraryExit ();
  30. [Export ("adjustAmountsForAddress:andCurrency:andAmount:andTax:andShipping:andErrorCode:")]
  31. PayPalAmounts AdjustAmounts (PayPalAddress address, string currency, NSDecimalNumber amount, NSDecimalNumber tax, NSDecimalNumber shipping, out int payPalAmountErrorCode);
  32. [Export ("adjustAmountsAdvancedForAddress:andCurrency:andReceiverAmounts:andErrorCode:")]
  33. PayPalReceiverAmounts [] AdjustAmountsAdvanced (PayPalAddress Address, string currency, PayPalReceiverAmounts [] receiverAmounts, out int PayPalAmountErrorCode);
  34. }
  35. [BaseType (typeof (NSObject))]
  36. interface PayPal {
  37. [Export ("delegate"), NullAllowed]
  38. NSObject WeakDelegate { get; set; }
  39. [Wrap ("WeakDelegate")]
  40. PayPalPaymentDelegate Delegate { get; set; }
  41. [Export ("paymentsEnabled")]
  42. bool PaymentsEnabled { get; }
  43. [Export ("shippingEnabled")]
  44. bool ShippingEnabled { get; set; }
  45. [Export ("dynamicAmountUpdateEnabled")]
  46. bool DynamicAmountUpdateEnabled { get; set; }
  47. [Export ("appID")]
  48. string AppID { get; }
  49. [Export ("lang")]
  50. string Language { get; set; }
  51. [Export ("environment")]
  52. PayPalEnvironment Environment { get; }
  53. [Export ("buttonText")]
  54. PayPalButtonText ButtonText { get; }
  55. [Export ("feePayer")]
  56. PayPalFeePayer FeePayer { get; set; }
  57. [Export ("payment")]
  58. PayPalAdvancedPayment Payment { get; }
  59. [Export ("preapprovalDetails")]
  60. PayPalPreapprovalDetails PreapprovalDetails { get; }
  61. [Export ("payButtons")]
  62. UIButton []PayButtons { get; set; }
  63. [Export ("responseMessage")]
  64. NSMutableDictionary ResponseMessage { get; set; }
  65. [Static]
  66. [Export ("getInstance")]
  67. PayPal SharedInstance { get; }
  68. [Static]
  69. [Export ("initializeWithAppID:")]
  70. PayPal Create (string appID);
  71. [Static]
  72. [Export ("initializeWithAppID:forEnvironment:")]
  73. PayPal Create (string inAppID, PayPalEnvironment env);
  74. [Static]
  75. [Export ("initializationStatus")]
  76. PayPalInitializationStatus InitializationStatus { get; }
  77. [Static]
  78. [Export ("buildVersion")]
  79. string BuildVersion { get; }
  80. [Export ("getPayButtonWithTarget:andAction:andButtonType:andButtonText:"), Internal]
  81. UIButton GetPayButton (PayPalPaymentDelegate target, Selector action, PayPalButtonType theButtonType, PayPalButtonText theButtonText);
  82. [Export ("getPayButtonWithTarget:andAction:andButtonType:"), Internal]
  83. UIButton GetPayButton (PayPalPaymentDelegate target, Selector action, PayPalButtonType theButtonType);
  84. [Export ("checkoutWithPayment:")]
  85. void Checkout (PayPalPayment payment);
  86. [Export ("advancedCheckoutWithPayment:")]
  87. void AdvancedCheckout (PayPalAdvancedPayment payment);
  88. [Export ("preapprovalWithKey:andMerchantName:")]
  89. void Preapproval (string preapprovalKey, string merchantName);
  90. }
  91. [BaseType (typeof (NSObject))]
  92. interface PayPalReceiverPaymentDetails {
  93. [Export ("recipient")]
  94. string Recipient { get; set; }
  95. [Export ("subTotal")]
  96. double SubTotal { get; set; }
  97. [Export ("isPrimary")]
  98. bool IsPrimary { get; set; }
  99. [Export ("paymentType")]
  100. PayPalPaymentType PaymentType { get; set; }
  101. [Export ("paymentSubType")]
  102. PayPalPaymentSubType PaymentSubType { get; set; }
  103. [Export ("invoiceData")]
  104. PayPalInvoiceData InvoiceData { get; set; }
  105. [Export ("description")]
  106. string Description { get; set; }
  107. [Export ("customId")]
  108. string CustomId { get; set; }
  109. [Export ("merchantName")]
  110. string MerchantName { get; set; }
  111. [Export ("total")]
  112. double Total { get; }
  113. }
  114. [BaseType (typeof (NSObject))]
  115. interface PayPalAddress {
  116. [Export ("name")]
  117. string Name { get; }
  118. [Export ("street1")]
  119. string Street1 { get; }
  120. [Export ("street2")]
  121. string Street2 { get; }
  122. [Export ("city")]
  123. string City { get; }
  124. [Export ("state")]
  125. string State { get; }
  126. [Export ("postalcode")]
  127. string PostalCode { get; }
  128. [Export ("countrycode")]
  129. string CountryCode { get; }
  130. }
  131. [BaseType (typeof (NSObject))]
  132. interface PayPalPayment {
  133. [Export ("paymentCurrency")]
  134. string PaymentCurrency { get; set; }
  135. [Export ("subTotal")]
  136. double SubTotal { get; set; }
  137. [Export ("recipient")]
  138. string Recipient { get; set; }
  139. [Export ("paymentType")]
  140. PayPalPaymentType PaymentType { get; set; }
  141. [Export ("paymentSubType")]
  142. PayPalPaymentSubType PaymentSubType { get; set; }
  143. [Export ("invoiceData")]
  144. PayPalInvoiceData InvoiceData { get; set; }
  145. [Export ("description")]
  146. string Description { get; set; }
  147. [Export ("customId")]
  148. string CustomId { get; set; }
  149. [Export ("merchantName")]
  150. string MerchantName { get; set; }
  151. [Export ("ipnUrl")]
  152. string IpnUrl { get; set; }
  153. [Export ("memo")]
  154. string Memo { get; set; }
  155. }
  156. [BaseType (typeof (NSObject))]
  157. interface PayPalAdvancedPayment {
  158. [Export ("paymentCurrency")]
  159. string PaymentCurrency { get; set; }
  160. [Export ("receiverPaymentDetails")]
  161. PayPalReceiverPaymentDetails [] ReceiverPaymentDetails { get; set; }
  162. [Export ("merchantName")]
  163. string MerchantName { get; set; }
  164. [Export ("ipnUrl")]
  165. string IpnUrl { get; set; }
  166. [Export ("memo")]
  167. string Memo { get; set; }
  168. [Export ("subtotal")]
  169. double Subtotal { get; }
  170. [Export ("tax")]
  171. double Tax { get; }
  172. [Export ("shipping")]
  173. double Shipping { get; }
  174. [Export ("total")]
  175. double Total { get; }
  176. [Export ("singleReceiver")]
  177. PayPalReceiverPaymentDetails SingleReceiver { get; }
  178. [Export ("isPersonal")]
  179. bool IsPersonal { get; }
  180. }
  181. [BaseType (typeof (NSObject))]
  182. interface PayPalAmounts {
  183. [Export ("currency")]
  184. string Currency { get; set; }
  185. [Export ("payment_amount")]
  186. double PaymentAmount { get; set; }
  187. [Export ("tax")]
  188. double Tax { get; set; }
  189. [Export ("shipping")]
  190. double Shipping { get; set; }
  191. }
  192. [BaseType (typeof (NSObject))]
  193. interface PayPalContext {
  194. [Export ("sessionToken")]
  195. string SessionToken { get; set; }
  196. [Export ("amount")]
  197. string Amount { get; set; }
  198. [Export ("tax")]
  199. string Tax { get; set; }
  200. [Export ("shipping")]
  201. string Shipping { get; set; }
  202. [Export ("currencyCode")]
  203. string CurrencyCode { get; set; }
  204. [Export ("itemDesc")]
  205. string ItemDesc { get; set; }
  206. [Export ("shippable")]
  207. bool Shippable { get; set; }
  208. [Export ("recipientEmail")]
  209. string RecipientEmail { get; set; }
  210. [Export ("merchantName")]
  211. string MerchantName { get; set; }
  212. [Export ("environment")]
  213. PayPalEnvironment Environment { get; set; }
  214. [Export ("recipientPaysFee")]
  215. bool RecipientPaysFee { get; set; }
  216. [Export ("enableDynamicAutoUpdate")]
  217. bool EnableDynamicAutoUpdate { get; set; }
  218. [Export ("serialize")]
  219. NSDictionary Serialize ();
  220. [Export ("deserialize:")]
  221. bool Deserialize (NSDictionary contextData);
  222. }
  223. [BaseType (typeof (NSObject))]
  224. interface PayPalInvoiceData {
  225. [Export ("totalTax")]
  226. double TotalTax { get; set; }
  227. [Export ("totalShipping")]
  228. double TotalShipping { get; set; }
  229. [Export ("invoiceItems")]
  230. PayPalInvoiceItem [] InvoiceItems { get; set; }
  231. }
  232. [BaseType (typeof (NSObject))]
  233. interface PayPalInvoiceItem {
  234. [Export ("name")]
  235. string Name { get; set; }
  236. [Export ("itemId")]
  237. string ItemId { get; set; }
  238. [Export ("totalPrice")]
  239. NSDecimalNumber TotalPrice { get; set; }
  240. [Export ("itemPrice")]
  241. NSDecimalNumber ItemPrice { get; set; }
  242. [Export ("itemCount")]
  243. NSNumber ItemCount { get; set; }
  244. }
  245. [BaseType (typeof (NSObject))]
  246. interface PayPalPreapprovalDetails {
  247. [Export ("merchantName")]
  248. string MerchantName { get; set; }
  249. [Export ("maxNumPayments")]
  250. int MaxNumPayments { get; set; }
  251. [Export ("maxPerPayment")]
  252. double MaxPerPayment { get; set; }
  253. [Export ("currency")]
  254. string Currency { get; set; }
  255. [Export ("maxTotalAmountOfAllPayments")]
  256. double MaxTotalAmountOfAllPayments { get; set; }
  257. [Export ("startDate")]
  258. DateTime StartDate { get; set; }
  259. [Export ("endDate")]
  260. DateTime EndDate { get; set; }
  261. [Export ("approved")]
  262. bool Approved { get; set; }
  263. [Export ("pinRequired")]
  264. bool PinRequired { get; set; }
  265. [Export ("paymentPeriod")]
  266. PayPalPaymentPeriod PaymentPeriod { get; set; }
  267. [Export ("dateOfMonth")]
  268. int DateOfMonth { get; set; }
  269. [Export ("dayOfWeek")]
  270. PayPalDayOfWeek DayOfWeek { get; set; }
  271. [Export ("maxNumPaymentsPerPeriod")]
  272. int MaxNumPaymentsPerPeriod { get; set; }
  273. [Export ("ipnUrl")]
  274. string IpnUrl { get; set; }
  275. [Export ("memo")]
  276. string Memo { get; set; }
  277. [Export ("senderEmail")]
  278. string SenderEmail { get; set; }
  279. }
  280. [BaseType (typeof (NSObject))]
  281. interface PayPalReceiverAmounts {
  282. [Export("amounts")]
  283. PayPalAmounts Amounts {get;set;}
  284. [Export ("recipient")]
  285. string Recipient { get; set; }
  286. }
  287. }