Skip to content

Commit

Permalink
Merge a06b416 into 9986fac
Browse files Browse the repository at this point in the history
  • Loading branch information
rayrayndwiga committed Oct 26, 2017
2 parents 9986fac + a06b416 commit 0005548
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 4 deletions.
6 changes: 4 additions & 2 deletions ledger/payments/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ class BpointTransactionAdmin(admin.ModelAdmin):
'processed',
'settlement_date',
'dvtoken',
'last_digits'
'last_digits',
'is_test'
)
list_display = ('txn_number','receipt_number','crn1','action','amount','approved')
list_display = ('created','settlement_date','txn_number','receipt_number','crn1','action','amount','approved','is_test')
search_fields = ('created','amount','crn1')

def has_delete_permission(self,*args,**kwargs):
return False
Expand Down
8 changes: 6 additions & 2 deletions ledger/payments/bpoint/facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ def _submit_info(self,order_number,reference,amount,action,_type,sub_type,bank_c
res.settlement_date,
res.txn_number,
res.dvtoken,
res.is_test_txn,
res.original_txn_number,
bankcard_lastdigits
)

def _create_txn(self,action,crn1,amount,amount_original,amount_surcharge,
type,cardtype,receipt_number,response_code,response_txt,processed,settlement_date,txn_number,dvtoken,bankcard_lastdigits=None):
type,cardtype,receipt_number,response_code,response_txt,processed,settlement_date,txn_number,dvtoken,is_test,original_transaction,bankcard_lastdigits=None):
'''
Store a Bpoint Transaction object whether the bpoint
transaction response was successful or not
Expand All @@ -110,6 +112,8 @@ def _create_txn(self,action,crn1,amount,amount_original,amount_surcharge,
settlement_date=settlement_date,
txn_number=txn_number,
dvtoken=dvtoken,
is_test=is_test,
original_txn=original_transaction,
last_digits = bankcard_lastdigits
)
except Exception as e:
Expand Down Expand Up @@ -176,7 +180,7 @@ def post_transaction(self, action,_type,sub_type,order_number=None,reference=Non
if (decimal.Decimal(total) > inv.balance) and action == 'payment':
raise ValidationError('The amount to be charged is more than the amount payable for this invoice.')

txn = self._submit_info(order_number,reference,total,action,_type,sub_type,bankcard,orig_txn_number,replay=replay)
txn = self._submit_info(order_number,reference,total,action,_type,sub_type,bankcard,orig_txn_number)
self.friendly_error_msg(txn)

return txn
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-10-26 07:35
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('bpoint', '0008_parkstay_rebase'),
]

operations = [
migrations.AddField(
model_name='bpointtransaction',
name='test_transaction',
field=models.BooleanField(default=False, help_text='Transaction is in test mode'),
),
]
20 changes: 20 additions & 0 deletions ledger/payments/bpoint/migrations/0010_auto_20171026_1540.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-10-26 07:40
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('bpoint', '0009_bpointtransaction_test_transaction'),
]

operations = [
migrations.RenameField(
model_name='bpointtransaction',
old_name='test_transaction',
new_name='is_test',
),
]
1 change: 1 addition & 0 deletions ledger/payments/bpoint/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class BpointTransaction(models.Model):
in the case where the action is a refund, reversal or capture')
dvtoken = models.CharField(max_length=128,null=True,blank=True,help_text='Stored card dv token')
last_digits = models.CharField(max_length=4,blank=True,null=True,help_text='Last four digits of card used during checkout')
is_test = models.BooleanField(default=False,help_text='Transaction is in test mode')

class Meta:
ordering = ('-created',)
Expand Down

0 comments on commit 0005548

Please sign in to comment.