def create_payment_notification(self): # transactionType String: # AUTH_ONLY - orders that were authorized for a future charge # CHARGE - orders that were successfully charged # REFUND - orders that were refunded # CHARGEBACK - ordered that were charged back by the customer # CANCELLATION - orders that were cancelled (for unapproved orders and cancelled subscriptions) # RECURRING - subscription orders that were successfully charged # CANCELLATION_REFUND - orders that were refunded and cancelled (for cancelled subscriptions) # CONTRACT_CHANGE - subscription orders that had their contract switched data = self.data pn = PaymentNotification( site = Site.objects.get_current(), token = data['SilentPostPassword'], # referenceNumber Number Plimus Reference Number type = 'DalPay', status = CONFIRMED, payer_email = data['cust_email'], # email String Customer email address quantity = '1', # quantity Number Quantity ordered mc_gross = data['total_amount'], # contractPrice Number #,###.## Contract price item_name = data['item1_desc'], item_number = data['user2'], custom = data['user1'] , request_log = str(self.request), data=simplejson.dumps(data), ) #pn.confirm = (st == "CHARGE" or st == "RECURRING") and CONFIRMED or '%s: %s' % (FAILED, pn.status) pn.confirm = CONFIRMED if 'credits' in kwargs: pn.function = CREDITS else: pn.function = AUCTION pn.save() return pn
def create_payment_notification(self): # transactionType String: # AUTH_ONLY - orders that were authorized for a future charge # CHARGE - orders that were successfully charged # REFUND - orders that were refunded # CHARGEBACK - ordered that were charged back by the customer # CANCELLATION - orders that were cancelled (for unapproved orders and cancelled subscriptions) # RECURRING - subscription orders that were successfully charged # CANCELLATION_REFUND - orders that were refunded and cancelled (for cancelled subscriptions) # CONTRACT_CHANGE - subscription orders that had their contract switched data = self.data st = data['transactionType'] pn = PaymentNotification( token = data['referenceNumber'], # referenceNumber Number Plimus Reference Number type = 'Plimus', status = st, payer_email = data['email'], # email String Customer email address quantity = data['quantity'], # quantity Number Quantity ordered mc_gross = data['contractPrice'], # contractPrice Number #,###.## Contract price item_name = data['item_name'], item_number = data['item_number'], custom = data['member'], request_log = str(self.request), data = simplejson.dumps(data), ) pn.confirm = (st == "CHARGE" or st == "RECURRING") and CONFIRMED or '%s: %s' % (FAILED, pn.status) # contractId Number Plimus Contract Id if int(data['contractId']) in CreditPackage.objects.values_list('contract_id', flat=True): pn.function = CREDITS else: pn.function = AUCTION pn.save() return pn