Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2029 Weergaven

I've been trying to get Swedbank Pay to work. I've been looking at PayPal, Buckaroo and some other. I can not find the correct syntax for the prize in the web store.

        data = json.dumps({
            "payment": {
                "operation": "Purchase",
                "intent": "Authorization",
                "currency": tx.currency_id.name,
                "prices": [{
                    "type": "CreditCard",
                    "amount": int(tx.amount * 100),
                    "vatAmount": vatAmount,
                }
                ],
                "description": "Test Purchase",
                "userAgent": 'USERAGENT=%s' % request.httprequest.user_agent.string,
                "language": "sv-SE",
                "urls": {
                    "completeUrl": '%s/payment/swedbankpay/verify' % request.env['ir.config_parameter'].sudo().get_param('web.base.url'),
                    "cancelUrl": '%s/shop/payment' % request.env['ir.config_parameter'].sudo().get_param('web.base.url'),
                    # ~ "logoUrl":  '%s/logo500.png' % request.env['ir.config_parameter'].sudo().get_param('web.base.url'),
                },
                "payeeInfo": {
                    "payeeId": tx.acquirer_id.swedbankpay_merchant_id,
                    "payeeReference": tx.reference,
                    # ~ "payeeReference": tx.acquirer_id.swedbankpay_account_nr,
                    "swedbankpayKey": tx.acquirer_id.swedbankpay_key,
                    # ~ "payeeName": "xxxxx",
                    # ~ "productCategory": "xxxxx",
                    "orderReference": tx.reference,
                    # ~ "subsite": request.env['ir.config_parameter'].sudo().get_param('web.base.url'),
                }
            }
        })

* * * * * * * * * * * * * *

The result of above is:

66. data = json-dump = {"payment": {"operation": "Purchase", "intent": "Authorization", "currency": false, "prices": [{"type": "CreditCard", "amount": 0, "vatAmount": 0}], "description": "Test Purchase", "userAgent": "USERAGENT=Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0", "language": "sv-SE", "urls": {"completeUrl": "http://localhost:8069/payment/swedbankpay/verify", "cancelUrl": "http://localhost:8069/shop/payment"}, "payeeInfo": {"payeeId": false, "payeeReference": false, "swedbankpayKey": "example_swedbank_paykey_example", "orderReference": false}}}


* * * * * * * * *

Problem: Amount = 0, should be 11.000-something. (This is from the sample store. No lie data.)

Currency = false. Should be SEK.

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
3
jan. 25
5144
2
jun. 25
2355
2
jun. 25
6370
1
feb. 24
4184
0
nov. 23
1647