@@ -55,6 +55,7 @@ def __init__(self, client, prefill=None):
5555 self ._challenge_indicator = None
5656 self ._incremental = None
5757 self ._tax = None
58+ self ._payment_type = None
5859 if prefill is not None :
5960 self .fill_with_data (prefill )
6061
@@ -667,6 +668,19 @@ def tax(self, val):
667668 self ._tax = val
668669 return self
669670
671+ @property
672+ def payment_type (self ):
673+ """Get payment_type"""
674+ return self ._payment_type
675+
676+ @payment_type .setter
677+ def payment_type (self , val ):
678+ """Set payment_type
679+ Keyword argument:
680+ val -- New payment_type value"""
681+ self ._payment_type = val
682+ return self
683+
670684 def fill_with_data (self , data ):
671685 """Fill the current object with the new values pulled from data
672686 Keyword argument:
@@ -749,6 +763,8 @@ def fill_with_data(self, data):
749763 self .incremental = data ["incremental" ]
750764 if "tax" in data .keys ():
751765 self .tax = data ["tax" ]
766+ if "payment_type" in data .keys ():
767+ self .payment_type = data ["payment_type" ]
752768
753769 return self
754770
@@ -793,6 +809,7 @@ def to_json(self):
793809 "challenge_indicator" : self .challenge_indicator ,
794810 "incremental" : self .incremental ,
795811 "tax" : self .tax ,
812+ "payment_type" : self .payment_type ,
796813 }
797814
798815 def increment_authorization (self , amount , options = {}):
@@ -805,6 +822,7 @@ def increment_authorization(self, amount, options={}):
805822 request = Request (self ._client )
806823 path = "/invoices/" + quote_plus (self .id ) + "/increment_authorization"
807824 data = {
825+ 'metadata' : options .get ("metadata" ),
808826 'amount' : amount
809827 }
810828
@@ -835,6 +853,7 @@ def authorize(self, source, options={}):
835853 'capture_amount' : options .get ("capture_amount" ),
836854 'enable_three_d_s_2' : options .get ("enable_three_d_s_2" ),
837855 'auto_capture_at' : options .get ("auto_capture_at" ),
856+ 'metadata' : options .get ("metadata" ),
838857 'source' : source }
839858
840859 response = Response (request .post (path , data , options ))
@@ -865,6 +884,7 @@ def capture(self, source, options={}):
865884 'capture_amount' : options .get ("capture_amount" ),
866885 'auto_capture_at' : options .get ("auto_capture_at" ),
867886 'enable_three_d_s_2' : options .get ("enable_three_d_s_2" ),
887+ 'metadata' : options .get ("metadata" ),
868888 'source' : source }
869889
870890 response = Response (request .post (path , data , options ))
@@ -980,7 +1000,7 @@ def void(self, options={}):
9801000 request = Request (self ._client )
9811001 path = "/invoices/" + quote_plus (self .id ) + "/void"
9821002 data = {
983-
1003+ 'metadata' : options . get ( "metadata" )
9841004 }
9851005
9861006 response = Response (request .post (path , data , options ))
@@ -1054,7 +1074,8 @@ def create(self, options={}):
10541074 'device' : self .device ,
10551075 'require_backend_capture' : self .require_backend_capture ,
10561076 'external_fraud_tools' : self .external_fraud_tools ,
1057- 'tax' : self .tax
1077+ 'tax' : self .tax ,
1078+ 'payment_type' : self .payment_type
10581079 }
10591080
10601081 response = Response (request .post (path , data , options ))
0 commit comments