Example #1
0
    def paypal_ipn(self) -> PayPalIPN or None:
        data = dict(
            txn_id=self.txn_id,
            buisness='square email',
            custom=self.custom,
            txn_type=self.TXN_TYPE,
            payment_gross=self.payment_gross,
            payment_status=self.payment_status,
            payment_type=self.payment_type,
            mc_currency=self.mc_currency,
            mc_fee=self.mc_fee,
            mc_gross=self.mc_gross,
            mc_handling=self.mc_handling,
            mc_shipping=self.mc_shipping,
            from_view='square',
        )

        ipn_form = PayPalIPNForm(
            data=data
        )

        if ipn_form.is_valid():
            ipn_form.clean()
            return ipn_form.save()