pub struct CreatePlanParams {
pub period: PlanPeriod,
pub interval: u32,
pub item: PlanItem,
pub notes: Option<Notes>,
}Expand description
Parameters for creating a Plan.
Fields§
§period: PlanPeriodThe billing unit.
interval: u32How many period units between charges.
item: PlanItemThe item this plan bills for.
notes: Option<Notes>Metadata to attach.
Implementations§
Source§impl CreatePlanParams
impl CreatePlanParams
Sourcepub fn new(
period: PlanPeriod,
interval: u32,
name: impl Into<String>,
amount: i64,
currency: impl Into<String>,
) -> Self
pub fn new( period: PlanPeriod, interval: u32, name: impl Into<String>, amount: i64, currency: impl Into<String>, ) -> Self
A plan billing amount every interval × period.
§Examples
use razorpay_api::resources::{CreatePlanParams, PlanPeriod};
// ₹499 every month.
let monthly = CreatePlanParams::new(PlanPeriod::Monthly, 1, "Pro", 49_900, "INR");
assert_eq!(monthly.interval, 1);
// ₹499 every three months.
let quarterly = CreatePlanParams::new(PlanPeriod::Monthly, 3, "Pro", 49_900, "INR");
assert_eq!(quarterly.interval, 3);Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Describe the item in more detail.
Trait Implementations§
Source§impl Clone for CreatePlanParams
impl Clone for CreatePlanParams
Source§impl Debug for CreatePlanParams
impl Debug for CreatePlanParams
Source§impl PartialEq for CreatePlanParams
impl PartialEq for CreatePlanParams
Source§impl Serialize for CreatePlanParams
impl Serialize for CreatePlanParams
impl StructuralPartialEq for CreatePlanParams
Auto Trait Implementations§
impl Freeze for CreatePlanParams
impl RefUnwindSafe for CreatePlanParams
impl Send for CreatePlanParams
impl Sync for CreatePlanParams
impl Unpin for CreatePlanParams
impl UnsafeUnpin for CreatePlanParams
impl UnwindSafe for CreatePlanParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more