删除克拉纳订单发票

时间:2018-07-24 07:15:19

标签: payment opencart2.x klarna

我想删除Klarna OpenCart 2.0 Modul上的Klarna发票。

添加订单的操作如下:

            $transaction = array(
                '4.1',
                'API:OPENCART:' . VERSION,
                $pno,
                $gender,
                '',
                '',
                (string)$order_info['order_id'],
                '',
                $address,
                $address,
                $order_info['ip'],
                0,
                $currency,
                $country,
                $language,
                (int)$klarna_invoice[$order_info['payment_iso_code_3']]['merchant'],
                $digest,
                $encoding,
                $pclass,
                $goods_list,
                $order_info['comment'],
                array('delay_adjust' => 1),
                array(),
                array(),
                array(),
                array(),
                array()
            );

            $xml  = '<methodCall>';
            $xml .= '  <methodName>add_invoice</methodName>';
            $xml .= '  <params>';

            foreach ($transaction as $parameter)  {
                $xml .= '    <param><value>' . $this->constructXmlrpc($parameter) . '</value></param>';
            }

            $xml .= '  </params>';
            $xml .= '</methodCall>';

            $header = array();

            $header[] = 'Content-Type: text/xml';
            $header[] = 'Content-Length: ' . strlen($xml);

            $curl = curl_init();

            curl_setopt($curl, CURLOPT_URL, $url);
            curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
            curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
            curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
            curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
            curl_setopt($curl, CURLOPT_POSTFIELDS, $xml);

            $response = curl_exec($curl);

Klarna支持无法帮助我,因为不支持OpenCart。 他们给我的唯一提示是使用带发票编号的delete_invoice函数。

我正在这样尝试:

                $xml  = '<methodCall>';
            $xml .= '  <methodName>delete_invoice</methodName>';
            $xml .= '  <params>';

                $xml .= '    <param><value>3458767058974000000</value></param>';

            $xml .= '  </params>';
            $xml .= '</methodCall>';

            $header = array();

            $header[] = 'Content-Type: text/xml';
            $header[] = 'Content-Length: ' . strlen($xml);

            $curl = curl_init();

            curl_setopt($curl, CURLOPT_URL, $url);
            curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
            curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
            curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
            curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
            curl_setopt($curl, CURLOPT_POSTFIELDS, $xml);

            $response = curl_exec($curl);

            curl_close($curl);

具有发票_删除和发票编号,但是不会删除发票。

有人有一个主意,为什么这不起作用?

问候

0 个答案:

没有答案