[英]How to include order information in Quickbooks' Hosted Paypage?
I'm using Quickbooks' Hosted Paypage and I have, up to this point, managed to get everything to work except for the order information. 我正在使用Quickbooks的托管付款页 , 到目前为止 ,我已经设法使除订单信息以外的所有内容都能正常工作。 I don't receive any errors. 我没有收到任何错误。 The paypage continues to work with or without the order-related code. 无论有无与订单相关的代码,支付页面均可继续工作。
I'm unsure exactly how to go about this and I can't find any relevant examples. 我不确定该怎么做,也找不到任何相关示例。 I assume that I'm formatting something incorrectly, but I have no idea what if I am. 我以为我格式化的格式不正确,但是我不知道该怎么办 。
Below is the relevant code. 以下是相关代码。 I took out the applogin and authticket, but those are correct. 我拿出了applogin和authticket,但这是正确的。
<?php
$order = '{"Items":[
{"ItemSku":"NA","ItemDesc":"Party Hats","ItemPrice":"1.00","ItemQty":"1","ItemIsShippable":"0","ItemIsTaxable":"0"},
{"ItemSku":"NA","ItemDesc":"Extra Guests","ItemPrice":"1.08","ItemQty":"1","ItemIsShippable":"0","ItemIsTaxable":"0"}],
"EstDeliveryDate": "01/01/2080"}';
// I've tried with and without this line
$order = json_decode($order, true);
/*---------------------------------------
Paypage
---------------------------------------*/
if ($NoErrors = true) {
// Intuit Base URL
$base_url = 'https://paymentservices.intuit.com/';
// Construct URL for Intuit ticket
$ticket = array(
'AuthModel' => 'desktop',
'AppLogin' => 'xxx.xxx.com',
'AuthTicket' => 'xxx-xxx-xxxx',
'TxnType' => 'Sale',
'Amount' => $Amount,
'CustomerName' => $CustomerFullName,
'CustomerStreet'=> $CustomerStreet,
'CustomerCity' => $CustomerCity,
'CustomerState' => $CustomerState,
'CustomerPostalCode'=> $CustomerPostalCode,
'IsCustomerFacing' => '1'
);
array_push($ticket, $order);
// Go to Intuit ticket URL
$ticket_url = $base_url . "paypage/ticket/create?" . http_build_query($ticket);
$print_ticket = file_get_contents($ticket_url);
Thank you for your time! 感谢您的时间!
After rereading the documentation, I found I missed 'Order=' from the URL. 重新阅读文档后,我发现我错过了URL中的“ Order =”。 I removed the json_decode line and then added "'Order' => $order" to the end of my $ticket array. 我删除了json_decode行,然后在$ ticket数组的末尾添加了“'Order'=> $ order”。 That got it working. 这样就可以了。
$ticket = array(
'AuthModel' => 'desktop',
'AppLogin' => 'xxxx',
'AuthTicket' => 'xxxx',
'TxnType' => 'Sale',
'Amount' => $Amount,
'CustomerName' => $CustomerFullName,
'CustomerStreet'=> $CustomerStreet,
'CustomerCity' => $CustomerCity,
'CustomerState' => $CustomerState,
'CustomerPostalCode'=> $CustomerPostalCode,
'IsCustomerFacing' => '1',
'Order' => $order
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.