From c7a30b523eec6ff42cc337f536e5559b3bd32360 Mon Sep 17 00:00:00 2001 From: Dan Safee Date: Thu, 22 Apr 2021 18:16:02 -0400 Subject: [PATCH 1/3] Add healthcare amount block to portico connector --- globalpayments/api/builders/__init__.py | 5 +++++ globalpayments/api/gateways/__init__.py | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/globalpayments/api/builders/__init__.py b/globalpayments/api/builders/__init__.py index 20c27bb..d7ff6a9 100644 --- a/globalpayments/api/builders/__init__.py +++ b/globalpayments/api/builders/__init__.py @@ -104,6 +104,7 @@ class AuthorizationBuilder(TransactionBuilder): schedule_id = None shipping_address = None timestamp = None + healthcare = None def with_address(self, address, address_type=AddressType.Billing): if not isinstance(address, Address): @@ -119,6 +120,10 @@ def with_alias(self, action, value): self.alias = value self.alias_action = action return self + + def with_healthcare_amount(self, value): + self.healthcare = value + return self def with_cash_back(self, value): self.cash_back_amount = value diff --git a/globalpayments/api/gateways/__init__.py b/globalpayments/api/gateways/__init__.py index 2282260..af5a14b 100644 --- a/globalpayments/api/gateways/__init__.py +++ b/globalpayments/api/gateways/__init__.py @@ -623,6 +623,12 @@ def process_authorization(self, builder): et.SubElement(block1, 'AllowPartialAuth').text = \ 'Y' if builder.allow_partial_auth else 'N' + if builder.healthcare is not None: + auto_substantiation = et.SubElement(block1, 'AutoSubstantiation') + first_addl_amt_info = et.SubElement(auto_substantiation, 'FirstAdditionalAmtInfo') + et.SubElement(first_addl_amt_info, 'AmtType').text = 'TOTAL_HEALTHCARE_AMT' + et.SubElement(first_addl_amt_info, 'Amt').text = builder.healthcare + if builder.amount is not None: et.SubElement(block1, 'Amt').text = str(builder.amount) From 11bd1818b31207737568371c8ffc2fd470c6a59b Mon Sep 17 00:00:00 2001 From: Dan Safee Date: Thu, 22 Apr 2021 18:18:41 -0400 Subject: [PATCH 2/3] Add documentation for FSA cards --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index d6020a9..c77bf6c 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,32 @@ except ApiException as e: // handle errors ``` +#### Process a Payment with Healthcare Amount Example + +This passes on to the issuing bank what part of the total payment amount was used for a healthcare purchase. This allows the use of FSA (Flex) cards. This is currently only supported with users of the Portico Gateway. + +```python +card = CreditCardData() +card.number = '4111111111111111' +card.exp_month = '12' +card.exp_year = '2025' +card.cvn = '123' +card.card_holder_name = 'Joe Smith' + +try: + response = card.charge(129.99) \ + .with_currency("EUR") \ + .with_healthcare_amount(100.00) + .execute() + + result = response.response_code # 00 == Success + message = response.response_message # [ test system ] AUTHORISED + +except ApiException as e: + // handle errors +``` + + #### Test Card Data Name | Number | Exp Month | Exp Year | CVN From 33b02d14f315fa6ddb36f481a6b167afeb888d01 Mon Sep 17 00:00:00 2001 From: Dan Safee Date: Thu, 22 Apr 2021 18:27:10 -0400 Subject: [PATCH 3/3] Fix missing trailing slash in documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c77bf6c..a272a90 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ card.card_holder_name = 'Joe Smith' try: response = card.charge(129.99) \ .with_currency("EUR") \ - .with_healthcare_amount(100.00) + .with_healthcare_amount(100.00) \ .execute() result = response.response_code # 00 == Success