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, return_url: nil, show_saved_payment_methods: nil, tax_id: nil, request_options: {}) ⇒ Dodopayments::Models::PaymentCreateResponse
Some parameter documentations has been truncated, see Models::PaymentCreateParams for more details.
-
#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, 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.
125 126 127 |
# File 'lib/dodopayments/resources/payments.rb', line 125 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, return_url: nil, show_saved_payment_methods: nil, tax_id: nil, request_options: {}) ⇒ Dodopayments::Models::PaymentCreateResponse
Some parameter documentations has been truncated, see Models::PaymentCreateParams for more details.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/dodopayments/resources/payments.rb', line 40 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, status: nil, subscription_id: nil, request_options: {}) ⇒ Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::PaymentListResponse>
92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/dodopayments/resources/payments.rb', line 92 def list(params = {}) parsed, = Dodopayments::PaymentListParams.dump_request(params) @client.request( method: :get, path: "payments", query: parsed, page: Dodopayments::Internal::DefaultPageNumberPagination, model: Dodopayments::Models::PaymentListResponse, options: ) end |
#retrieve(payment_id, request_options: {}) ⇒ Dodopayments::Models::Payment
60 61 62 63 64 65 66 67 |
# File 'lib/dodopayments/resources/payments.rb', line 60 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
113 114 115 116 117 118 119 120 |
# File 'lib/dodopayments/resources/payments.rb', line 113 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 |