@@ -51,14 +51,17 @@ def add_orders_to(self, payment_id, order_data: Union[List[dict], dict]) -> List
5151 Adds one or several orders to the given payment
5252
5353 :param payment_id: ID of the payment to add the order(s) to
54- :param order_data: Either a dict of attributes for a single order, or a list of such dicts for several
54+ :param order_data: Either a dict of attributes for a single order,
55+ or a list of such dicts for several
5556 :return: List of Order instances that were added to the payment
5657 """
5758 if type (order_data ) is dict :
5859 order_data = [order_data ]
5960
6061 response = (
61- self .request (f"{ self .PAYMENTS_PATH } /{ payment_id } /orders" ).set_body ({"orders" : order_data }).put ()
62+ self .request (f"{ self .PAYMENTS_PATH } /{ payment_id } /orders" )
63+ .set_body ({"orders" : order_data })
64+ .put ()
6265 )
6366
6467 return [Order (o ) for o in response .json ]
@@ -68,14 +71,17 @@ def set_orders_for(self, payment_id, order_data: Union[List[dict], dict]) -> Lis
6871 Sets one or several orders on the given payment (replacing existing ones)
6972
7073 :param payment_id: ID of the payment to add the order(s) to
71- :param order_data: Either a dict of attributes for a single order, or a list of such dicts for several
74+ :param order_data: Either a dict of attributes for a single order,
75+ or a list of such dicts for several
7276 :return: List of Order instances that were added to the payment
7377 """
7478 if type (order_data ) is dict :
7579 order_data = [order_data ]
7680
7781 response = (
78- self .request (f"{ self .PAYMENTS_PATH } /{ payment_id } /orders" ).set_body ({"orders" : order_data }).post ()
82+ self .request (f"{ self .PAYMENTS_PATH } /{ payment_id } /orders" )
83+ .set_body ({"orders" : order_data })
84+ .post ()
7985 )
8086
8187 return [Order (o ) for o in response .json ]
@@ -86,12 +92,14 @@ def get_orders_for(self, payment_id) -> List[Order]:
8692
8793 def refund (self , payment_id : str , amount : int , full_refund : bool = False , ** params ) -> Payment :
8894 """
89- Refunds given payment of the given amount (in cents). If `full_refund` is `True`, `amount` is ignored
95+ Refunds given payment of the given amount (in cents).
96+ If `full_refund` is `True`, `amount` is ignored
9097 to trigger a full refund of the payment, including potential customer fees.
9198
9299 :param payment_id: ID of the payment to refund
93100 :param amount: Amount, in cents, to be refunded on the payment
94- :param full_refund: True if the full payment should be refunded (with customer fees). Default: false.
101+ :param full_refund: True if the full payment should be refunded (with customer fees).
102+ Default: false.
95103 :return: Updated payment object
96104 """
97105 req = self .request (f"{ self .PAYMENTS_PATH } /{ payment_id } /refund" )
@@ -109,8 +117,8 @@ def send_sms(self, payment_id: str):
109117 """
110118 Sends a payment link via SMS, to the customer's saved mobile phone number.
111119
112- Will raise RequestError if the SMS API is not activated on your account or in case of any other error,
113- otherwise returns True.
120+ Will raise RequestError if the SMS API is not activated on your account or
121+ in case of any other error, otherwise returns True.
114122 """
115123 self .request (f"{ self .PAYMENTS_PATH } /{ payment_id } /send-sms" ).post ()
116124
0 commit comments