PaymentProcessor.record_payment() not updating OrderPayment or OrderPaymentAuthorization objects

18 views
Skip to first unread message

Marconius Cuthemustard

unread,
Aug 27, 2012, 5:07:07 PM8/27/12
to satchm...@googlegroups.com
re: PaymentProcessor.record_payment() not updating OrderPayment or OrderPaymentAuthorization objects

This happens when settings.CAPTURE is set to False, and I change an order's status to "shipped" in order to capture the authorizations. It's weird, because everything seems to work fine, but nothing changes. Even when I looked at the `satchmo.log` I find these two lines:

Mon, 27 Aug 2012 16:40:04 django.db.backends DEBUG    (0.000) UPDATE "shop_orderpayment" SET "payment" = 'PAYMENTSPRO', "amount" = '78.9200000000', "time_stamp" = '2012-08-27 16:40:04.887587', "transaction_id" = '1234567890ABCDEF', "details" = NULL, "reason_code" = 'None', "order_id" = 1000718 WHERE "shop_orderpayment"."id" = 179 ; args=(u'PAYMENTSPRO', u'78.9200000000', u'2012-08-27 16:40:04.887587', u'1234567890ABCDEF', u'None', 1000718, 179)

and

Mon, 27 Aug 2012 16:40:04 django.db.backends DEBUG    (0.001) UPDATE "shop_orderauthorization" SET "payment" = 'PAYMENTSPRO', "amount" = '78.9200000000', "time_stamp" = '2012-08-27 16:34:16.585738', "transaction_id" = 'FEDCBA0987654321', "details" = 'AVS code: X, CVV2 match: M', "reason_code" = 'na', "order_id" = 1000718, "capture_id" = 179, "complete" = true WHERE "shop_orderauthorization"."id" = 29 ; args=(u'PAYMENTSPRO', u'78.9200000000', u'2012-08-27 16:34:16.585738', u'FEDCBA0987654321', u'AVS code: X, CVV2 match: M', u'na', 1000718, 179, True, 29)

Both of which show very valid sql. But nothing actually changed in the db. The authorization was not marked as complete and the payment was not updated in any way. I even ran the sql manually it in the dbshell for fun and it worked.

Anyone have an idea what can cause this?

thanks,

Marco

Marconius Cuthemustard

unread,
May 28, 2013, 11:19:37 AM5/28/13
to satchm...@googlegroups.com
I am still stuck on this! Ah!!! I made a mistake in my first post: the method that I can't get to work properly is actually `myPaymentModule.PaymentProcessor.capture_authorized_payment`, which calls `record_payment` somewhere in `satchmo_shop.payment.modules.base`.

What kills me is that everything seems to work fine in the satcmo log and on the paypal sandbox site, but the payment is not at all changed when I look at the order in the admin or look it up the payment directly in the database.

Any reply to this post would be greatly appreciated ... even if it's just to cheer me up a little bit.

thanks,

Marconius Cuthemustard

unread,
May 31, 2013, 11:31:30 AM5/31/13
to satchm...@googlegroups.com
Update 1: This is not an issue with my module. The same thing happens when doing authorization captures through setting order to shipped in the dummy module.

Update 2: the db updates shown below do work, but I looked further in the log and I found a rollback-style update that sets the orderpayment object back to 'LINKED' and orderauthorization.complete back to False. Is this supposed to happen? I have DEBUG set to True in my project settings and LIVE is set to False in payment.config.



On Monday, 27 August 2012 17:07:07 UTC-4, Marconius Cuthemustard wrote:

Marconius Cuthemustard

unread,
Jun 6, 2013, 5:32:03 PM6/6/13
to satchm...@googlegroups.com
Anyone who wants to look into this further can visit pull request #62 and issue #1197.
Reply all
Reply to author
Forward
0 new messages