CoursePriceService#

class CoursePriceService[source]#

Methods

get_all_coupons

Get the coupons of a price.

create_coupon

Create a new coupon for a course price.

delete_coupon

Delete a coupon.

update_coupon

Update the given coupon with new values.

start_payment

Create a new payment for the current user.

pay_with_coupon

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:

Sequence[CouponWithCode | CouponWithoutCode]

create_coupon(json_body, *, price_id, extra_parameters=None)[source]#

Create a new coupon for a course price.

Parameters:
Returns:

The coupon created for this course price.

Return type:

CouponWithCode | CouponWithoutCode

delete_coupon(*, price_id, coupon_id, extra_parameters=None)[source]#

Delete a coupon.

Parameters:
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:
Returns:

The updated coupon

Return type:

CouponWithCode | CouponWithoutCode

start_payment(json_body, *, price_id, extra_parameters=None)[source]#

Create a new payment for the current user.

Parameters:
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:

StartedTransaction

pay_with_coupon(json_body, *, price_id, extra_parameters=None)[source]#

Pay for a course with a coupon.

Parameters:
Returns:

Nothing

Return type:

TenantCouponUsage | CourseCouponUsage