def get_invoice(self): from . import sandbox inv = Invoice.find(self.invoice_id) return inv
from paypalrestsdk import Invoice import logging logging.basicConfig(level=logging.INFO) invoice = Invoice.find("INV2-CJL7-PF4G-BLQF-5FWG") options = { "subject": "Past due", "note": "Canceling invoice", "send_to_merchant": True, "send_to_payer": True } if invoice.cancel(options): # return True or False print("Invoice[%s] cancel successfully" % (invoice.id)) else: print(invoice.error)
from paypalrestsdk import Invoice import logging logging.basicConfig(level=logging.INFO) invoice = Invoice.find("<INVOICE_ID>") refund_attr = { "date": "2014-07-06 03:30:00 PST", "note": "Refund provided by cash." } if invoice.record_refund(refund_attr): # return True or False print(("Payment record on Invoice[%s] successfully" % (invoice.id))) else: print((invoice.error))
from paypalrestsdk import Invoice, ResourceNotFound import logging import json logging.basicConfig(level=logging.INFO) try: invoice = Invoice.find("INV2-9DRB-YTHU-2V9Q-7Q24") print(json.dumps(invoice.to_dict(), sort_keys=False, indent=4)) except ResourceNotFound as error: print("Invoice Not Found")
from paypalrestsdk import Invoice import logging invoice_id = "INV2-EM7V-GTSP-7UTG-Y2MK" try: invoice = Invoice.find(invoice_id) height = "400" width = "400" rv = invoice.get_qr_code(height, width) print(rv) except ResourceNotFound as error: print("Invoice Not Found")
from paypalrestsdk import Invoice import logging logging.basicConfig(level=logging.INFO) invoice = Invoice.find("INV2-9DRB-YTHU-2V9Q-7Q24") if invoice.send(): # return True or False print("Invoice[%s] send successfully" % (invoice.id)) else: print(invoice.error)
from paypalrestsdk import Invoice import logging logging.basicConfig(level=logging.INFO) invoice = Invoice.find("<INVOICE_ID>") refund_attr = { "date": "2014-07-06 03:30:00 PST", "note": "Refund provided by cash." } if invoice.record_refund(refund_attr): # return True or False print("Payment record on Invoice[%s] successfully" % (invoice.id)) else: print(invoice.error)
from paypalrestsdk import Invoice import logging logging.basicConfig(level=logging.INFO) invoice = Invoice.find("INV2-CJL7-PF4G-BLQF-5FWG") options = { "subject": "Past due", "note": "Canceling invoice", "send_to_merchant": True, "send_to_payer": True } if invoice.cancel(options): # return True or False print("Invoice[%s] cancel successfully"%(invoice.id)) else: print(invoice.error)
"note": "Medical Invoice 16 Jul, 2013 PST", "payment_term": { "term_type": "NET_45" }, "shipping_info": { "first_name": "Sally", "last_name": "Patient", "business_name": "Not applicable", "phone": { "country_code": "001", "national_number": "5039871234" }, "address": { "line1": "1234 Broad St.", "city": "Portland", "state": "OR", "postal_code": "97216", "country_code": "US" } } }) if invoice.create(refresh_token): print("Third Party Invoice[%s] created successfully" % (invoice.id)) # Fetch the resource similarly as shown below: result = Invoice.find(invoice.id, refresh_token=refresh_token) print("Invoice Detail: %s" % result) else: print(invoice.error)
from paypalrestsdk import Invoice import logging logging.basicConfig(level=logging.INFO) invoice = Invoice.find("INV2-9CAH-K5G7-2JPL-G4B4") options = { "subject": "Past due", "note": "Please pay soon", "send_to_merchant": True } if invoice.remind(options): # return True or False print("Invoice[%s] remind successfully" % (invoice.id)) else: print(invoice.error)
from paypalrestsdk import Invoice import logging import json logging.basicConfig(level=logging.INFO) invoice = Invoice.find("INV2-V2QW-LCUV-RNRL-AQUE") options = { "subject": "Past due", "note": "Canceling invoice", "send_to_merchant": True, "send_to_payer": True } if invoice.cancel(options): # return True or False print(json.dumps(invoice.to_dict(), sort_keys=False, indent=4)) else: print(invoice.error)