Пример #1
0
		/// <summary>
		/// Reminds the payer to pay the invoice.
		/// </summary>
		/// <param name="apiContext">APIContext used for the API call.</param>
		/// <param name="notification">Notification</param>
		/// <returns></returns>
		public void Remind(APIContext apiContext, Notification notification)
		{
			if (apiContext == null)
			{
				throw new ArgumentNullException("APIContext cannot be null");
			}
			if (string.IsNullOrEmpty(apiContext.AccessToken))
			{
				throw new ArgumentNullException("AccessToken cannot be null or empty");
			}
			if (apiContext.HTTPHeaders == null)
			{
				apiContext.HTTPHeaders = new Dictionary<string, string>();
			}
			apiContext.HTTPHeaders.Add(BaseConstants.ContentTypeHeader, BaseConstants.ContentTypeHeaderJson);
			apiContext.SdkVersion = new SDKVersionImpl();
			if (this.id == null)
			{
				throw new ArgumentNullException("Id cannot be null");
			}
			if (notification == null)
			{
				throw new ArgumentNullException("notification cannot be null");
			}
			object[] parameters = new object[] {this.id};
			string pattern = "v1/invoicing/invoices/{0}/remind";
			string resourcePath = SDKUtil.FormatURIPath(pattern, parameters);
			string payLoad = notification.ConvertToJson();
			PayPalResource.ConfigureAndExecute<object>(apiContext, HttpMethod.POST, resourcePath, payLoad);
			return;
		}
Пример #2
0
		/// <summary>
		/// Reminds the payer to pay the invoice.
		/// </summary>
		/// <param name="accessToken">Access Token used for the API call.</param>
		/// <param name="notification">Notification</param>
		/// <returns></returns>
		public void Remind(string accessToken, Notification notification)
		{
			APIContext apiContext = new APIContext(accessToken);
			Remind(apiContext, notification);
			return;
		}