Class: Stripe::PaymentLinkCreateParams

Inherits:
RequestParams show all
Defined in:
lib/stripe/params/payment_link_create_params.rb

Defined Under Namespace

Classes: AfterCompletion, AutomaticSurcharge, AutomaticTax, ConsentCollection, CustomField, CustomText, InvoiceCreation, LineItem, ManagedPayments, NameCollection, OptionalItem, PaymentIntentData, PaymentMethodOptions, PhoneNumberCollection, Restrictions, ShippingAddressCollection, ShippingOption, SubscriptionData, TaxIdCollection, TransferData

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

attr_accessor, coerce_params, coerce_value, new, #to_h

Constructor Details

#initialize(after_completion: nil, allow_promotion_codes: nil, application_fee_amount: nil, application_fee_percent: nil, automatic_surcharge: nil, automatic_tax: nil, billing_address_collection: nil, consent_collection: nil, currency: nil, custom_fields: nil, custom_text: nil, customer_creation: nil, expand: nil, inactive_message: nil, invoice_creation: nil, line_items: nil, managed_payments: nil, metadata: nil, name_collection: nil, on_behalf_of: nil, optional_items: nil, payment_intent_data: nil, payment_method_collection: nil, payment_method_options: nil, payment_method_types: nil, phone_number_collection: nil, restrictions: nil, shipping_address_collection: nil, shipping_options: nil, submit_type: nil, subscription_data: nil, tax_id_collection: nil, transfer_data: nil) ⇒ PaymentLinkCreateParams

Returns a new instance of PaymentLinkCreateParams.



831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
# File 'lib/stripe/params/payment_link_create_params.rb', line 831

def initialize(
  after_completion: nil,
  allow_promotion_codes: nil,
  application_fee_amount: nil,
  application_fee_percent: nil,
  automatic_surcharge: nil,
  automatic_tax: nil,
  billing_address_collection: nil,
  consent_collection: nil,
  currency: nil,
  custom_fields: nil,
  custom_text: nil,
  customer_creation: nil,
  expand: nil,
  inactive_message: nil,
  invoice_creation: nil,
  line_items: nil,
  managed_payments: nil,
  metadata: nil,
  name_collection: nil,
  on_behalf_of: nil,
  optional_items: nil,
  payment_intent_data: nil,
  payment_method_collection: nil,
  payment_method_options: nil,
  payment_method_types: nil,
  phone_number_collection: nil,
  restrictions: nil,
  shipping_address_collection: nil,
  shipping_options: nil,
  submit_type: nil,
  subscription_data: nil,
  tax_id_collection: nil,
  transfer_data: nil
)
  @after_completion = after_completion
  @allow_promotion_codes = allow_promotion_codes
  @application_fee_amount = application_fee_amount
  @application_fee_percent = application_fee_percent
  @automatic_surcharge = automatic_surcharge
  @automatic_tax = automatic_tax
  @billing_address_collection = billing_address_collection
  @consent_collection = consent_collection
  @currency = currency
  @custom_fields = custom_fields
  @custom_text = custom_text
  @customer_creation = customer_creation
  @expand = expand
  @inactive_message = inactive_message
  @invoice_creation = invoice_creation
  @line_items = line_items
  @managed_payments = managed_payments
  @metadata = 
  @name_collection = name_collection
  @on_behalf_of = on_behalf_of
  @optional_items = optional_items
  @payment_intent_data = payment_intent_data
  @payment_method_collection = payment_method_collection
  @payment_method_options = payment_method_options
  @payment_method_types = payment_method_types
  @phone_number_collection = phone_number_collection
  @restrictions = restrictions
  @shipping_address_collection = shipping_address_collection
  @shipping_options = shipping_options
  @submit_type = submit_type
  @subscription_data = subscription_data
  @tax_id_collection = tax_id_collection
  @transfer_data = transfer_data
end

Instance Attribute Details

#after_completionObject

Behavior after the purchase is complete.



757
758
759
# File 'lib/stripe/params/payment_link_create_params.rb', line 757

def after_completion
  @after_completion
end

#allow_promotion_codesObject

Enables user redeemable promotion codes.



759
760
761
# File 'lib/stripe/params/payment_link_create_params.rb', line 759

def allow_promotion_codes
  @allow_promotion_codes
end

#application_fee_amountObject

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. Can only be applied when there are no line items with recurring prices.



761
762
763
# File 'lib/stripe/params/payment_link_create_params.rb', line 761

def application_fee_amount
  @application_fee_amount
end

#application_fee_percentObject

A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner’s Stripe account. There must be at least 1 line item with a recurring price to use this field.



763
764
765
# File 'lib/stripe/params/payment_link_create_params.rb', line 763

def application_fee_percent
  @application_fee_percent
end

#automatic_surchargeObject

Configuration for automatic surcharge calculation.



765
766
767
# File 'lib/stripe/params/payment_link_create_params.rb', line 765

def automatic_surcharge
  @automatic_surcharge
end

#automatic_taxObject

Configuration for automatic tax collection.



767
768
769
# File 'lib/stripe/params/payment_link_create_params.rb', line 767

def automatic_tax
  @automatic_tax
end

#billing_address_collectionObject

Configuration for collecting the customer’s billing address. Defaults to ‘auto`.



769
770
771
# File 'lib/stripe/params/payment_link_create_params.rb', line 769

def billing_address_collection
  @billing_address_collection
end

Configure fields to gather active consent from customers.



771
772
773
# File 'lib/stripe/params/payment_link_create_params.rb', line 771

def consent_collection
  @consent_collection
end

#currencyObject

Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](stripe.com/docs/currencies) and supported by each line item’s price.



773
774
775
# File 'lib/stripe/params/payment_link_create_params.rb', line 773

def currency
  @currency
end

#custom_fieldsObject

Collect additional information from your customer using custom fields. Up to 3 fields are supported. You can’t set this parameter if ‘ui_mode` is `custom`.



775
776
777
# File 'lib/stripe/params/payment_link_create_params.rb', line 775

def custom_fields
  @custom_fields
end

#custom_textObject

Display additional text for your customers using custom text. You can’t set this parameter if ‘ui_mode` is `custom`.



777
778
779
# File 'lib/stripe/params/payment_link_create_params.rb', line 777

def custom_text
  @custom_text
end

#customer_creationObject

Configures whether [checkout sessions](docs.stripe.com/api/checkout/sessions) created by this payment link create a [Customer](docs.stripe.com/api/customers).



779
780
781
# File 'lib/stripe/params/payment_link_create_params.rb', line 779

def customer_creation
  @customer_creation
end

#expandObject

Specifies which fields in the response should be expanded.



781
782
783
# File 'lib/stripe/params/payment_link_create_params.rb', line 781

def expand
  @expand
end

#inactive_messageObject

The custom message to be displayed to a customer when a payment link is no longer active.



783
784
785
# File 'lib/stripe/params/payment_link_create_params.rb', line 783

def inactive_message
  @inactive_message
end

#invoice_creationObject

Generate a post-purchase Invoice for one-time payments.



785
786
787
# File 'lib/stripe/params/payment_link_create_params.rb', line 785

def invoice_creation
  @invoice_creation
end

#line_itemsObject

The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported.



787
788
789
# File 'lib/stripe/params/payment_link_create_params.rb', line 787

def line_items
  @line_items
end

#managed_paymentsObject

Settings for Managed Payments for this Payment Link and resulting [CheckoutSessions](/api/checkout/sessions/object), [PaymentIntents](/api/payment_intents/object), [Invoices](/api/invoices/object), and [Subscriptions](/api/subscriptions/object).



789
790
791
# File 'lib/stripe/params/payment_link_create_params.rb', line 789

def managed_payments
  @managed_payments
end

#metadataObject

Set of [key-value pairs](docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to ‘metadata`. Metadata associated with this Payment Link will automatically be copied to [checkout sessions](docs.stripe.com/api/checkout/sessions) created by this payment link.



791
792
793
# File 'lib/stripe/params/payment_link_create_params.rb', line 791

def 
  @metadata
end

#name_collectionObject

