@@ -168,14 +168,15 @@ def create_plan(self, product_id: str, name: str, description: str, price: str,
168
168
url = f"{ self .base_url } /v1/billing/plans"
169
169
return self ._make_request (url = url , method = "POST" , json = data , headers = self .headers )
170
170
171
- def update_subscription_price (self , subscription_id : str , new_price : str , currency : str = "EUR" ) -> Dict [str , Any ]:
171
+ def update_subscription_price (self , subscription_id : str , new_price : str , currency : str = "EUR" , custom_id : str = '' ) -> Dict [str , Any ]:
172
172
"""
173
173
Update the subscription price.
174
174
175
175
Args:
176
176
subscription_id (str): Subscription ID.
177
177
new_price (str): New subscription price.
178
178
currency (str): Currency code (default is "EUR").
179
+ custom_id (str): Custom data to send to paypal that you will get back
179
180
180
181
Returns:
181
182
Dict[str, Any]: API response with updated subscription details.
@@ -190,11 +191,12 @@ def update_subscription_price(self, subscription_id: str, new_price: str, curren
190
191
"sequence" : 1 ,
191
192
"pricing_scheme" : {"fixed_price" : {"value" : new_price , "currency_code" : currency }}
192
193
}
193
- ]
194
+ ],
195
+ "custom_id" : custom_id
194
196
}
195
197
return self ._make_request (url = url , method = "POST" , json = data , headers = self .headers )
196
198
197
- def create_subscription (self , plan_id : str , subscriber_email : str , return_url : str , cancel_url : str ) -> Dict [str , Any ]:
199
+ def create_subscription (self , plan_id : str , subscriber_email : str , return_url : str , cancel_url : str , custom_id : str = '' ) -> Dict [str , Any ]:
198
200
"""
199
201
Create a new subscription.
200
202
@@ -203,6 +205,7 @@ def create_subscription(self, plan_id: str, subscriber_email: str, return_url: s
203
205
subscriber_email (str): Subscriber's email.
204
206
return_url (str): URL to redirect to after the subscriber approves the subscription.
205
207
cancel_url (str): URL to redirect to if the subscriber cancels the subscription.
208
+ custom_id (str): Custom data to send to paypal that you will get back
206
209
207
210
Returns:
208
211
Dict[str, Any]: API response with subscription details.
@@ -215,7 +218,8 @@ def create_subscription(self, plan_id: str, subscriber_email: str, return_url: s
215
218
"application_context" : {
216
219
"return_url" : return_url ,
217
220
"cancel_url" : cancel_url
218
- }
221
+ },
222
+ "custom_id" : custom_id
219
223
}
220
224
221
225
url = f"{ self .base_url } /v1/billing/subscriptions"
0 commit comments