Class: Dodopayments::Resources::Payments
- Inherits:
-
Object
- Object
- Dodopayments::Resources::Payments
- Defined in:
- lib/dodopayments/resources/payments.rb
Instance Method Summary collapse
- #create(billing:, customer:, product_cart:, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, force_3ds: nil, metadata: nil, payment_link: nil, payment_method_id: nil, redirect_immediately: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, tax_id: nil, request_options: {}) ⇒ Dodopayments::Models::PaymentCreateResponse deprecated Deprecated.
-
#initialize(client:) ⇒ Payments
constructor
private
A new instance of Payments.
- #list(brand_id: nil, created_at_gte: nil, created_at_lte: nil, customer_id: nil, page_number: nil, page_size: nil, product_id: nil, status: nil, subscription_id: nil, request_options: {}) ⇒ Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::PaymentListResponse>
- #retrieve(payment_id, request_options: {}) ⇒ Dodopayments::Models::Payment
- #retrieve_line_items(payment_id, request_options: {}) ⇒ Dodopayments::Models::PaymentRetrieveLineItemsResponse
Constructor Details
#initialize(client:) ⇒ Payments
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Payments.
136 137 138 |
# File 'lib/dodopayments/resources/payments.rb', line 136 def initialize(client:) @client = client end |
Instance Method Details
#create(billing:, customer:, product_cart:, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, force_3ds: nil, metadata: nil, payment_link: nil, payment_method_id: nil, redirect_immediately: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, tax_id: nil, request_options: {}) ⇒ Dodopayments::Models::PaymentCreateResponse
Deprecated.
Some parameter documentations has been truncated, see Models::PaymentCreateParams for more details.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/dodopayments/resources/payments.rb', line 48 def create(params) parsed, = Dodopayments::PaymentCreateParams.dump_request(params) @client.request( method: :post, path: "payments", body: parsed, model: Dodopayments::Models::PaymentCreateResponse, options: ) end |
#list(brand_id: nil, created_at_gte: nil, created_at_lte: nil, customer_id: nil, page_number: nil, page_size: nil, product_id: nil, status: nil, subscription_id: nil, request_options: {}) ⇒ Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::PaymentListResponse>
102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/dodopayments/resources/payments.rb', line 102 def list(params = {}) parsed, = Dodopayments::PaymentListParams.dump_request(params) query = Dodopayments::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "payments", query: query, page: Dodopayments::Internal::DefaultPageNumberPagination, model: Dodopayments::Models::PaymentListResponse, options: ) end |
#retrieve(payment_id, request_options: {}) ⇒ Dodopayments::Models::Payment
68 69 70 71 72 73 74 75 |
# File 'lib/dodopayments/resources/payments.rb', line 68 def retrieve(payment_id, params = {}) @client.request( method: :get, path: ["payments/%1$s", payment_id], model: Dodopayments::Payment, options: params[:request_options] ) end |
#retrieve_line_items(payment_id, request_options: {}) ⇒ Dodopayments::Models::PaymentRetrieveLineItemsResponse
124 125 126 127 128 129 130 131 |
# File 'lib/dodopayments/resources/payments.rb', line 124 def retrieve_line_items(payment_id, params = {}) @client.request( method: :get, path: ["payments/%1$s/line-items", payment_id], model: Dodopayments::Models::PaymentRetrieveLineItemsResponse, options: params[:request_options] ) end |