Class: Stripe::Identity::VerificationSession
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::Identity::VerificationSession
- Extended by:
- APIOperations::Create, APIOperations::List
- Includes:
- APIOperations::Save
- Defined in:
- lib/stripe/resources/identity/verification_session.rb
Overview
A VerificationSession guides you through the process of collecting and verifying the identities of your users. It contains details about the type of verification, such as what [verification check](docs.stripe.com/docs/identity/verification-checks) to perform. Only create one VerificationSession for each verification in your system.
A VerificationSession transitions through [multiple statuses](docs.stripe.com/docs/identity/how-sessions-work) throughout its lifetime as it progresses through the verification flow. The VerificationSession contains the user’s verified data after verification checks are complete.
Related guide: [The Verification Sessions API](stripe.com/docs/identity/verification-sessions)
Defined Under Namespace
Classes: CancelParams, CreateParams, LastError, ListParams, Options, ProvidedDetails, RedactParams, Redaction, RelatedPerson, UpdateParams, VerifiedOutputs
Constant Summary collapse
- OBJECT_NAME =
"identity.verification_session"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#client_reference_id ⇒ Object
readonly
A string to reference this user.
-
#client_secret ⇒ Object
readonly
The short-lived client secret used by Stripe.js to [show a verification modal](stripe.com/docs/js/identity/modal) inside your app.
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#last_error ⇒ Object
readonly
If present, this property tells you the last error encountered when processing the verification.
-
#last_verification_report ⇒ Object
readonly
ID of the most recent VerificationReport.
-
#livemode ⇒ Object
readonly
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
-
#metadata ⇒ Object
readonly
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#options ⇒ Object
readonly
A set of options for the session’s verification checks.
-
#provided_details ⇒ Object
readonly
Details provided about the user being verified.
-
#redaction ⇒ Object
readonly
Redaction status of this VerificationSession.
-
#related_customer ⇒ Object
readonly
Customer ID.
-
#related_customer_account ⇒ Object
readonly
Token referencing a Customer Account resource.
-
#related_person ⇒ Object
readonly
Attribute for field related_person.
-
#status ⇒ Object
readonly
Status of this VerificationSession.
-
#type ⇒ Object
readonly
The type of [verification check](stripe.com/docs/identity/verification-checks) to be performed.
-
#url ⇒ Object
readonly
The short-lived URL that you use to redirect a user to Stripe to submit their identity information.
-
#verification_flow ⇒ Object
readonly
The configuration token of a verification flow from the dashboard.
-
#verified_outputs ⇒ Object
readonly
The user’s verified data.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.cancel(session, params = {}, opts = {}) ⇒ Object
A VerificationSession object can be canceled when it is in requires_input [status](docs.stripe.com/docs/identity/how-sessions-work).
-
.create(params = {}, opts = {}) ⇒ Object
Creates a VerificationSession object.
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
-
.list(params = {}, opts = {}) ⇒ Object
Returns a list of VerificationSessions.
- .object_name ⇒ Object
-
.redact(session, params = {}, opts = {}) ⇒ Object
Redact a VerificationSession to remove all collected information from Stripe.
-
.update(session, params = {}, opts = {}) ⇒ Object
Updates a VerificationSession object.
Instance Method Summary collapse
-
#cancel(params = {}, opts = {}) ⇒ Object
A VerificationSession object can be canceled when it is in requires_input [status](docs.stripe.com/docs/identity/how-sessions-work).
-
#redact(params = {}, opts = {}) ⇒ Object
Redact a VerificationSession to remove all collected information from Stripe.
Methods included from APIOperations::Create
Methods included from APIOperations::List
Methods included from APIOperations::Save
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Attribute Details
#client_reference_id ⇒ Object (readonly)
A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems.
499 500 501 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 499 def client_reference_id @client_reference_id end |
#client_secret ⇒ Object (readonly)
The short-lived client secret used by Stripe.js to [show a verification modal](stripe.com/docs/js/identity/modal) inside your app. This client secret expires after 24 hours and can only be used once. Don’t store it, log it, embed it in a URL, or expose it to anyone other than the user. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs on [passing the client secret to the frontend](stripe.com/docs/identity/verification-sessions#client-secret) to learn more.
501 502 503 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 501 def client_secret @client_secret end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
503 504 505 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 503 def created @created end |
#id ⇒ Object (readonly)
Unique identifier for the object.
505 506 507 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 505 def id @id end |
#last_error ⇒ Object (readonly)
If present, this property tells you the last error encountered when processing the verification.
507 508 509 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 507 def last_error @last_error end |
#last_verification_report ⇒ Object (readonly)
ID of the most recent VerificationReport. [Learn more about accessing detailed verification results.](stripe.com/docs/identity/verification-sessions#results)
509 510 511 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 509 def last_verification_report @last_verification_report end |
#livemode ⇒ Object (readonly)
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
511 512 513 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 511 def livemode @livemode end |
#metadata ⇒ Object (readonly)
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
513 514 515 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 513 def @metadata end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
515 516 517 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 515 def object @object end |
#options ⇒ Object (readonly)
A set of options for the session’s verification checks.
517 518 519 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 517 def @options end |
#provided_details ⇒ Object (readonly)
Details provided about the user being verified. These details may be shown to the user.
519 520 521 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 519 def provided_details @provided_details end |
#redaction ⇒ Object (readonly)
Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null.
521 522 523 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 521 def redaction @redaction end |
#related_customer ⇒ Object (readonly)
Customer ID
523 524 525 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 523 def @related_customer end |
#related_customer_account ⇒ Object (readonly)
Token referencing a Customer Account resource.
525 526 527 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 525 def @related_customer_account end |
#related_person ⇒ Object (readonly)
Attribute for field related_person
527 528 529 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 527 def @related_person end |
#status ⇒ Object (readonly)
Status of this VerificationSession. [Learn more about the lifecycle of sessions](stripe.com/docs/identity/how-sessions-work).
529 530 531 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 529 def status @status end |
#type ⇒ Object (readonly)
The type of [verification check](stripe.com/docs/identity/verification-checks) to be performed.
531 532 533 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 531 def type @type end |
#url ⇒ Object (readonly)
The short-lived URL that you use to redirect a user to Stripe to submit their identity information. This URL expires after 48 hours and can only be used once. Don’t store it, log it, send it in emails or expose it to anyone other than the user. Refer to our docs on [verifying identity documents](stripe.com/docs/identity/verify-identity-documents?platform=web&type=redirect) to learn how to redirect users to Stripe.
533 534 535 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 533 def url @url end |
#verification_flow ⇒ Object (readonly)
The configuration token of a verification flow from the dashboard.
535 536 537 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 535 def verification_flow @verification_flow end |
#verified_outputs ⇒ Object (readonly)
The user’s verified data.
537 538 539 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 537 def verified_outputs @verified_outputs end |
Class Method Details
.cancel(session, params = {}, opts = {}) ⇒ Object
A VerificationSession object can be canceled when it is in requires_input [status](docs.stripe.com/docs/identity/how-sessions-work).
Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](docs.stripe.com/docs/identity/verification-sessions#cancel).
554 555 556 557 558 559 560 561 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 554 def self.cancel(session, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/identity/verification_sessions/%<session>s/cancel", { session: CGI.escape(session) }), params: params, opts: opts ) end |
.create(params = {}, opts = {}) ⇒ Object
Creates a VerificationSession object.
After the VerificationSession is created, display a verification modal using the session client_secret or send your users to the session’s url.
If your API key is in test mode, verification checks won’t actually process, though everything else will occur as if in live mode.
Related guide: [Verify your users’ identity documents](docs.stripe.com/docs/identity/verify-identity-documents)
570 571 572 573 574 575 576 577 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 570 def self.create(params = {}, opts = {}) request_stripe_object( method: :post, path: "/v1/identity/verification_sessions", params: params, opts: opts ) end |
.field_remappings ⇒ Object
669 670 671 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 669 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
658 659 660 661 662 663 664 665 666 667 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 658 def self.inner_class_types @inner_class_types = { last_error: LastError, options: Options, provided_details: ProvidedDetails, redaction: Redaction, related_person: RelatedPerson, verified_outputs: VerifiedOutputs, } end |
.list(params = {}, opts = {}) ⇒ Object
Returns a list of VerificationSessions
580 581 582 583 584 585 586 587 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 580 def self.list(params = {}, opts = {}) request_stripe_object( method: :get, path: "/v1/identity/verification_sessions", params: params, opts: opts ) end |
.object_name ⇒ Object
23 24 25 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 23 def self.object_name "identity.verification_session" end |
.redact(session, params = {}, opts = {}) ⇒ Object
Redact a VerificationSession to remove all collected information from Stripe. This will redact the VerificationSession and all objects related to it, including VerificationReports, Events, request logs, etc.
A VerificationSession object can be redacted when it is in requires_input or verified [status](docs.stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action state will automatically cancel it.
The redaction process may take up to four days. When the redaction process is in progress, the VerificationSession’s redaction.status field will be set to processing; when the process is finished, it will change to redacted and an identity.verification_session.redacted event will be emitted.
Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the fields that contain personal data will be replaced by the string [redacted] or a similar placeholder. The metadata field will also be erased. Redacted objects cannot be updated or used for any purpose.
[Learn more](docs.stripe.com/docs/identity/verification-sessions#redact).
636 637 638 639 640 641 642 643 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 636 def self.redact(session, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/identity/verification_sessions/%<session>s/redact", { session: CGI.escape(session) }), params: params, opts: opts ) end |
.update(session, params = {}, opts = {}) ⇒ Object
Updates a VerificationSession object.
When the session status is requires_input, you can use this method to update the verification check and options.
649 650 651 652 653 654 655 656 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 649 def self.update(session, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/identity/verification_sessions/%<session>s", { session: CGI.escape(session) }), params: params, opts: opts ) end |
Instance Method Details
#cancel(params = {}, opts = {}) ⇒ Object
A VerificationSession object can be canceled when it is in requires_input [status](docs.stripe.com/docs/identity/how-sessions-work).
Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](docs.stripe.com/docs/identity/verification-sessions#cancel).
542 543 544 545 546 547 548 549 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 542 def cancel(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/identity/verification_sessions/%<session>s/cancel", { session: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#redact(params = {}, opts = {}) ⇒ Object
Redact a VerificationSession to remove all collected information from Stripe. This will redact the VerificationSession and all objects related to it, including VerificationReports, Events, request logs, etc.
A VerificationSession object can be redacted when it is in requires_input or verified [status](docs.stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action state will automatically cancel it.
The redaction process may take up to four days. When the redaction process is in progress, the VerificationSession’s redaction.status field will be set to processing; when the process is finished, it will change to redacted and an identity.verification_session.redacted event will be emitted.
Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the fields that contain personal data will be replaced by the string [redacted] or a similar placeholder. The metadata field will also be erased. Redacted objects cannot be updated or used for any purpose.
[Learn more](docs.stripe.com/docs/identity/verification-sessions#redact).
608 609 610 611 612 613 614 615 |
# File 'lib/stripe/resources/identity/verification_session.rb', line 608 def redact(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/identity/verification_sessions/%<session>s/redact", { session: CGI.escape(self["id"]) }), params: params, opts: opts ) end |