Source/NFX.Web/Pay/Stripe/StripeSystem.cs
/// <summary>
/// Deletes existing recipient in Stripe system.
/// It is used to delete temporary recipient created to perform Transfer operation
/// </summary>
Deletes existing recipient in Stripe system.
It is used to delete temporary recipient created to perform Transfer operation
Deletes existing recipient in Stripe system . It is used to delete temporary recipient created to perform Transfer operation
private void deleteRecipient(StripeSession stripeSession, string recipientID)
      {
        try
        {
          var prms = new WebClient.RequestParams(this)
          {
            UserName = stripeSession.SecretKey,
            Method = HTTPRequestMethod.DELETE
          };
          dynamic obj = WebClient.GetJsonAsDynamic(new Uri(RECIPIENT_DELETE_URI.Args(recipientID)), prms);
          return;
        }
        catch (Exception ex)
        {
          var wex = ex as System.Net.WebException;
          if (wex != null)
          {
            var response = wex.Response as System.Net.HttpWebResponse;
            if (response != null)
            {
              string errorMessage = this.GetType().Name +
                        ".deleteRecipient(recipientID: '{0}')".Args(recipientID);
              PaymentStripeException stripeEx = PaymentStripeException.Compose(response, errorMessage, wex);
              if (stripeEx != null) throw stripeEx;
            }
          }
          throw new PaymentStripeException(StringConsts.PAYMENT_CANNOT_CREATE_RECIPIENT_ERROR + this.GetType()
            + " .deleteRecipient(recipientID: '{0}')".Args(recipientID), ex);
        }
      }
private void deleteRecipient ( StripeSession stripeSession , string recipientID ) { try { var prms = new WebClient . RequestParams ( this ) { UserName = stripeSession . SecretKey , Method = HTTPRequestMethod . DELETE } ; dynamic obj = WebClient . GetJsonAsDynamic ( new Uri ( RECIPIENT_DELETE_URI . Args ( recipientID ) ) , prms ) ; return ; } catch ( Exception ex ) { var wex = ex as System . Net . WebException ; if ( wex != null ) { var response = wex . Response as System . Net . HttpWebResponse ; if ( response != null ) { string errorMessage = this . GetType ( ) . Name + " " . Args ( recipientID ) ; PaymentStripeException stripeEx = PaymentStripeException . Compose ( response , errorMessage , wex ) ; if ( stripeEx != null ) throw stripeEx ; } } throw new PaymentStripeException ( StringConsts . PAYMENT_CANNOT_CREATE_RECIPIENT_ERROR + this . GetType ( ) + " " . Args ( recipientID ) , ex ) ; } }
Deletes existing recipient in Stripe system.
Deletes existing recipient in Stripe system .
stripeSession
StripeSession
recipientID
string