@@ -50,6 +50,10 @@ def __init__(self, client, prefill = None):
5050 self ._device = None
5151 self ._external_fraud_tools = None
5252 self ._exemption_reason_3ds2 = None
53+ self ._sca_exemption_reason = None
54+ self ._challenge_indicator = None
55+ self ._incremental = None
56+ self ._tax = None
5357 if prefill != None :
5458 self .fill_with_data (prefill )
5559
@@ -602,6 +606,67 @@ def exemption_reason_3ds2(self, val):
602606 self ._exemption_reason_3ds2 = val
603607 return self
604608
609+ @property
610+ def sca_exemption_reason (self ):
611+ """Get sca_exemption_reason"""
612+ return self ._sca_exemption_reason
613+
614+ @sca_exemption_reason .setter
615+ def sca_exemption_reason (self , val ):
616+ """Set sca_exemption_reason
617+ Keyword argument:
618+ val -- New sca_exemption_reason value"""
619+ self ._sca_exemption_reason = val
620+ return self
621+
622+ @property
623+ def challenge_indicator (self ):
624+ """Get challenge_indicator"""
625+ return self ._challenge_indicator
626+
627+ @challenge_indicator .setter
628+ def challenge_indicator (self , val ):
629+ """Set challenge_indicator
630+ Keyword argument:
631+ val -- New challenge_indicator value"""
632+ self ._challenge_indicator = val
633+ return self
634+
635+ @property
636+ def incremental (self ):
637+ """Get incremental"""
638+ return self ._incremental
639+
640+ @incremental .setter
641+ def incremental (self , val ):
642+ """Set incremental
643+ Keyword argument:
644+ val -- New incremental value"""
645+ self ._incremental = val
646+ return self
647+
648+ @property
649+ def tax (self ):
650+ """Get tax"""
651+ return self ._tax
652+
653+ @tax .setter
654+ def tax (self , val ):
655+ """Set tax
656+ Keyword argument:
657+ val -- New tax value"""
658+ if val is None :
659+ self ._tax = val
660+ return self
661+
662+ if isinstance (val , dict ):
663+ obj = processout .InvoiceTax (self ._client )
664+ obj .fill_with_data (val )
665+ self ._tax = obj
666+ else :
667+ self ._tax = val
668+ return self
669+
605670
606671 def fill_with_data (self , data ):
607672 """Fill the current object with the new values pulled from data
@@ -677,6 +742,14 @@ def fill_with_data(self, data):
677742 self .external_fraud_tools = data ["external_fraud_tools" ]
678743 if "exemption_reason_3ds2" in data .keys ():
679744 self .exemption_reason_3ds2 = data ["exemption_reason_3ds2" ]
745+ if "sca_exemption_reason" in data .keys ():
746+ self .sca_exemption_reason = data ["sca_exemption_reason" ]
747+ if "challenge_indicator" in data .keys ():
748+ self .challenge_indicator = data ["challenge_indicator" ]
749+ if "incremental" in data .keys ():
750+ self .incremental = data ["incremental" ]
751+ if "tax" in data .keys ():
752+ self .tax = data ["tax" ]
680753
681754 return self
682755
@@ -717,8 +790,36 @@ def to_json(self):
717790 "device" : self .device ,
718791 "external_fraud_tools" : self .external_fraud_tools ,
719792 "exemption_reason_3ds2" : self .exemption_reason_3ds2 ,
793+ "sca_exemption_reason" : self .sca_exemption_reason ,
794+ "challenge_indicator" : self .challenge_indicator ,
795+ "incremental" : self .incremental ,
796+ "tax" : self .tax ,
797+ }
798+
799+ def increment authorization (self , amount , options = {}):
800+ """Create an incremental authorization
801+ Keyword argument:
802+ amount -- Amount to increment authorization by
803+ options -- Options for the request"""
804+ self .fill_with_data (options )
805+
806+ request = Request (self ._client )
807+ path = "/invoices/" + quote_plus (self .id ) + "/increment_authorization"
808+ data = {
809+ 'amount' : amount
720810 }
721811
812+ response = Response (request .post (path , data , options ))
813+ return_values = []
814+
815+ body = response .body
816+ body = body ["transaction" ]
817+ transaction = processout .Transaction (self ._client )
818+ return_values .append (transaction .fill_with_data (body ))
819+
820+
821+ return return_values [0 ]
822+
722823 def authorize (self , source , options = {}):
723824 """Authorize the invoice using the given source (customer or token)
724825 Keyword argument:
@@ -730,6 +831,7 @@ def authorize(self, source, options = {}):
730831 path = "/invoices/" + quote_plus (self .id ) + "/authorize"
731832 data = {
732833 'device' : self .device ,
834+ 'incremental' : self .incremental ,
733835 'synchronous' : options .get ("synchronous" ),
734836 'retry_drop_liability_shift' : options .get ("retry_drop_liability_shift" ),
735837 'capture_amount' : options .get ("capture_amount" ),
@@ -760,6 +862,7 @@ def capture(self, source, options = {}):
760862 path = "/invoices/" + quote_plus (self .id ) + "/capture"
761863 data = {
762864 'device' : self .device ,
865+ 'incremental' : self .incremental ,
763866 'authorize_only' : options .get ("authorize_only" ),
764867 'synchronous' : options .get ("synchronous" ),
765868 'retry_drop_liability_shift' : options .get ("retry_drop_liability_shift" ),
@@ -947,6 +1050,8 @@ def create(self, options = {}):
9471050 'metadata' : self .metadata ,
9481051 'details' : self .details ,
9491052 'exemption_reason_3ds2' : self .exemption_reason_3ds2 ,
1053+ 'sca_exemption_reason' : self .sca_exemption_reason ,
1054+ 'challenge_indicator' : self .challenge_indicator ,
9501055 'gateway_data' : self .gateway_data ,
9511056 'merchant_initiator_type' : self .merchant_initiator_type ,
9521057 'statement_descriptor' : self .statement_descriptor ,
@@ -961,7 +1066,8 @@ def create(self, options = {}):
9611066 'shipping' : self .shipping ,
9621067 'device' : self .device ,
9631068 'require_backend_capture' : self .require_backend_capture ,
964- 'external_fraud_tools' : self .external_fraud_tools
1069+ 'external_fraud_tools' : self .external_fraud_tools ,
1070+ 'tax' : self .tax
9651071 }
9661072
9671073 response = Response (request .post (path , data , options ))
0 commit comments