php WhatsApp API: Identity error while trying to log in - php

I am using PHP WhatsApp Library. As per instructions I got my login and password. Upon using I am getting error:
] Logging in as 'SmartConnect Agent' (12334) tx  <stream:features></stream:features>
tx  <auth user="12334" mechanism="WAUTH-2"></auth>
rx  <from s.whatsapp.net=""></from>
rx  <stream:features></stream:features>
rx  <challenge>fafa1216bdf3c4c4528e10d80b29c6026493682d</challenge>
tx  <response>19d8120136e5897f38fe0904e54611cd8510f029bdd97f077f460faba15bc68cd0644e87ebf4b8288a143dc1914cb61bf4bfa2f17e0d7187afa8fcd18e69bb2b75d4f2da549c3d3c3facedd808bc</response>
rx  <failure>
rx    <not-authorized></not-authorized>
rx  </failure>
Upon running blockchecker.php I get. Even same thing when I am retying to register by using registerTool.php
Wrong identity.
Array
(
[cc] => 92
[in] => 1234566
[lg] => en
[lc] => PK
[id] => >zv?+?????w!l?v?5b?
[mistyped] => 6
[network_radio_type] => 1
[simnum] => 1
[s] =>
[copiedrc] => 1
[hasinrc] => 1
[rcmatch] => 1
[pid] => 579
[extexist] => 1
[extstate] => 1
)
stdClass Object
(
[status] => fail
[reason] => incorrect
[sms_length] => 6
[voice_length] => 6
[sms_wait] => 0
[voice_wait] => 0
)

It generated multiple IDentity file of a same number. I removed all and it generated new password.

Related

php array_diff not working on this compare

I have two arrays:
(
[lineCode] => C
[serviceRequest] => Ext, Warr auth.#19091100102 for $650.64 to be paid by c/card(fax#817-785-6700). Cust owes balance
[skillCode] => 90SB
[opCode] => 90SB
[jobType] => CUSTOMER
[techNo] =>
[lineStatus] => C
)
(
[id] => 755350
[rid] => 252178
[lineCode] => C
[serviceRequest] => Ext, Warr auth.#19091100102 for $650.64 to be paid by c/card(fax#817-785-6700). Cust owes balance
[skillCode] => 90SB
[opCode] => 90SB
[jobType] => CUSTOMER
[techNo] =>
[lineStatus] => W
[timeA] => 1575497139
[timeC] => 0
)
When i perform $diff = array_diff($arry1, $arry2);, it does not find the lineStatus to be different. Could it be because of service Request line with special characters? Although as a test, I set both lines to blanks, and it still did not see the difference.
Any help would be great. Stumped for the day.
UPDATE w/ MORE INFO
As this is part of a larger loop through mulitple arrays, the diff check before this one above is below:
$arry1= Array
(
[lineCode] => B
[serviceRequest] =>
[skillCode] => 15
[opCode] => 15
[jobType] => CUSTOMER
[techNo] => A05
[lineStatus] => C
)
$arry2= Array
(
[id] => 755362
[rid] => 252184
[lineCode] => B
[serviceRequest] =>
[skillCode] => 15
[opCode] => 15
[jobType] => CUSTOMER
[techNo] => A05
[lineStatus] => W
[timeA] => 1575504138
[timeC] => 0
)
$diff= Array
(
[lineStatus] => C
)
the code for the diff is $diff=array_diff($arry1,$arry2);
If it works correctly for this one, why would it not for the next.
Why does it not find it the way you originally did it...?
array_diff() does not care about key-value combinations, it only compares the values in the different arrays that are compared.
To better understand what's happening: if in your updated data you introduce an array element [dummy] => "C" into $arry2 you will no longer get [lineStatus] => "C" returned into $diff. As the value C is now found in both $arry1 and $arry2.
Have a look at this demo

How to access ' Json data in Laravel' [duplicate]

This question already has an answer here:
How to extract and access data from JSON with PHP?
(1 answer)
Closed 3 years ago.
I am getting the server response in json format to my laravel controller. In my controller decoding the json data and passing to my view. In laravel blade i am unable to access data.
When i am printing total decoded result it is some thing like below.
I tried to access this by $result->shipping_address , $result['shipping_address']. But none of them worked.
JSON RESULT is like below
[
{"data":
{ "entity_id":"77",
"state":"new",
"status":"pending",
"coupon_code":null,
"protect_code":"ab0fc2890c4c9cc93d7d4586e5dcd8ff",
"shipping_description":"Flat Rate - Fixed",
"is_virtual":"0",
"store_id":"1",
"customer_id":"2",
"base_discount_amount":"0.0000",
"base_discount_canceled":null,
"base_discount_invoiced":null,
"base_discount_refunded":null,
"base_grand_total":"2146.2300",
"base_shipping_amount":"5.0000",
"base_shipping_canceled":null,
"base_shipping_invoiced":null,
"base_shipping_refunded":null,
"base_shipping_tax_amount":"0.0000",
"base_shipping_tax_refunded":null,
"base_subtotal":"1846.6800",
"base_subtotal_canceled":null,
"base_subtotal_invoiced":null,
"base_subtotal_refunded":null,
"base_tax_amount":"294.5500",
"base_tax_canceled":null,
"base_tax_invoiced":null,
"base_tax_refunded":null,
"base_to_global_rate":"1.0000",
"base_to_order_rate":"1.0000",
"base_total_canceled":null,
"base_total_invoiced":null,
"base_total_invoiced_cost":null,
"base_total_offline_refunded":null,
"base_total_online_refunded":null,
"base_total_paid":null,
"base_total_qty_ordered":null,
"base_total_refunded":null,
"discount_amount":"0.0000",
"discount_canceled":null,
"discount_invoiced":null,
"discount_refunded":null,
"grand_total":"2146.2300",
"shipping_amount":"5.0000",
"shipping_canceled":null,
"shipping_invoiced":null,
"shipping_refunded":null,
"shipping_tax_amount":"0.0000",
"shipping_tax_refunded":null,
"store_to_base_rate":"0.0000",
"store_to_order_rate":"0.0000",
"subtotal":"1846.6800",
"subtotal_canceled":null,
"subtotal_invoiced":null,
"subtotal_refunded":null,
"tax_amount":"294.5500",
"tax_canceled":null,
"tax_invoiced":null,
"tax_refunded":null,
"total_canceled":null,
"total_invoiced":null,
"total_offline_refunded":null,
"total_online_refunded":null,
"total_paid":null,
"total_qty_ordered":"1.0000",
"total_refunded":null,
"can_ship_partially":null,
"can_ship_partially_item":null,
"customer_is_guest":"0",
"customer_note_notify":"1",
"billing_address_id":"76",
"customer_group_id":"1",
"edit_increment":null,
"email_sent":null,
"send_email":"1",
"forced_shipment_with_invoice":null,
"payment_auth_expiration":null,
"quote_address_id":null,
"quote_id":"72",
"shipping_address_id":"75",
"adjustment_negative":null,
"adjustment_positive":null,
"base_adjustment_negative":null,
"base_adjustment_positive":null,
"base_shipping_discount_amount":"0.0000",
"base_subtotal_incl_tax":"2141.2300",
"base_total_due":"2146.2300",
"payment_authorization_amount":null,
"shipping_discount_amount":"0.0000",
"subtotal_incl_tax":"2141.2300",
"total_due":"2146.2300",
"weight":"0.0000",
"customer_dob":null,
"increment_id":"000000157",
"applied_rule_ids":null,
"base_currency_code":"INR",
"customer_email":"test#gmail.com",
"customer_firstname":"ridha",
"customer_lastname":"Gatto",
"customer_middlename":null,
"customer_prefix":null,
"customer_suffix":null,
"customer_taxvat":null,
"discount_description":null,
"ext_customer_id":null,
"ext_order_id":null,
"global_currency_code":"INR",
"hold_before_state":null,
"hold_before_status":null,
"order_currency_code":"INR",
"original_increment_id":null,
"relation_child_id":null,
"relation_child_real_id":null,
"relation_parent_id":null,
"relation_parent_real_id":null,
"remote_ip":"193.33.131.226",
"shipping_method":"flatrate_flatrate",
"store_currency_code":"INR",
"store_name":"Main Website\nMain Website Store\n",
"x_forwarded_for":null,
"customer_note":null,
"created_at":"2018-11-28 06:01:59",
"updated_at":"2018-11-28 06:02:09",
"total_item_count":"1",
"customer_gender":"0",
"discount_tax_compensation_amount":"0.0000",
"base_discount_tax_compensation_amount":"0.0000",
"shipping_discount_tax_compensation_amount":"0.0000",
"base_shipping_discount_tax_compensation_amnt":"0.0000",
"discount_tax_compensation_invoiced":null,
"base_discount_tax_compensation_invoiced":null,
"discount_tax_compensation_refunded":null,
"base_discount_tax_compensation_refunded":null,
"shipping_incl_tax":"5.0000",
"base_shipping_incl_tax":"5.0000",
"coupon_rule_name":null,
"gift_message_id":null,
"paypal_ipn_customer_notified":"0",
"vendor_order_id":"VN100028",
"extension_attributes":{
},
"items":{"50":
{
}
}
}
},
{ "shipping_address":
{
"entity_id":"75",
"parent_id":"77",
"customer_address_id":null,
"quote_address_id":"250",
"region_id":"564",
"customer_id":null,
"fax":null,
"region":"chennai",
"postcode":"700089",
"lastname":"Gatto",
"street":"srinaarat",
"city":"chennai",
"email":"test#gmail.com",
"telephone":"9876543210",
"country_id":"IN",
"firstname":"hgd",
"address_type":"shipping",
"prefix":"address_","middlename":null,
"suffix":null,
"company":"sd",
"vat_id":null,
"vat_is_valid":null,
"vat_request_id":null,
"vat_request_date":null,
"vat_request_success":null
}
},
{ "billing_address":
{
"entity_id":"76",
"parent_id":"77",
"customer_address_id":"1",
"quote_address_id":"251",
"region_id":"564",
"customer_id":null,
"fax":null,
"region":"chennai",
"postcode":"700034",
"lastname":"Gatt0",
"street":"srinagar",
"city":"chennai",
"email":"text#gmail.com",
"telephone":"9848352205",
"country_id":"IN",
"firstname":"ridha",
"address_type":"billing",
"prefix":null,
"middlename":null,
"suffix":null,
"company":"ridha",
"vat_id":null,
"vat_is_valid":null,
"vat_request_id":null,
"vat_request_date":null,
"vat_request_success":null
}
},
{ "vendor":
{
"entity_id":"1",
"entity_type_id":"9",
"attribute_set_id":"0",
"increment_id":"000000009",
"parent_id":"0",
"created_at":"2018-10-01 11:09:32",
"updated_at":"2018-11-27 12:55:57",
"is_active":"1",
"website_id":"1",
"address":"chennai",
"city":"chennai",
"zip_code":"700087",
"customer_id":"1",
"shop_url":"cf97wksk",
"status":"approved",
"group":"general",
"public_name":"cf97wksk",
"name":"test",
"email":"test#gmail.com",
"contact_number":"9876543210",
"country_id":"IN",
"vendor_gstin":"11PGTAU12346Q",
"gender":"1",
"region_id":"564"
}
},
{ "items":
{"item_id":"50",
"order_id":"77",
"parent_item_id":null,
"quote_item_id":"208",
"store_id":"1",
"created_at":"2018-11-28 06:02:09",
"updated_at":"2018-11-28 06:02:09",
"product_id":"14",
"product_type":"simple",
"product_options":
{
"info_buyRequest":
{"uenc":"aHR0cDovLzE1OS44OS4xNjQuMTM5L2IyYi9idXkxLWtsbS1mYXNoaW9uLW1hbGwtd29tZW4tcy1mYW5jeS1jb3R0b24tc2lsay1zYXJlZS1yZWQteWVsbG93LXNrdS1zcmlwbC0yODU0Lmh0bWw,","product":"14","selected_configurable_option":"","related_product":"","qty":"1"},
"additional_options":[{"code":"vendor_name","label":"Vendor","value":"cf97wksk"}]},
"weight":null,
"is_virtual":"0",
"sku":"DKSR0000001-1",
"name":"KLM Fashion Mall Women's Fancy Cotton Silk Saree ( RED & YELLOW )",
"description":null,
"applied_rule_ids":null,
"additional_data":null,
"is_qty_decimal":"0",
"no_discount":"0",
"qty_backordered":null,
"qty_canceled":"0.0000",
"qty_invoiced":"0.0000",
"qty_ordered":"1.0000",
"qty_refunded":"0.0000",
"qty_shipped":"0.0000",
"base_cost":null,
"price":"1846.6800",
"base_price":"1846.6800",
"original_price":"1846.6800",
"base_original_price":"1846.6800",
"tax_percent":"5.0000",
"tax_amount":"294.5500",
"base_tax_amount":"294.5500",
"tax_invoiced":"0.0000",
"base_tax_invoiced":"0.0000",
"discount_percent":"0.0000",
"discount_amount":"0.0000",
"base_discount_amount":"0.0000",
"discount_invoiced":"0.0000",
"base_discount_invoiced":"0.0000",
"amount_refunded":"0.0000",
"base_amount_refunded":"0.0000",
"row_total":"1846.6800",
"base_row_total":"1846.6800",
"row_invoiced":"0.0000",
"base_row_invoiced":"0.0000",
"row_weight":"0.0000",
"base_tax_before_discount":null,
"tax_before_discount":null,
"ext_order_item_id":null,
"locked_do_invoice":null,
"locked_do_ship":null,
"price_incl_tax":"2141.2300",
"base_price_incl_tax":"2141.2300",
"row_total_incl_tax":"2141.2300",
"base_row_total_incl_tax":"2141.2300",
"discount_tax_compensation_amount":"0.0000",
"base_discount_tax_compensation_amount":"0.0000",
"discount_tax_compensation_invoiced":null,
"base_discount_tax_compensation_invoiced":null,
"discount_tax_compensation_refunded":null,
"base_discount_tax_compensation_refunded":null,
"tax_canceled":null,
"discount_tax_compensation_canceled":null,
"tax_refunded":null,
"base_tax_refunded":null,
"discount_refunded":null,
"base_discount_refunded":null,
"free_shipping":"0",
"gift_message_id":null,
"gift_message_available":"0",
"weee_tax_applied":null,
"weee_tax_applied_amount":null,
"weee_tax_applied_row_amount":null,
"weee_tax_disposition":null,
"weee_tax_row_disposition":null,
"base_weee_tax_applied_amount":null,
"base_weee_tax_applied_row_amnt":null,
"base_weee_tax_disposition":null,
"base_weee_tax_row_disposition":null,
"vendor_id":"1",
"seller_price":"1679",
"hsn":"5007",
"seller_item_total":"1678.80",
"vendor_tax":"83.94",
"vendor_row_total":"1762.74",
"cess_rate":"0.00",
"product":{},
"thumbnail":"\/1\/5\/1538546849_sku-sripl-2854_1.png",
}
}
]
Array
(
[shipping_address] => Array
(
[entity_id] => 1
[parent_id] => 4
[customer_address_id] => 1
[quote_address_id] => 4
[region_id] => 564
[customer_id] =>
[fax] =>
[region] => Telangana
[postcode] => 500049
[lastname] => Latname
[street] => Road No 23
Deepthisree Nagar Madinaguda
[city] => India
[email] => asarush#xmial.com
[telephone] => 9999999999
[country_id] => IN
[firstname] => Aakshay
[address_type] => shipping
[prefix] =>
[middlename] =>
[suffix] =>
[company] => Aarush
[vat_id] =>
[vat_is_valid] =>
[vat_request_id] =>
[vat_request_date] =>
[vat_request_success] =>
)
)
Array
(
[billing_address] => Array
(
[entity_id] => 2
[parent_id] => 4
[customer_address_id] => 1
[quote_address_id] => 10
[region_id] => 564
[customer_id] =>
[fax] =>
[region] => Telangana
[postcode] => 500076
[lastname] => Gupta
[street] => Road No 23
Golkonda
[city] => Hyderabad
[email] => fradnsss#gmail.com
[telephone] => 9999999999
[country_id] => IN
[firstname] => Firsthan
[address_type] => billing
[prefix] =>
[middlename] =>
[suffix] =>
[company] => Firstname
[vat_id] =>
[vat_is_valid] =>
[vat_request_id] =>
[vat_request_date] =>
[vat_request_success] =>
)
)
Array
(
[vendor] => Array
(
[entity_id] => 1
[entity_type_id] => 9
[attribute_set_id] => 0
[increment_id] => 000000009
[parent_id] => 0
[created_at] => 2018-10-01 11:09:32
[updated_at] => 2018-11-27 12:55:57
[is_active] => 1
[website_id] => 1
[address] => hyyderabad
[city] => hyderabad
[zip_code] => 500055
[customer_id] => 1
[shop_url] => cf97wksk
[status] => approved
[group] => general
[public_name] => cf97wksk
[name] => Firstname Lastname
[email] => testemail#gmail.com
[contact_number] => 9999999999
[country_id] => IN
[vendor_gstin] => 11PGTAU12346Q
[gender] => 1
[region_id] => 564
)
)
In my controller sending the data to view as follows:
$result = json_decode($result_json,true);
return view('orders.view',compact('result'));
I need to display shipping address and billing address in my view blade. How can i do that.
I expect the out put like below
Shipping Address
Firstname Lastname
Hyderabad
Pin Code : 500072
Contact Number : 999888777
In your controller
return view('view-name', [
'shipping_address' => $shipping_address
// ...
]);
In your view-name.blade.php file:
<input id="shipping_address" type="hidden" value="#json($shipping_address)">
In a Javascript file:
let shipping_address= $('#shipping_address').val();
console.log(shipping_address)
See console log in browser debug and you can do anything.
you cannot use $result->shipping_address because as per your output that is array.
Try below one.
echo $result[1]['shipping_address']['firstname'] . ' ' . $result[1]['shipping_address']['lastname'] . ' ' . $result[1]['shipping_address']['city'] . 'Pin code: ' . $result[1]['shipping_address']['postcode'] . ' ' . 'Contact Number : ' . $result[1]['shipping_address']['telephone'];
or
{{$result[1]['shipping_address']['firstname']}} {{$result[1]['shipping_address']['lastname']}} {{$result[1]['shipping_address']['city']}} Pin code: {{$result[1]['shipping_address']['postcode']}} Contact Number : {{$result[1]['shipping_address']['telephone']}}
I have just provided option to print value, you may required some validation for variables.
Thank you.

