Add Stripe unsubscribe_customer method
This commit is contained in:
		
					parent
					
						
							
								65745b5098
							
						
					
				
			
			
				commit
				
					
						f044b83b8f
					
				
			
		
					 1 changed files with 11 additions and 0 deletions
				
			
		|  | @ -232,6 +232,17 @@ class StripeUtils(object): | |||
|         ) | ||||
|         return subscription_result | ||||
| 
 | ||||
|     @handleStripeError | ||||
|     def unsubscribe_customer(self, subscription_id): | ||||
|         """ | ||||
|         Cancels a given subscription | ||||
| 
 | ||||
|         :param subscription_id: The Stripe subscription id string | ||||
|         :return: | ||||
|         """ | ||||
|         sub = stripe.Subscription.retrieve(subscription_id) | ||||
|         return sub.delete() | ||||
| 
 | ||||
|     @handleStripeError | ||||
|     def make_payment(self, customer, amount, token): | ||||
|         charge = self.stripe.Charge.create( | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue