Skip to content

Commit 4d517b1

Browse files
Pull in OffSessionPayment changes for the May release
1 parent 9e7bb8b commit 4d517b1

File tree

5 files changed

+10
-18
lines changed

5 files changed

+10
-18
lines changed

lib/stripe/resources/v2/payments/off_session_payment.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ class TransferData < Stripe::StripeObject
2626
end
2727
# The amount you requested to be collected on the OSP upon creation.
2828
attr_reader :amount_requested
29-
# Number of authorization attempts.
30-
attr_reader :attempts
3129
# The frequency of the underlying payment that this OSP represents.
3230
attr_reader :cadence
3331
# ID of owning compartment.

rbi/stripe.rbi

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3270,7 +3270,7 @@ module Stripe
32703270
end
32713271
class TransferData < Stripe::StripeObject
32723272
# Amount in minor units that you want to transfer.
3273-
sig { returns(Integer) }
3273+
sig { returns(T.nilable(Integer)) }
32743274
attr_reader :amount
32753275
# ID of the connected account where you want money to go.
32763276
sig { returns(String) }
@@ -3279,9 +3279,6 @@ module Stripe
32793279
# The amount you requested to be collected on the OSP upon creation.
32803280
sig { returns(Stripe::V2::Amount) }
32813281
attr_reader :amount_requested
3282-
# Number of authorization attempts.
3283-
sig { returns(Integer) }
3284-
attr_reader :attempts
32853282
# The frequency of the underlying payment that this OSP represents.
32863283
sig { returns(String) }
32873284
attr_reader :cadence
@@ -191540,12 +191537,12 @@ module Stripe
191540191537
end
191541191538
class TransferData < Stripe::RequestParams
191542191539
# Amount in minor units that you want to transfer.
191543-
sig { returns(Integer) }
191540+
sig { returns(T.nilable(Integer)) }
191544191541
attr_accessor :amount
191545191542
# ID of the connected account where you want money to go.
191546191543
sig { returns(String) }
191547191544
attr_accessor :destination
191548-
sig { params(amount: Integer, destination: String).void }
191545+
sig { params(amount: T.nilable(Integer), destination: String).void }
191549191546
def initialize(amount: nil, destination: nil); end
191550191547
end
191551191548
# Amount you want to collect.

rbi/stripe/resources/v2/payments/off_session_payment.rbi

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module Stripe
1717
end
1818
class TransferData < Stripe::StripeObject
1919
# Amount in minor units that you want to transfer.
20-
sig { returns(Integer) }
20+
sig { returns(T.nilable(Integer)) }
2121
attr_reader :amount
2222
# ID of the connected account where you want money to go.
2323
sig { returns(String) }
@@ -26,9 +26,6 @@ module Stripe
2626
# The amount you requested to be collected on the OSP upon creation.
2727
sig { returns(Stripe::V2::Amount) }
2828
attr_reader :amount_requested
29-
# Number of authorization attempts.
30-
sig { returns(Integer) }
31-
attr_reader :attempts
3229
# The frequency of the underlying payment that this OSP represents.
3330
sig { returns(String) }
3431
attr_reader :cadence

rbi/stripe/services/v2/payments/off_session_payment_service.rbi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ module Stripe
1717
end
1818
class TransferData < Stripe::RequestParams
1919
# Amount in minor units that you want to transfer.
20-
sig { returns(Integer) }
20+
sig { returns(T.nilable(Integer)) }
2121
attr_accessor :amount
2222
# ID of the connected account where you want money to go.
2323
sig { returns(String) }
2424
attr_accessor :destination
25-
sig { params(amount: Integer, destination: String).void }
25+
sig { params(amount: T.nilable(Integer), destination: String).void }
2626
def initialize(amount: nil, destination: nil); end
2727
end
2828
# Amount you want to collect.

test/stripe/generated_examples_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8565,7 +8565,7 @@ class CodegennedExampleTest < Test::Unit::TestCase
85658565
:post,
85668566
"#{Stripe::DEFAULT_API_BASE}/v2/payments/off_session_payments/id_123/cancel"
85678567
).to_return(
8568-
body: '{"amount_requested":{"currency":"USD","value":47},"attempts":542738246,"cadence":"unscheduled","compartment_id":"compartment_id","created":"1970-01-12T21:42:34.472Z","customer":"customer","failure_reason":null,"id":"obj_123","last_authorization_attempt_error":null,"latest_payment_attempt_record":null,"livemode":true,"metadata":{"undefined":"metadata"},"object":"v2.payments.off_session_payment","on_behalf_of":null,"payment_method":"payment_method","payment_record":null,"retry_details":{"attempts":542738246,"retry_strategy":"none"},"statement_descriptor":null,"statement_descriptor_suffix":null,"status":"pending","test_clock":null,"transfer_data":null}',
8568+
body: '{"amount_requested":{"currency":"USD","value":47},"cadence":"unscheduled","compartment_id":"compartment_id","created":"1970-01-12T21:42:34.472Z","customer":"customer","failure_reason":null,"id":"obj_123","last_authorization_attempt_error":null,"latest_payment_attempt_record":null,"livemode":true,"metadata":{"undefined":"metadata"},"object":"v2.payments.off_session_payment","on_behalf_of":null,"payment_method":"payment_method","payment_record":null,"retry_details":{"attempts":542738246,"retry_strategy":"none"},"statement_descriptor":null,"statement_descriptor_suffix":null,"status":"pending","test_clock":null,"transfer_data":null}',
85698569
status: 200
85708570
)
85718571
client = Stripe::StripeClient.new("sk_test_123")
@@ -8575,7 +8575,7 @@ class CodegennedExampleTest < Test::Unit::TestCase
85758575
end
85768576
should "Test v2 payments off session payment post 2 (service)" do
85778577
stub_request(:post, "#{Stripe::DEFAULT_API_BASE}/v2/payments/off_session_payments").to_return(
8578-
body: '{"amount_requested":{"currency":"USD","value":47},"attempts":542738246,"cadence":"unscheduled","compartment_id":"compartment_id","created":"1970-01-12T21:42:34.472Z","customer":"customer","failure_reason":null,"id":"obj_123","last_authorization_attempt_error":null,"latest_payment_attempt_record":null,"livemode":true,"metadata":{"undefined":"metadata"},"object":"v2.payments.off_session_payment","on_behalf_of":null,"payment_method":"payment_method","payment_record":null,"retry_details":{"attempts":542738246,"retry_strategy":"none"},"statement_descriptor":null,"statement_descriptor_suffix":null,"status":"pending","test_clock":null,"transfer_data":null}',
8578+
body: '{"amount_requested":{"currency":"USD","value":47},"cadence":"unscheduled","compartment_id":"compartment_id","created":"1970-01-12T21:42:34.472Z","customer":"customer","failure_reason":null,"id":"obj_123","last_authorization_attempt_error":null,"latest_payment_attempt_record":null,"livemode":true,"metadata":{"undefined":"metadata"},"object":"v2.payments.off_session_payment","on_behalf_of":null,"payment_method":"payment_method","payment_record":null,"retry_details":{"attempts":542738246,"retry_strategy":"none"},"statement_descriptor":null,"statement_descriptor_suffix":null,"status":"pending","test_clock":null,"transfer_data":null}',
85798579
status: 200
85808580
)
85818581
client = Stripe::StripeClient.new("sk_test_123")
@@ -8594,7 +8594,7 @@ class CodegennedExampleTest < Test::Unit::TestCase
85948594
end
85958595
should "Test v2 payments off session payment get (service)" do
85968596
stub_request(:get, "#{Stripe::DEFAULT_API_BASE}/v2/payments/off_session_payments").to_return(
8597-
body: '{"data":[{"amount_requested":{"currency":"USD","value":47},"attempts":542738246,"cadence":"unscheduled","compartment_id":"compartment_id","created":"1970-01-12T21:42:34.472Z","customer":"customer","failure_reason":null,"id":"obj_123","last_authorization_attempt_error":null,"latest_payment_attempt_record":null,"livemode":true,"metadata":{"undefined":"metadata"},"object":"v2.payments.off_session_payment","on_behalf_of":null,"payment_method":"payment_method","payment_record":null,"retry_details":{"attempts":542738246,"retry_strategy":"none"},"statement_descriptor":null,"statement_descriptor_suffix":null,"status":"pending","test_clock":null,"transfer_data":null}],"next_page_url":null,"previous_page_url":null}',
8597+
body: '{"data":[{"amount_requested":{"currency":"USD","value":47},"cadence":"unscheduled","compartment_id":"compartment_id","created":"1970-01-12T21:42:34.472Z","customer":"customer","failure_reason":null,"id":"obj_123","last_authorization_attempt_error":null,"latest_payment_attempt_record":null,"livemode":true,"metadata":{"undefined":"metadata"},"object":"v2.payments.off_session_payment","on_behalf_of":null,"payment_method":"payment_method","payment_record":null,"retry_details":{"attempts":542738246,"retry_strategy":"none"},"statement_descriptor":null,"statement_descriptor_suffix":null,"status":"pending","test_clock":null,"transfer_data":null}],"next_page_url":null,"previous_page_url":null}',
85988598
status: 200
85998599
)
86008600
client = Stripe::StripeClient.new("sk_test_123")
@@ -8607,7 +8607,7 @@ class CodegennedExampleTest < Test::Unit::TestCase
86078607
:get,
86088608
"#{Stripe::DEFAULT_API_BASE}/v2/payments/off_session_payments/id_123"
86098609
).to_return(
8610-
body: '{"amount_requested":{"currency":"USD","value":47},"attempts":542738246,"cadence":"unscheduled","compartment_id":"compartment_id","created":"1970-01-12T21:42:34.472Z","customer":"customer","failure_reason":null,"id":"obj_123","last_authorization_attempt_error":null,"latest_payment_attempt_record":null,"livemode":true,"metadata":{"undefined":"metadata"},"object":"v2.payments.off_session_payment","on_behalf_of":null,"payment_method":"payment_method","payment_record":null,"retry_details":{"attempts":542738246,"retry_strategy":"none"},"statement_descriptor":null,"statement_descriptor_suffix":null,"status":"pending","test_clock":null,"transfer_data":null}',
8610+
body: '{"amount_requested":{"currency":"USD","value":47},"cadence":"unscheduled","compartment_id":"compartment_id","created":"1970-01-12T21:42:34.472Z","customer":"customer","failure_reason":null,"id":"obj_123","last_authorization_attempt_error":null,"latest_payment_attempt_record":null,"livemode":true,"metadata":{"undefined":"metadata"},"object":"v2.payments.off_session_payment","on_behalf_of":null,"payment_method":"payment_method","payment_record":null,"retry_details":{"attempts":542738246,"retry_strategy":"none"},"statement_descriptor":null,"statement_descriptor_suffix":null,"status":"pending","test_clock":null,"transfer_data":null}',
86118611
status: 200
86128612
)
86138613
client = Stripe::StripeClient.new("sk_test_123")

0 commit comments

Comments
 (0)