Controls settings applied for collecting the customer’s name.



793
794
795
# File 'lib/stripe/params/payment_link_create_params.rb', line 793

def name_collection
  @name_collection
end

#on_behalf_ofObject

The account on behalf of which to charge.



795
796
797
# File 'lib/stripe/params/payment_link_create_params.rb', line 795

def on_behalf_of
  @on_behalf_of
end

#optional_itemsObject

A list of optional items the customer can add to their order at checkout. Use this parameter to pass one-time or recurring [Prices](docs.stripe.com/api/prices). There is a maximum of 10 optional items allowed on a payment link, and the existing limits on the number of line items allowed on a payment link apply to the combined number of line items and optional items. There is a maximum of 20 combined line items and optional items.



799
800
801
# File 'lib/stripe/params/payment_link_create_params.rb', line 799

def optional_items
  @optional_items
end

#payment_intent_dataObject

A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in ‘payment` mode.



801
802
803
# File 'lib/stripe/params/payment_link_create_params.rb', line 801

def payment_intent_data
  @payment_intent_data
end

#payment_method_collectionObject

Specify whether Checkout should collect a payment method. When set to ‘if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount.

Can only be set in ‘subscription` mode. Defaults to `always`.

If you’d like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](docs.stripe.com/payments/checkout/free-trials).



807
808
809
# File 'lib/stripe/params/payment_link_create_params.rb', line 807

def payment_method_collection
  @payment_method_collection
end

#payment_method_optionsObject

Attribute for param field payment_method_options



809
810
811
# File 'lib/stripe/params/payment_link_create_params.rb', line 809

def payment_method_options
  @payment_method_options
end

#payment_method_typesObject

The list of payment method types that customers can use. If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](docs.stripe.com/payments/payment-methods/integration-options#payment-method-product-support)).



811
812
813
# File 'lib/stripe/params/payment_link_create_params.rb', line 811

def payment_method_types
  @payment_method_types
end

#phone_number_collectionObject

Controls phone number collection settings during checkout.

We recommend that you review your privacy policy and check with your legal contacts.



815
816
817
# File 'lib/stripe/params/payment_link_create_params.rb', line 815

def phone_number_collection
  @phone_number_collection
end

#restrictionsObject

Settings that restrict the usage of a payment link.



817
818
819
# File 'lib/stripe/params/payment_link_create_params.rb', line 817

def restrictions
  @restrictions
end

#shipping_address_collectionObject

Configuration for collecting the customer’s shipping address.



819
820
821
# File 'lib/stripe/params/payment_link_create_params.rb', line 819

def shipping_address_collection
  @shipping_address_collection
end

#shipping_optionsObject

The shipping rate options to apply to [checkout sessions](docs.stripe.com/api/checkout/sessions) created by this payment link.



821
822
823
# File 'lib/stripe/params/payment_link_create_params.rb', line 821

def shipping_options
  @shipping_options
end

#submit_typeObject

Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](docs.stripe.com/api/payment_links/payment_links/object#url) property (example: ‘donate.stripe.com`).



823
824
825
# File 'lib/stripe/params/payment_link_create_params.rb', line 823

def submit_type
  @submit_type
end

#subscription_dataObject

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`.



825
826
827
# File 'lib/stripe/params/payment_link_create_params.rb', line 825

def subscription_data
  @subscription_data
end

#tax_id_collectionObject

Controls tax ID collection during checkout.



827
828
829
# File 'lib/stripe/params/payment_link_create_params.rb', line 827

def tax_id_collection
  @tax_id_collection
end

#transfer_dataObject

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



829
830
831
# File 'lib/stripe/params/payment_link_create_params.rb', line 829

def transfer_data
  @transfer_data
end

Class Method Details

.field_encodingsObject



901
902
903
904
905
906
907
908
909
910
911
# File 'lib/stripe/params/payment_link_create_params.rb', line 901

def self.field_encodings
  @field_encodings = {
    line_items: {
      kind: :array,
      element: {
        kind: :object,
        fields: { price_data: { kind: :object, fields: { unit_amount_decimal: :decimal_string } } },
      },
    },
  }
end