Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert back to initialize_from from Util.convert_to_stripe_object #806

Merged
merged 3 commits into from
Jul 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/stripe/resources/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/resources/credit_note.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lib/stripe/resources/dispute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions lib/stripe/resources/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {})
Expand Down
4 changes: 2 additions & 2 deletions lib/stripe/resources/issuing/authorization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/stripe/resources/payment_intent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions lib/stripe/resources/payment_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lib/stripe/resources/payout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/resources/review.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions lib/stripe/resources/setup_intent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lib/stripe/resources/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {})
Expand Down
4 changes: 2 additions & 2 deletions lib/stripe/resources/subscription_schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {})
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/resources/topup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lib/stripe/resources/transfer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down