Changeset 16587


Ignore:
Timestamp:
31 Aug 2021, 06:28:35 (3 years ago)
Author:
Henrik Bettermann
Message:

Set constant item_code.

Location:
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/helpers.py

    r16556 r16587  
    237237# PAYDirect helper functions
    238238
    239 def create_paydirect_booking(merchant_id, payment, host, url, https):
     239def create_paydirect_booking(merchant_id, payment, item_code, host, url, https):
    240240    p_id = payment.p_id
    241241    description = payment.p_category
     
    276276    date_booked, date_expired,
    277277    firstname, lastname,
    278     email, p_id)
     278    email, item_code)
    279279    response=SOAP_post(
    280280        "http://interswitchng.com/bookonhold/CreateBooking",
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/paydirectbrowser.py

    r16555 r16587  
    106106    https = True
    107107
     108    @property
     109    def item_code(self):
     110        return '01' # for testing
     111
    108112    def init_update(self):
    109113        if self.context.p_state == 'paid':
     
    114118        # Create a PAYDirect Booking
    115119        result_xml = create_paydirect_booking(
    116             self.merchant_id, self.context, self.gateway_host,
     120            self.merchant_id, self.context, self.item_code, self.gateway_host,
    117121            self.gateway_url, True)
    118122        if result_xml.startswith('Connection error'):
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/tests.py

    r16528 r16587  
    238238        payment.p_id = 'p' + str(random.randint(10000000000, 90000000000))
    239239        payment.amount_auth = 1000.0
     240        item_code = '01'
    240241        self.student['payments'][payment.p_id] = payment
    241242        result_xml = create_paydirect_booking(
    242             MERCHANT_ID, payment, PAYDIRECT_HOST, PAYDIRECT_URL, True)
     243            MERCHANT_ID, payment, item_code, PAYDIRECT_HOST, PAYDIRECT_URL, True)
    243244        result_xml = get_SOAP_response_paydirect(
    244245            MERCHANT_ID, payment.p_id, PAYDIRECT_HOST, PAYDIRECT_URL, True)
     
    323324        self.assertEqual(payment.amount_auth, 310)
    324325        self.assertEqual(payment.net_amt, 10)
     326
     327        # Unfortunately the payment 60336214352306153 was done without surcharge.
     328        # Therefore we have to deduct 300 again in this test.
     329        payment.amount_auth = 10.0
     330
    325331        # Reference number has been saved
    326332        self.browser.getControl("Requery").click()
Note: See TracChangeset for help on using the changeset viewer.