Module: PaypalAPI::Invoices::APIs
- Included in:
- PaypalAPI::Invoices, PaypalAPI::Invoices
- Defined in:
- lib/paypal-api/api_collections/invoices.rb
Overview
Common methods for PaypalAPI::Invoices class and client.invoices instance
Instance Method Summary collapse
-
#cancel(invoice_id, query: nil, body: nil, headers: nil) ⇒ Response
Cancel sent invoice.
-
#create(query: nil, body: nil, headers: nil) ⇒ Response
Create draft invoice.
-
#delete(invoice_id, query: nil, body: nil, headers: nil) ⇒ Response
Delete invoice.
-
#delete_payment(invoice_id, transaction_id, query: nil, body: nil, headers: nil) ⇒ Response
Delete external payment.
-
#delete_refund(invoice_id, transaction_id, query: nil, body: nil, headers: nil) ⇒ Response
Delete external refund.
-
#generate_invoice_number(query: nil, body: nil, headers: nil) ⇒ Response
Generate invoice number.
-
#generate_qr_code(invoice_id, query: nil, body: nil, headers: nil) ⇒ Response
Generate QR code.
-
#list(query: nil, body: nil, headers: nil) ⇒ Response
List invoices.
-
#record_payment(invoice_id, query: nil, body: nil, headers: nil) ⇒ Response
Record payment for invoice.
-
#record_refund(invoice_id, query: nil, body: nil, headers: nil) ⇒ Response
Record refund for invoice.
-
#remind(invoice_id, query: nil, body: nil, headers: nil) ⇒ Response
Send invoice reminder.
-
#search(query: nil, body: nil, headers: nil) ⇒ Response
Search for invoices.
-
#send_invoice(invoice_id, query: nil, body: nil, headers: nil) ⇒ Response
Send invoice.
-
#show(invoice_id, query: nil, body: nil, headers: nil) ⇒ Response
Show invoice details.
-
#update(invoice_id, query: nil, body: nil, headers: nil) ⇒ Response
Fully update invoice.
Instance Method Details
#cancel(invoice_id, query: nil, body: nil, headers: nil) ⇒ Response
Cancel sent invoice
167 168 169 |
# File 'lib/paypal-api/api_collections/invoices.rb', line 167 def cancel(invoice_id, query: nil, body: nil, headers: nil) client.post("/v2/invoicing/invoices/#{encode(invoice_id)}/cancel", query: query, body: body, headers: headers) end |
#create(query: nil, body: nil, headers: nil) ⇒ Response
Create draft invoice
27 28 29 |
# File 'lib/paypal-api/api_collections/invoices.rb', line 27 def create(query: nil, body: nil, headers: nil) client.post("/v2/invoicing/invoices", query: query, body: body, headers: headers) end |
#delete(invoice_id, query: nil, body: nil, headers: nil) ⇒ Response
Delete invoice
71 72 73 |
# File 'lib/paypal-api/api_collections/invoices.rb', line 71 def delete(invoice_id, query: nil, body: nil, headers: nil) client.delete("/v2/invoicing/invoices/#{encode(invoice_id)}", query: query, body: body, headers: headers) end |
#delete_payment(invoice_id, transaction_id, query: nil, body: nil, headers: nil) ⇒ Response
Delete external payment
120 121 122 123 124 125 |
# File 'lib/paypal-api/api_collections/invoices.rb', line 120 def delete_payment(invoice_id, transaction_id, query: nil, body: nil, headers: nil) client.delete( "/v2/invoicing/invoices/#{encode(invoice_id)}/payments/#{encode(transaction_id)}", query: query, body: body, headers: headers ) end |
#delete_refund(invoice_id, transaction_id, query: nil, body: nil, headers: nil) ⇒ Response
Delete external refund
105 106 107 108 109 110 |
# File 'lib/paypal-api/api_collections/invoices.rb', line 105 def delete_refund(invoice_id, transaction_id, query: nil, body: nil, headers: nil) client.delete( "/v2/invoicing/invoices/#{encode(invoice_id)}/refunds/#{encode(transaction_id)}", query: query, body: body, headers: headers ) end |
#generate_invoice_number(query: nil, body: nil, headers: nil) ⇒ Response
Generate invoice number
188 189 190 |
# File 'lib/paypal-api/api_collections/invoices.rb', line 188 def generate_invoice_number(query: nil, body: nil, headers: nil) client.post("/v2/invoicing/generate-next-invoice-number", query: query, body: body, headers: headers) end |
#generate_qr_code(invoice_id, query: nil, body: nil, headers: nil) ⇒ Response
Generate QR code
178 179 180 |
# File 'lib/paypal-api/api_collections/invoices.rb', line 178 def generate_qr_code(invoice_id, query: nil, body: nil, headers: nil) client.post("/v2/invoicing/invoices/#{encode(invoice_id)}/generate-qr-code", query: query, body: body, headers: headers) end |
#list(query: nil, body: nil, headers: nil) ⇒ Response
List invoices
38 39 40 |
# File 'lib/paypal-api/api_collections/invoices.rb', line 38 def list(query: nil, body: nil, headers: nil) client.get("/v2/invoicing/invoices", query: query, body: body, headers: headers) end |
#record_payment(invoice_id, query: nil, body: nil, headers: nil) ⇒ Response
Record payment for invoice
134 135 136 |
# File 'lib/paypal-api/api_collections/invoices.rb', line 134 def record_payment(invoice_id, query: nil, body: nil, headers: nil) client.post("/v2/invoicing/invoices/#{encode(invoice_id)}/payments", query: query, body: body, headers: headers) end |
#record_refund(invoice_id, query: nil, body: nil, headers: nil) ⇒ Response
Record refund for invoice
145 146 147 |
# File 'lib/paypal-api/api_collections/invoices.rb', line 145 def record_refund(invoice_id, query: nil, body: nil, headers: nil) client.post("/v2/invoicing/invoices/#{encode(invoice_id)}/refunds", query: query, body: body, headers: headers) end |
#remind(invoice_id, query: nil, body: nil, headers: nil) ⇒ Response
Send invoice reminder
93 94 95 |
# File 'lib/paypal-api/api_collections/invoices.rb', line 93 def remind(invoice_id, query: nil, body: nil, headers: nil) client.post("/v2/invoicing/invoices/#{encode(invoice_id)}/remind", query: query, body: body, headers: headers) end |
#search(query: nil, body: nil, headers: nil) ⇒ Response
Search for invoices
82 83 84 |
# File 'lib/paypal-api/api_collections/invoices.rb', line 82 def search(query: nil, body: nil, headers: nil) client.post("/v2/invoicing/search-invoices", query: query, body: body, headers: headers) end |
#send_invoice(invoice_id, query: nil, body: nil, headers: nil) ⇒ Response
Send invoice
156 157 158 |
# File 'lib/paypal-api/api_collections/invoices.rb', line 156 def send_invoice(invoice_id, query: nil, body: nil, headers: nil) client.post("/v2/invoicing/invoices/#{encode(invoice_id)}/send", query: query, body: body, headers: headers) end |
#show(invoice_id, query: nil, body: nil, headers: nil) ⇒ Response
Show invoice details
49 50 51 |
# File 'lib/paypal-api/api_collections/invoices.rb', line 49 def show(invoice_id, query: nil, body: nil, headers: nil) client.get("/v2/invoicing/invoices/#{encode(invoice_id)}", query: query, body: body, headers: headers) end |
#update(invoice_id, query: nil, body: nil, headers: nil) ⇒ Response
Fully update invoice
60 61 62 |
# File 'lib/paypal-api/api_collections/invoices.rb', line 60 def update(invoice_id, query: nil, body: nil, headers: nil) client.put("/v2/invoicing/invoices/#{encode(invoice_id)}", query: query, body: body, headers: headers) end |