pub struct PaymentLink {
Show 18 fields pub id: PaymentLinkId, pub active: bool, pub after_completion: PaymentLinksResourceAfterCompletion, pub allow_promotion_codes: bool, pub application_fee_amount: Option<i64>, pub application_fee_percent: Option<f64>, pub automatic_tax: PaymentLinksResourceAutomaticTax, pub billing_address_collection: PaymentLinkBillingAddressCollection, pub line_items: List<CheckoutSessionItem>, pub livemode: bool, pub metadata: Metadata, pub on_behalf_of: Option<Expandable<Account>>, pub payment_method_types: Option<Vec<PaymentLinkPaymentMethodTypes>>, pub phone_number_collection: PaymentLinksResourcePhoneNumberCollection, pub shipping_address_collection: Option<PaymentLinksResourceShippingAddressCollection>, pub subscription_data: Option<PaymentLinksResourceSubscriptionData>, pub transfer_data: Option<PaymentLinksResourceTransferData>, pub url: String,
}
Expand description

The resource representing a Stripe “PaymentLink”.

For more details see https://stripe.com/docs/api/payment_links/object

Fields

id: PaymentLinkId

Unique identifier for the object.

active: bool

Whether the payment link’s url is active.

If false, customers visiting the URL will be shown a page saying that the link has been deactivated.

after_completion: PaymentLinksResourceAfterCompletionallow_promotion_codes: bool

Whether user redeemable promotion codes are enabled.

application_fee_amount: Option<i64>

The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner’s Stripe account.

application_fee_percent: Option<f64>

This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner’s Stripe account.

automatic_tax: PaymentLinksResourceAutomaticTaxbilling_address_collection: PaymentLinkBillingAddressCollection

Configuration for collecting the customer’s billing address.

line_items: List<CheckoutSessionItem>

The line items representing what is being sold.

livemode: bool

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

metadata: Metadata

Set of key-value pairs that you can attach to an object.

This can be useful for storing additional information about the object in a structured format.

on_behalf_of: Option<Expandable<Account>>

The account on behalf of which to charge.

See the Connect documentation for details.

payment_method_types: Option<Vec<PaymentLinkPaymentMethodTypes>>

The list of payment method types that customers can use.

When null, Stripe will dynamically show relevant payment methods you’ve enabled in your payment method settings.

phone_number_collection: PaymentLinksResourcePhoneNumberCollectionshipping_address_collection: Option<PaymentLinksResourceShippingAddressCollection>

Configuration for collecting the customer’s shipping address.

subscription_data: Option<PaymentLinksResourceSubscriptionData>

When creating a subscription, the specified configuration data will be used.

There must be at least one line item with a recurring price to use subscription_data.

transfer_data: Option<PaymentLinksResourceTransferData>

The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.

url: String

The public URL that can be shared with customers.

Implementations

Returns a list of your payment links.

Creates a payment link.

Examples found in repository
examples/payment-link.rs (lines 46-53)
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
async fn main() {
    let secret_key = std::env::var("STRIPE_SECRET_KEY").expect("Missing STRIPE_SECRET_KEY in env");
    let client = Client::new(secret_key);

    // create a new exmaple project
    let product = {
        let mut create_product = CreateProduct::new("T-Shirt");
        create_product.metadata =
            Some([("async-stripe".to_string(), "true".to_string())].iter().cloned().collect());
        Product::create(&client, create_product).await.unwrap()
    };

    // and add a price for it in USD
    let price = {
        let mut create_price = CreatePrice::new(Currency::USD);
        create_price.product = Some(IdOrCreate::Id(&product.id));
        create_price.metadata =
            Some([("async-stripe".to_string(), "true".to_string())].iter().cloned().collect());
        create_price.unit_amount = Some(1000);
        create_price.expand = &["product"];
        Price::create(&client, create_price).await.unwrap()
    };

    println!(
        "created a product {:?} at price {} {}",
        product.name.unwrap(),
        price.unit_amount.unwrap() / 100,
        price.currency.unwrap()
    );

    let payment_link = PaymentLink::create(
        &client,
        CreatePaymentLink::new(vec![CreatePaymentLinkLineItems {
            quantity: 3,
            price: price.id.to_string(),
            ..Default::default()
        }]),
    )
    .await
    .unwrap();

    println!("created a payment link {}", payment_link.url);
}

Retrieve a payment link.

Updates a payment link.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

The canonical id type for this object.

The id of the object.

The object’s type, typically represented in wire format as the object property.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more