CoursePriceService#
- class CoursePriceService[source]#
Methods
Get the coupons of a price.
Create a new coupon for a course price.
Delete a coupon.
Update the given coupon with new values.
Create a new payment for the current user.
Pay for a course with a coupon.
- get_all_coupons(*, price_id, extra_parameters=None)[source]#
Get the coupons of a price.
- Parameters:
- Returns:
The coupons (that the current user may see) of the price.
- Return type:
- create_coupon(json_body, *, price_id, extra_parameters=None)[source]#
Create a new coupon for a course price.
- Parameters:
json_body (
Union
[dict
,list
,CouponDataParser
]) – The body of the request. SeeCouponDataParser
for information about the possible fields. You can provide this data as aCouponDataParser
or as a dictionary.price_id (
str
) – The price you want to create a coupon for.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (CoursePriceService[AuthenticatedClient]) –
- Returns:
The coupon created for this course price.
- Return type:
- delete_coupon(*, price_id, coupon_id, extra_parameters=None)[source]#
Delete a coupon.
- Parameters:
price_id (
str
) – The id of the price the coupon is connected to.coupon_id (
str
) – The id of the coupon you want to delete.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (CoursePriceService[AuthenticatedClient]) –
- Returns:
Nothing
- Return type:
None
- update_coupon(json_body, *, price_id, coupon_id, extra_parameters=None)[source]#
Update the given coupon with new values.
- Parameters:
json_body (
Union
[dict
,list
,CouponDataParser
]) – The body of the request. SeeCouponDataParser
for information about the possible fields. You can provide this data as aCouponDataParser
or as a dictionary.price_id (
str
) – The price to which the coupon is connected.coupon_id (
str
) – The id of the coupon you want to update.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (CoursePriceService[AuthenticatedClient]) –
- Returns:
The updated coupon
- Return type:
- start_payment(json_body, *, price_id, extra_parameters=None)[source]#
Create a new payment for the current user.
- Parameters:
json_body (
Union
[dict
,list
,StartPaymentCoursePriceRedirectData
,StartPaymentCoursePriceCloseTabData
]) – The body of the request. SeeStartPaymentCoursePriceData
for information about the possible fields. You can provide this data as aStartPaymentCoursePriceData
or as a dictionary.price_id (
str
) – The price you want to pay for.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (CoursePriceService[AuthenticatedClient]) –
- Returns:
A transaction for this course price with a stripe_url key that can be used to pay. Be careful to check the state of the transaction, as a payment might already be in progress.
- Return type:
- pay_with_coupon(json_body, *, price_id, extra_parameters=None)[source]#
Pay for a course with a coupon.
- Parameters:
json_body (
Union
[dict
,list
,PayWithCouponCoursePriceData
]) – The body of the request. SeePayWithCouponCoursePriceData
for information about the possible fields. You can provide this data as aPayWithCouponCoursePriceData
or as a dictionary.price_id (
str
) – The id of the price you want to pay for.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (CoursePriceService[AuthenticatedClient]) –
- Returns:
Nothing
- Return type: