Class: Pago::V2026_04::Services::CustomerPortal::Orders
- Defined in:
- lib/pago/v2026_04/services/customer_portal.rb,
sig/pago/v2026_04/generated.rbs
Instance Attribute Summary
Attributes inherited from Service
Instance Method Summary collapse
-
#confirm_retry_payment(id, body: {}) ⇒ Models::CustomerOrderPaymentConfirmation
Confirm a retry payment using a Stripe confirmation token.
-
#generate_invoice(id) ⇒ Object
Trigger generation of an order's invoice.
-
#get(id) ⇒ Models::CustomerOrder
Get an order by ID for the authenticated customer.
-
#get_payment_status(id) ⇒ Models::CustomerOrderPaymentStatus
Get the current payment status for an order.
-
#invoice(id) ⇒ Models::CustomerOrderInvoice
Get an order's invoice data.
-
#list(product_id: nil, product_billing_type: nil, subscription_id: nil, query: nil, page: 1, limit: 10, sorting: ["-created_at"]) ⇒ Models::ListResourceCustomerOrder
List orders of the authenticated customer.
-
#list_each(product_id: nil, product_billing_type: nil, subscription_id: nil, query: nil, limit: 10, sorting: ["-created_at"]) {|item| ... } ⇒ Pago::Paginator
Enumerate every item of
list, fetching pages on demand. -
#receipt(id) ⇒ Models::CustomerOrderReceipt
Get a presigned URL to download an order's receipt PDF.
-
#update(id, body: {}) ⇒ Models::CustomerOrder
Update an order for the authenticated customer.
Methods inherited from Service
Constructor Details
This class inherits a constructor from Pago::Service
Instance Method Details
#confirm_retry_payment(id, body: {}) ⇒ Models::CustomerOrderPaymentConfirmation
Confirm a retry payment using a Stripe confirmation token.
984 985 986 987 988 989 990 991 992 993 994 995 |
# File 'lib/pago/v2026_04/services/customer_portal.rb', line 984 def confirm_retry_payment(id, body: {}) data = client.request( http_method: "POST", path: "/v1/customer-portal/orders/{id}/confirm-payment", path_params: { "id" => id }, query: {}, body: body, response_type: :json, errors: { 404 => Errors::ResourceNotFound, 409 => Errors::PaymentAlreadyInProgress, 422 => Errors::OrderNotEligibleForRetry, 429 => Errors::ManualRetryLimitExceeded } ) Models::CustomerOrderPaymentConfirmation.from_json(data) end |
#generate_invoice(id) ⇒ Object
Trigger generation of an order's invoice.
924 925 926 927 928 929 930 931 932 933 934 |
# File 'lib/pago/v2026_04/services/customer_portal.rb', line 924 def generate_invoice(id) data = client.request( http_method: "POST", path: "/v1/customer-portal/orders/{id}/invoice", path_params: { "id" => id }, query: {}, response_type: :json, errors: { 404 => Errors::ResourceNotFound, 409 => Errors::OrderNotEligibleForInvoice, 422 => Errors::MissingInvoiceBillingDetails } ) data end |
#get(id) ⇒ Models::CustomerOrder
Get an order by ID for the authenticated customer.
864 865 866 867 868 869 870 871 872 873 874 |
# File 'lib/pago/v2026_04/services/customer_portal.rb', line 864 def get(id) data = client.request( http_method: "GET", path: "/v1/customer-portal/orders/{id}", path_params: { "id" => id }, query: {}, response_type: :json, errors: { 404 => Errors::ResourceNotFound, 422 => Errors::HTTPValidationError } ) Models::CustomerOrder.from_json(data) end |
#get_payment_status(id) ⇒ Models::CustomerOrderPaymentStatus
Get the current payment status for an order.
962 963 964 965 966 967 968 969 970 971 972 |
# File 'lib/pago/v2026_04/services/customer_portal.rb', line 962 def get_payment_status(id) data = client.request( http_method: "GET", path: "/v1/customer-portal/orders/{id}/payment-status", path_params: { "id" => id }, query: {}, response_type: :json, errors: { 404 => Errors::ResourceNotFound, 422 => Errors::HTTPValidationError } ) Models::CustomerOrderPaymentStatus.from_json(data) end |
#invoice(id) ⇒ Models::CustomerOrderInvoice
Get an order's invoice data.
904 905 906 907 908 909 910 911 912 913 914 |
# File 'lib/pago/v2026_04/services/customer_portal.rb', line 904 def invoice(id) data = client.request( http_method: "GET", path: "/v1/customer-portal/orders/{id}/invoice", path_params: { "id" => id }, query: {}, response_type: :json, errors: { 404 => Errors::ResourceNotFound, 422 => Errors::HTTPValidationError } ) Models::CustomerOrderInvoice.from_json(data) end |
#list(product_id: nil, product_billing_type: nil, subscription_id: nil, query: nil, page: 1, limit: 10, sorting: ["-created_at"]) ⇒ Models::ListResourceCustomerOrder
List orders of the authenticated customer.
834 835 836 837 838 839 840 841 842 843 844 |
# File 'lib/pago/v2026_04/services/customer_portal.rb', line 834 def list(product_id: nil, product_billing_type: nil, subscription_id: nil, query: nil, page: 1, limit: 10, sorting: ["-created_at"]) data = client.request( http_method: "GET", path: "/v1/customer-portal/orders/", path_params: {}, query: { "product_id" => product_id, "product_billing_type" => product_billing_type, "subscription_id" => subscription_id, "query" => query, "page" => page, "limit" => limit, "sorting" => sorting }, response_type: :json, errors: { 422 => Errors::HTTPValidationError } ) Models::ListResourceCustomerOrder.from_json(data) end |
#list_each(product_id: nil, product_billing_type: nil, subscription_id: nil, query: nil, limit: 10, sorting: ["-created_at"]) {|item| ... } ⇒ Pago::Paginator
Enumerate every item of list, fetching pages on demand.
850 851 852 853 854 855 |
# File 'lib/pago/v2026_04/services/customer_portal.rb', line 850 def list_each(product_id: nil, product_billing_type: nil, subscription_id: nil, query: nil, limit: 10, sorting: ["-created_at"], &block) paginator = ::Pago::Paginator.new do |page_number| list(product_id: product_id, product_billing_type: product_billing_type, subscription_id: subscription_id, query: query, page: page_number, limit: limit, sorting: sorting) end block ? paginator.each(&block) : paginator end |
#receipt(id) ⇒ Models::CustomerOrderReceipt
Get a presigned URL to download an order's receipt PDF.
943 944 945 946 947 948 949 950 951 952 953 |
# File 'lib/pago/v2026_04/services/customer_portal.rb', line 943 def receipt(id) data = client.request( http_method: "GET", path: "/v1/customer-portal/orders/{id}/receipt", path_params: { "id" => id }, query: {}, response_type: :json, errors: { 404 => Errors::ResourceNotFound, 422 => Errors::HTTPValidationError } ) Models::CustomerOrderReceipt.from_json(data) end |
#update(id, body: {}) ⇒ Models::CustomerOrder
Update an order for the authenticated customer.
884 885 886 887 888 889 890 891 892 893 894 895 |
# File 'lib/pago/v2026_04/services/customer_portal.rb', line 884 def update(id, body: {}) data = client.request( http_method: "PATCH", path: "/v1/customer-portal/orders/{id}", path_params: { "id" => id }, query: {}, body: body, response_type: :json, errors: { 404 => Errors::ResourceNotFound, 422 => Errors::HTTPValidationError } ) Models::CustomerOrder.from_json(data) end |