def get_order(order_id, paypal_mode, paypal_client_id, paypal_client_secret): return Order.find(resource_id=order_id, api=Api({ 'mode': paypal_mode, 'client_id': paypal_client_id, 'client_secret': paypal_client_secret }))
from paypalrestsdk import Order, ResourceNotFound import logging logging.basicConfig(level=logging.INFO) try: order = Order.find("99M58264FG144833V") print("Got Order details for Order[%s]" % (order.id)) except ResourceNotFound as error: print("Order Not Found")
from paypalrestsdk import Order import logging logging.basicConfig(level=logging.INFO) order = Order.find("<ORDER_ID>") response = order.authorize({"amount": {"currency": "USD", "total": "0.08"}}) if order.success(): print(("Authorized[%s] successfully" % (order.id))) else: print((order.error))
from paypalrestsdk import Order import logging logging.basicConfig(level=logging.INFO) order = Order.find("<ORDER_ID>") response = order.authorize({ "amount": { "currency": "USD", "total": "0.08" } }) if order.success(): print("Authorized[%s] successfully"%(order.id)) else: print(order.error)
from paypalrestsdk import Order import logging logging.basicConfig(level=logging.INFO) order = Order.find("O-0FJ734297A068505V") if order.void(): print("Void Order successfully") else: print(order.error)