def get_variant(self, order, typ, form): factory = payments.factory(typ) payment = factory.create_payment(currency=order.currency, total=order.total().gross) payment_variant = models.DjangoPaymentsVariant.objects \ .create(payment=payment, order=order, price=0) return payment_variant
def create_variant(self, order, form, typ=None): typ = typ or order.payment_type factory = payments.factory(typ) payment = factory.create_payment(currency=order.currency, total=order.total().gross) payment_variant = models.DjangoPaymentsVariant.objects.create( payment=payment, order=order, price=0) return payment_variant
def save(self, order, form, typ=None): typ = typ or order.payment_type factory = payments.factory(typ) payment = factory.create_payment(currency=order.currency, total=order.get_total().gross) payment_variant = self.payment_class.objects.create(payment=payment, order=order) return payment_variant
def save(self, order, form, typ=None): typ = typ or order.payment_type factory = payments.factory(typ) payment = factory.create_payment( currency=settings.SATCHLESS_DEFAULT_CURRENCY, total=order.get_total().gross) payment_variant = self.payment_class.objects.create(payment=payment, order=order) return payment_variant