Post array incomplete when receiving a post

I'm on a Drupal7 site, and I'm not used to Drupal. When I edit a node (standard page), and try to save it, the menu disappears. Not all node's are like this, only the ones that uses a field group of heatmaps, probably a custom field group (legacy).
System specs are:
CentOS 6.6
Apache 2.2
Mysql 5.5
Php 7
At first, I thought it was a bug in Drupal 7, and I tried solutions as Menu items disappearing in Drupal 7. But the suggested solutions didn't work. So I started to suspect post_max_size or memory_limit, because the form with the custom field grows very large when it uses the field or the field group. So I've maxed the memory settings and it looks good but is still not working.
The field group array tends to be very large and I tried to find some info about nestling level too big in a post but found no hints.
The post size is:
post_max_size in bytes = 536870912
post CONTENT_LENGTH = 1020347
The field group contains Heatmaps with Geolocations and endless of data:
[field_heatmap_data] => Array
(
[und] => Array
(
[0] => Array
(
[tablefield] => Array
(
[cell_0_0] => X
[cell_0_1] => Y
[cell_0_2] => Plastic
[cell_0_3] => Paper
[cell_0_4] => Glass
[cell_0_5] => Metal
[cell_0_6] => Organiskt
[cell_0_7] =>
[cell_0_8] =>
[cell_0_9] => Other
[cell_1_0] => 14.1741233638
[cell_1_1] => 57.7797089972
[cell_1_2] => 0
[cell_1_3] => 0
[cell_1_4] =>
[cell_1_5] =>
[cell_1_6] =>
[cell_1_7] => 1
[cell_1_8] =>
[cell_1_9] => 2
[cell_2_0] => 14.1784435935
[cell_2_1] => 57.7797106709
[cell_2_2] => 0
[cell_2_3] => 0
[cell_2_4] =>
[cell_2_5] =>
[cell_2_6] =>
[cell_2_7] =>
[cell_2_8] =>
[cell_2_9] =>
[cell_3_0] => 14.1656472109
[cell_3_1] => 57.7831198751
[cell_3_2] => 1
[cell_3_3] => 2
[cell_3_4] => 1
[cell_3_5] => 1
[cell_3_6] =>
[cell_3_7] =>
[cell_3_8] =>
[cell_3_9] =>
[cell_4_0] => 14.1753179083
[cell_4_1] => 57.7826699822
[cell_4_2] => 0
[cell_4_3] => 5
[cell_4_4] =>
[cell_4_5] => 3
[cell_4_6] =>
[cell_4_7] => 9
[cell_4_8] => 4
[cell_4_9] =>
[cell_5_0] => 14.1602465906
[cell_5_1] => 57.7824661754
[cell_5_2] => 2
[cell_5_3] => 0
[cell_5_4] => 1
[cell_5_5] =>
[cell_5_6] =>
[cell_5_7] => 4
[cell_5_8] =>
[cell_5_9] => 1
[cell_6_0] => 14.1552312791
[cell_6_1] => 57.7788985858
[cell_6_2] => 0
[cell_6_3] => 1
[cell_6_4] =>
[cell_6_5] => 1
[cell_6_6] =>
[cell_6_7] => 4
[cell_6_8] =>
[cell_6_9] =>
[cell_7_0] => 14.1631063952
[cell_7_1] => 57.7813178687
[cell_7_2] => 1
[cell_7_3] => 0
[cell_7_4] =>
[cell_7_5] =>
[cell_7_6] =>
[cell_7_7] => 2
[cell_7_8] => 3
[cell_7_9] =>
[cell_8_0] => 14.1742044644
[cell_8_1] => 57.7827544419
[cell_8_2] => 0
[cell_8_3] => 0
[cell_8_4] =>
[cell_8_5] =>
[cell_8_6] =>
[cell_8_7] => 4
[cell_8_8] => 1
[cell_8_9] =>
[cell_9_0] => 14.157952438
[cell_9_1] => 57.7818974962
[cell_9_2] => 2
[cell_9_3] => 4
[cell_9_4] => 5
[cell_9_5] => 1
[cell_9_6] =>
[cell_9_7] => 8
[cell_9_8] => 2
[cell_9_9] =>
[cell_10_0] => 14.1706946744
[cell_10_1] => 57.7815507326
[cell_10_2] => 0
[cell_10_3] => 0
[cell_10_4] =>
And so on....
So I've figured out that there is a flaw in the architecture of the node because it cant clearly not handle that much data in a field group and should been handled as an separate node, but since this is a legacy project I don't want to mess things up.
If I var_dump the $_POST variable on different pages when editing, I can clearly see that the $_POST variable stops after the $_POST['field_heatmap'] element where there is data, while the pages that doesn't contain data in that field group the $_POST array continues after the $_POST['field_heatmap'] element.
So my question is, should I continue to try to find a bug in Drupal or should I investigate further some php settings (Or maybe apache). I've tried debugging with cachegrind but can't find any unusual. Or any hints are greatly appreciated!
Finally! The max_input_vars was set to 1000
Changed it to max_input_vars = 10000 and it worked!

PayPal Order Summary is empty

I use Express Checkout API (Name-Value Pair) to do the PayPal checkout. The problem is the login screen doesn't show Order Summary. I tried to set the below params like this post but it still shows empty info.
$options["PAYMENTREQUEST_0_DESC"] = "hieutot";
$options["PAYMENTREQUEST_0_ITEMAMT"] = "123";
$options["PAYMENTREQUEST_0_AMT"] = 300;
$options["PAYMENTREQUEST_0_PAYMENTACTION"] = "Sale";
$options["L_PAYMENTREQUEST_0_NAME0"] = "zzz";
$options["L_PAYMENTREQUEST_0_QTY0"] = 1;
$options["L_PAYMENTREQUEST_0_AMT0"] = 1000.00;
$options["L_PAYMENTREQUEST_0_NAME1"] = "test";
$options["L_PAYMENTREQUEST_0_QTY1"] = 1;
$options["L_PAYMENTREQUEST_0_AMT1"] = 200.00;
But when I tried to generate 10486 transaction error. The order summary appears! What a strange problem! How to fix it? Could it be a PayPal API bug? I'm using Zend Cart 1.3.8.
This is the request and response using cURL
REQUEST
Array
(
[ITEMAMT] => 0.00
[LOCALECODE] => US
[PAYMENTACTION] => Sale
[EMAIL] => sorryICannotShowThis#gmail.com
[PHONENUM] => xxxxxxxx
[SOLUTIONTYPE] => SOLE
[PAYMENTREQUEST_0_DESC] => hieutot
[PAYMENTREQUEST_0_ITEMAMT] => 123
[PAYMENTREQUEST_0_AMT] => 300
[PAYMENTREQUEST_0_PAYMENTACTION] => Sale
[L_PAYMENTREQUEST_0_NAME0] => zzz
[L_PAYMENTREQUEST_0_QTY0] => 1
[L_PAYMENTREQUEST_0_AMT0] => 1000
[L_PAYMENTREQUEST_0_NAME1] => test
[L_PAYMENTREQUEST_0_QTY1] => 1
[L_PAYMENTREQUEST_0_AMT1] => 200
[AMT] => 3,700.00
[RETURNURL] => https%3A%2F%2Flocalhost%2Fipn_main_handler.php%3Ftype%3Dec
[CANCELURL] => https%3A%2F%2Flocalhost%2Findex.php%3Fmain_page%3Dshopping_cart%26amp%3Bec_cancel%3D1
[PAGESTYLE] => Primary
[METHOD] => SetExpressCheckout
[CURRENCYCODE] => JPY
)
RESPONSE
Array
(
[TOKEN] => sorryICannotShowThis
[TIMESTAMP] => 2013%2d11%2d21T08%3a37%3a09Z
[CORRELATIONID] => 35adcd4bd76d5
[ACK] => Success
[VERSION] => 3%2e2
[BUILD] => 8549850
[CURL_ERRORS] =>
)
Please double check the VERSION used in your API requests:
[VERSION] => 3%2e2
I'd suggest to use any version above 63.0 (which can support Line item)
See: https://developer.paypal.com/webapps/developer/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/
"This field is introduced in version 53.0. L_NAMEn is deprecated since version 63.0. Use L_PAYMENTREQUEST_0_NAMEm instead."

Extract item from an array

I want to be able to extract the output of [HostName] from this array in PHP. Thank you!
Array
(
[Protocol] => 17
[HostName] => [HG] JAILBREAK #1 - HeLLsGamers.com | 30+ LR's | FastDL
[Map] => ba_jail_hellsgamers_fx6
[ModDir] => cstrike
[ModDesc] => Counter-Strike: Source
[AppID] => 240
[Players] => 12
[MaxPlayers] => 64
[Bots] => 0
[Dedicated] => d
[Os] => l
[Password] =>
[Secure] => 1
[Version] => 1.0.0.75
[GamePort] => 27015
[ServerID] => -682722125
[GameTags] => HLstatsX:CE,alltalk,bunnyhopping,cool,drugs,free,gameme,gang,hellsgamers,hg,increased_maxplayers,jail,jailbr,nostats,startmoney
)
Like this:
echo $Array[HostName]; // output: [HG] JAILBREAK #1 - HeLLsGamers.com | 30+ LR's | FastDL
where $Array is the array you printed and copied here.
I recommend you start reading stuff from php.net - as this is the most basic thing you can do.
Thats the most simplest question .........
Just use this
echo $Your_array[HostName];

Categories