Skip to content

Add authorization_type and payment_plan to payment link, hosted, and session requests#177

Open
armando-rodriguez-cko wants to merge 1 commit into
masterfrom
fix/payment-request-field-gaps
Open

Add authorization_type and payment_plan to payment link, hosted, and session requests#177
armando-rodriguez-cko wants to merge 1 commit into
masterfrom
fix/payment-request-field-gaps

Conversation

@armando-rodriguez-cko

Copy link
Copy Markdown
Contributor

What

Adds the authorization_type and payment_plan fields to three request classes:

  • PaymentLink (lib/checkout_sdk/payments/links/payment_link.rb)
  • HostedPaymentsSession (lib/checkout_sdk/payments/hosted/hosted_payments_session.rb)
  • PaymentSessionsRequest (lib/checkout_sdk/payments/sessions/payment_sessions_request.rb)

Why

Recent swagger updates added these fields:

  • CreatePaymentSessionsBaseRequest: authorization_type, payment_plan (2026-06-03)
  • HostedPaymentsRequest: authorization_type (2026-06-03), payment_plan (2026-06-15)
  • PaymentLinksRequest: authorization_type (2026-06-03), payment_plan (2026-06-15)

The Ruby SDK uses explicit attr_accessor declarations, so undeclared fields do not serialize. Both the AuthorizationType enum and the PaymentPlan class already exist in lib/, so this only wires the accessors and RDOC comments matching surrounding fields (consistent with how PaymentRequest already declares authorization_type).

This is part of a cross-SDK sweep aligning request classes with the latest swagger.

Tests

Added spec/checkout_sdk/payments/payment_plan_fields_spec.rb (unit spec, no API access needed) covering both new accessors on all three classes.

bundle exec rspec spec/checkout_sdk/payments/payment_plan_fields_spec.rb
6 examples, 0 failures

RuboCop: clean on all changed files.

…session requests

Swagger added authorization_type and payment_plan to HostedPaymentsRequest,
PaymentLinksRequest, and CreatePaymentSessionsBaseRequest. The Ruby SDK uses
explicit attr_accessor, so these fields must be declared to pass through.

- PaymentLink, HostedPaymentsSession, PaymentSessionsRequest: add both accessors
  and RDOC comments (AuthorizationType enum, PaymentPlan class, both pre-existing)
- Add unit spec covering the new accessors on all three classes
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant