diff --git a/lib/stripe/resources/account.rb b/lib/stripe/resources/account.rb index bb8b3e5d9..b28cb0a6f 100644 --- a/lib/stripe/resources/account.rb +++ b/lib/stripe/resources/account.rb @@ -21,7 +21,7 @@ class Account < APIResource def reject(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/reject", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end save_nested_resource :external_account diff --git a/lib/stripe/resources/credit_note.rb b/lib/stripe/resources/credit_note.rb index 11c27bc8e..0b369f590 100644 --- a/lib/stripe/resources/credit_note.rb +++ b/lib/stripe/resources/credit_note.rb @@ -12,7 +12,7 @@ class CreditNote < APIResource def void_credit_note(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/void", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end end end diff --git a/lib/stripe/resources/dispute.rb b/lib/stripe/resources/dispute.rb index 987900cb0..2541a3387 100644 --- a/lib/stripe/resources/dispute.rb +++ b/lib/stripe/resources/dispute.rb @@ -11,7 +11,7 @@ class Dispute < APIResource def close(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/close", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end def close_url diff --git a/lib/stripe/resources/invoice.rb b/lib/stripe/resources/invoice.rb index b0c85224b..dfee9f9a5 100644 --- a/lib/stripe/resources/invoice.rb +++ b/lib/stripe/resources/invoice.rb @@ -17,27 +17,27 @@ class Invoice < APIResource def finalize_invoice(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/finalize", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end def mark_uncollectible(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/mark_uncollectible", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end def pay(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/pay", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end def send_invoice(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/send", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end def void_invoice(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/void", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end def self.upcoming(params, opts = {}) diff --git a/lib/stripe/resources/issuing/authorization.rb b/lib/stripe/resources/issuing/authorization.rb index 718be0f62..eb13be217 100644 --- a/lib/stripe/resources/issuing/authorization.rb +++ b/lib/stripe/resources/issuing/authorization.rb @@ -13,12 +13,12 @@ class Authorization < APIResource def approve(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/approve", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end def decline(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/decline", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end end end diff --git a/lib/stripe/resources/payment_intent.rb b/lib/stripe/resources/payment_intent.rb index 2cf9c9987..5bbf8fbeb 100644 --- a/lib/stripe/resources/payment_intent.rb +++ b/lib/stripe/resources/payment_intent.rb @@ -14,17 +14,17 @@ class PaymentIntent < APIResource def cancel(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/cancel", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end def capture(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/capture", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end def confirm(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/confirm", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end end end diff --git a/lib/stripe/resources/payment_method.rb b/lib/stripe/resources/payment_method.rb index c2d126255..4dd3fad15 100644 --- a/lib/stripe/resources/payment_method.rb +++ b/lib/stripe/resources/payment_method.rb @@ -13,12 +13,12 @@ class PaymentMethod < APIResource def attach(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/attach", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end def detach(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/detach", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end end end diff --git a/lib/stripe/resources/payout.rb b/lib/stripe/resources/payout.rb index 351b8c334..d9e1d4800 100644 --- a/lib/stripe/resources/payout.rb +++ b/lib/stripe/resources/payout.rb @@ -12,7 +12,7 @@ class Payout < APIResource def cancel(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/cancel", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end def cancel_url diff --git a/lib/stripe/resources/review.rb b/lib/stripe/resources/review.rb index de7570a1c..8eb0e62b6 100644 --- a/lib/stripe/resources/review.rb +++ b/lib/stripe/resources/review.rb @@ -10,7 +10,7 @@ class Review < APIResource def approve(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/approve", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end end end diff --git a/lib/stripe/resources/setup_intent.rb b/lib/stripe/resources/setup_intent.rb index 542e74736..3b3815fdb 100644 --- a/lib/stripe/resources/setup_intent.rb +++ b/lib/stripe/resources/setup_intent.rb @@ -13,12 +13,12 @@ class SetupIntent < APIResource def cancel(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/cancel", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end def confirm(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/confirm", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end end end diff --git a/lib/stripe/resources/source.rb b/lib/stripe/resources/source.rb index 8e960b9ad..ec897b87e 100644 --- a/lib/stripe/resources/source.rb +++ b/lib/stripe/resources/source.rb @@ -11,7 +11,7 @@ class Source < APIResource def verify(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/verify", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end def detach(params = {}, opts = {}) diff --git a/lib/stripe/resources/subscription_schedule.rb b/lib/stripe/resources/subscription_schedule.rb index 6516b99e7..2c24e784d 100644 --- a/lib/stripe/resources/subscription_schedule.rb +++ b/lib/stripe/resources/subscription_schedule.rb @@ -16,12 +16,12 @@ class SubscriptionSchedule < APIResource def cancel(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/cancel", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end def release(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/release", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end def revisions(params = {}, opts = {}) diff --git a/lib/stripe/resources/topup.rb b/lib/stripe/resources/topup.rb index 76defd7f4..5468a9c89 100644 --- a/lib/stripe/resources/topup.rb +++ b/lib/stripe/resources/topup.rb @@ -12,7 +12,7 @@ class Topup < APIResource def cancel(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/cancel", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end end end diff --git a/lib/stripe/resources/transfer.rb b/lib/stripe/resources/transfer.rb index cd6655a37..3918a5cd4 100644 --- a/lib/stripe/resources/transfer.rb +++ b/lib/stripe/resources/transfer.rb @@ -16,7 +16,7 @@ class Transfer < APIResource def cancel(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/cancel", params, opts) - Util.convert_to_stripe_object(resp.data, opts) + initialize_from(resp.data, opts) end def cancel_url