-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathShippingCostRetrieveRequest.php
executable file
·51 lines (43 loc) · 1.42 KB
/
ShippingCostRetrieveRequest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* ShippingCostRetrieveRequest message processing.
*
* @copyright Copyright (c) 2011-2012, PayU
* @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
*/
include_once("sdk/openpayu.php");
include_once("config.php");
$xml = stripslashes($_POST['DOCUMENT']);
$result = OpenPayU_Order::consumeMessage($xml);
$cc = 'PL';
$rspId = '123123123';
if ($result->getMessage() == 'ShippingCostRetrieveRequest') {
$arr = array(
'CountryCode' => $cc,
'ShipToOtherCountry' => 'true',
'ShippingCostList' => array(
array(
'ShippingCost' => array(
'Type' => 'recalculated_courier_0',
'CountryCode' => $cc,
'Price' => array(
'Gross' => '1220', 'Net' => 220, 'Tax' => '22', "TaxRate" => 22, "CurrencyCode" => "PLN"
)
)
),
array(
'ShippingCost' => array(
'Type' => 'recalculated_courier_1',
'CountryCode' => $cc,
'Price' => array(
'Gross' => '2440', 'Net' => 440, 'Tax' => '22', "TaxRate" => 22, "CurrencyCode" => "PLN"
)
)
)
)
);
$xml = OpenPayU::buildShippingCostRetrieveResponse($arr, $rspId, $cc);
header("Content-type: text/xml");
echo $xml;
}
?>