Class: Portage::Ucp::PaymentEnrollment
- Inherits:
-
Data
- Object
- Data
- Portage::Ucp::PaymentEnrollment
- Defined in:
- lib/portage/ucp/value_objects.rb
Overview
Portage extension (see Adapter#create_payment_enrollment /
#get_payment_enrollment and Capabilities::PAYMENT_ENROLLMENT) — no
schemas/ counterpart, not part of the UCP spec. Card entry never
happens in this process: setup_url is a gateway-hosted page the
human completes out-of-band; payment_token only appears once
status reaches "complete", and is the same opaque string
complete_checkout's payment_token: expects (never a raw PAN —
PaymentTokenGuard rejects those regardless of source). See
docs/plans/agentic-payments.md Phase 1.
mandate: (design-log §33/Phase B) — an optional Ap2::PaymentMandate
an adapter that received one at enrollment time can carry back on the
enrollment it returns. Safe to add here (unlike Checkout/Order, which
are schema-validated against UCP's own JSON schemas) because
payment_enrollment is a Portage extension with no schemas/
counterpart to conflict with — see rspec.rb's comment on that.
Instance Attribute Summary collapse
-
#expires_at ⇒ Object
readonly
Returns the value of attribute expires_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#mandate ⇒ Object
readonly
Returns the value of attribute mandate.
-
#payment_token ⇒ Object
readonly
Returns the value of attribute payment_token.
-
#setup_url ⇒ Object
readonly
Returns the value of attribute setup_url.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(id:, status:, setup_url: nil, payment_token: nil, expires_at: nil, mandate: nil) ⇒ PaymentEnrollment
constructor
A new instance of PaymentEnrollment.
- #to_wire_h ⇒ Object
Constructor Details
#initialize(id:, status:, setup_url: nil, payment_token: nil, expires_at: nil, mandate: nil) ⇒ PaymentEnrollment
Returns a new instance of PaymentEnrollment.
564 |
# File 'lib/portage/ucp/value_objects.rb', line 564 def initialize(id:, status:, setup_url: nil, payment_token: nil, expires_at: nil, mandate: nil) = super |
Instance Attribute Details
#expires_at ⇒ Object (readonly)
Returns the value of attribute expires_at
563 564 565 |
# File 'lib/portage/ucp/value_objects.rb', line 563 def expires_at @expires_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id
563 564 565 |
# File 'lib/portage/ucp/value_objects.rb', line 563 def id @id end |
#mandate ⇒ Object (readonly)
Returns the value of attribute mandate
563 564 565 |
# File 'lib/portage/ucp/value_objects.rb', line 563 def mandate @mandate end |
#payment_token ⇒ Object (readonly)
Returns the value of attribute payment_token
563 564 565 |
# File 'lib/portage/ucp/value_objects.rb', line 563 def payment_token @payment_token end |
#setup_url ⇒ Object (readonly)
Returns the value of attribute setup_url
563 564 565 |
# File 'lib/portage/ucp/value_objects.rb', line 563 def setup_url @setup_url end |
#status ⇒ Object (readonly)
Returns the value of attribute status
563 564 565 |
# File 'lib/portage/ucp/value_objects.rb', line 563 def status @status end |
Instance Method Details
#to_wire_h ⇒ Object
566 567 568 569 570 571 572 573 |
# File 'lib/portage/ucp/value_objects.rb', line 566 def to_wire_h h = { "id" => id, "status" => status } h["setup_url"] = setup_url if setup_url h["payment_token"] = payment_token if payment_token h["expires_at"] = expires_at if expires_at h["mandate"] = mandate.to_wire_h if mandate h end |