paypal PDT missing variables - paypal-pdt

I have an issue with PDT.
after payment, when the page returns to the merchant, from paypal, I do the request with the pdt token to get the info on the transaction.
Normally I get these parameters from paypal, in the case of a recurring sale:
[transaction_subject] => paypal product
[payment_date] => 19:53:02 Jul 12, 2018 PDT
[txn_type] => subscr_payment
[subscr_id] => I-XXXXXX
[last_name] => test
[residence_country] => CO
[item_name] => paypal product
[payment_gross] => 25.00
[mc_currency] => USD
[business] => vendor_email
[payment_type] => instant
[protection_eligibility] => Ineligible
[payer_status] => unverified
[payer_email] => buyer_email
[txn_id] => XXXXXXXXXXX
[receiver_email] => vendor_email
[first_name] => test
[payer_id] => XXXXXXXX
[receiver_id] => XXXXXXXX
[contact_phone] => 55555555
[item_number] => 1234
[payment_status] => Completed
[payment_fee] => 1.64
[mc_fee] => 1.64
[mc_gross] => 25.00
[custom] => 4321
[charset] => windows-1252
[] =>
but in some of the transactions the response from paypal lacks these 4 items:
subscr_id
item_name
item_number
custom
Any idea why they are missing? the purchases are identical, the only thing different is the buyer.
Thanks

in the end, paypal guys said it is a bug from their end. They are trying to fix it in a not foreseeable future :)

Related

How get get data "orderBy" months but start with Current month and so on

Trying to get data by months and for the first part, it's working perfectly and is now stuck at 2 points.
Required Month Name with Year ( Say "March 2022" )
Required the same in OrderBy where it should start with the current month (March 2022) and then further (April 2022, May 2022, June 2022 .... Jan 2022, Feb 2022)
My Controller
$getdatapermonth = Dairyincome::select(
DB::raw('(MONTHNAME(date)) as "month_name",SUM(cmilkquantity) as "cmilkquantity", SUM(cmilkamount) as "cmilkamount",SUM(bmilkquantity) as "bmilkquantity", SUM(bmilkamount) as "bmilkamount", SUM(totalamount) as "totalamount"')
)
->where('customerid',$customerid)
->whereYear('date', date('Y'))
->groupBy('month_name')
->get()->toArray();
Array I am getting
array:3 [▼
0 => array:6 [▼
"month_name" => "January"
"cmilkquantity" => "0.00"
"cmilkamount" => "0.00"
"bmilkquantity" => "10.00"
"bmilkamount" => "450.00"
"totalamount" => "450.00"
]
1 => array:6 [▼
"month_name" => "February"
"cmilkquantity" => "2.00"
"cmilkamount" => "70.00"
"bmilkquantity" => "0.00"
"bmilkamount" => "0.00"
"totalamount" => "70.00"
]
2 => array:6 [▼
"month_name" => "March"
"cmilkquantity" => "2.00"
"cmilkamount" => "70.00"
"bmilkquantity" => "2.00"
"bmilkamount" => "70.00"
"totalamount" => "140.00"
]
]
Thanks in Advance.
Just change:
DB::raw('(MONTHNAME(date)) as "month_name"')
to:
DB::raw('DATE_FORMAT(date, "%M %Y") as "month_name"')
It will output month name in "Month YYYY" format.

Google Birthday Calendar Wrong Year

I am having issue when i am getting google birthday calendar. I am getting wrong year in google birthday calendar.
Ex:
In my google contacts i am having contact name - Deepak whose birthday - 19/04/1990. So this contact birthday showing in the google birthday calendar. When i am fetching google birthday calendar i am getting date like 2017-04-19, 2018-04-19, 2019-04-19. How can i get contact exact birthday with year from google birthday calendar?
Response From Google Calendar API
[0] => Array
(
[kind] => calendar#event
[etag] => "3060534890000000"
[id] => 2017_BIRTHDAY_4a7a6b868dd53910
[status] => confirmed
[htmlLink] => https://www.google.com/calendar/event?eid=MjAxN19CSVJUSERBWV80YTdhNmI4NjhkZDUzOTEwICNjb250YWN0c0B2
[created] => 2018-06-29T10:17:25.000Z
[updated] => 2018-06-29T10:17:25.000Z
[summary] => Deepak's birthday
[description] => This is Deepak's birthday!
[creator] => Array
(
[email] => #contacts#group.v.calendar.google.com
[displayName] => Contacts
[self] => 1
)
[organizer] => Array
(
[email] => #contacts#group.v.calendar.google.com
[displayName] => Contacts
[self] => 1
)
[start] => Array
(
[date] => 2017-06-30
)
[end] => Array
(
[date] => 2017-07-01
)
[visibility] => public
[iCalUID] => 2017_BIRTHDAY_4a7a6b868dd53910#google.com
[sequence] => 0
[gadget] => Array
(
[iconLink] => https://calendar.google.com/googlecalendar/images/cake.gif
[preferences] => Array
(
[goo.contactsGivenName] => Deepak
[goo.contactsEventType] => BIRTHDAY
[goo.contactsFullName] => Deepak
[goo.isGPlusUser] => false
[goo.contactsContactId] => 4a7a6b868dd53910
[goo.contactsIsMyContact] => true
)
)
[reminders] => Array
(
[useDefault] => 1
)
)
[1] => Array
(
[kind] => calendar#event
[etag] => "3060534890000000"
[id] => 2018_BIRTHDAY_4a7a6b868dd53910
[status] => confirmed
[htmlLink] => https://www.google.com/calendar/event?eid=MjAxOF9CSVJUSERBWV80YTdhNmI4NjhkZDUzOTEwICNjb250YWN0c0B2
[created] => 2018-06-29T10:17:25.000Z
[updated] => 2018-06-29T10:17:25.000Z
[summary] => Deepak's birthday
[description] => This is Deepak's birthday!
[creator] => Array
(
[email] => #contacts#group.v.calendar.google.com
[displayName] => Contacts
[self] => 1
)
[organizer] => Array
(
[email] => #contacts#group.v.calendar.google.com
[displayName] => Contacts
[self] => 1
)
[start] => Array
(
[date] => 2018-06-30
)
[end] => Array
(
[date] => 2018-07-01
)
[visibility] => public
[iCalUID] => 2018_BIRTHDAY_4a7a6b868dd53910#google.com
[sequence] => 0
[gadget] => Array
(
[iconLink] => https://calendar.google.com/googlecalendar/images/cake.gif
[preferences] => Array
(
[goo.contactsGivenName] => Deepak
[goo.contactsEventType] => BIRTHDAY
[goo.contactsFullName] => Deepak
[goo.isGPlusUser] => false
[goo.contactsContactId] => 4a7a6b868dd53910
[goo.contactsIsMyContact] => true
)
)
[reminders] => Array
(
[useDefault] => 1
)
)
[2] => Array
(
[kind] => calendar#event
[etag] => "3060534890000000"
[id] => 2019_BIRTHDAY_4a7a6b868dd53910
[status] => confirmed
[htmlLink] => https://www.google.com/calendar/event?eid=MjAxOV9CSVJUSERBWV80YTdhNmI4NjhkZDUzOTEwICNjb250YWN0c0B2
[created] => 2018-06-29T10:17:25.000Z
[updated] => 2018-06-29T10:17:25.000Z
[summary] => Deepak's birthday
[description] => This is Deepak's birthday!
[creator] => Array
(
[email] => #contacts#group.v.calendar.google.com
[displayName] => Contacts
[self] => 1
)
[organizer] => Array
(
[email] => #contacts#group.v.calendar.google.com
[displayName] => Contacts
[self] => 1
)
[start] => Array
(
[date] => 2019-06-30
)
[end] => Array
(
[date] => 2019-07-01
)
[visibility] => public
[iCalUID] => 2019_BIRTHDAY_4a7a6b868dd53910#google.com
[sequence] => 0
[gadget] => Array
(
[iconLink] => https://calendar.google.com/googlecalendar/images/cake.gif
[preferences] => Array
(
[goo.contactsGivenName] => Deepak
[goo.contactsEventType] => BIRTHDAY
[goo.contactsFullName] => Deepak
[goo.isGPlusUser] => false
[goo.contactsContactId] => 4a7a6b868dd53910
[goo.contactsIsMyContact] => true
)
)
[reminders] => Array
(
[useDefault] => 1
)
)
Google calendar and google contacts are two different things. There is also a difference between a date of birth and a birthday. The former occurs only once the latter occurs once a year.
Ex: In my google contacts I am having contact name - Deepak whose birthday - 19/04/1990.
This is your entry in your address book for this user. Its the users date of birth.
So this contact birthday showing in the google birthday calendar. When i am fetching google birthday calendar i am getting date like 2017-04-19, 2018-04-19, 2019-04-19.
Google calendar birthday calendar gives you an event for each year for the users birthday that year. So that you dont forget to send flowers.
How can i get contact exact birthday with year from google birthday calendar?
You should be going though the google contacts api directly if you just want the data from your google contacts.

How to collect such info in magento listing page?

I need the catalog_product_entity_media_gallery table value data only on listing page.
When i am going to listing page and use the print_r($_productCollection);
$_productCollection on listing page returns me a array like this.
[_resourceName:protected] => catalog/product
[_resource:protected] =>
[_resourceCollectionName:protected] => catalog/product_collection
[_dataSaveAllowed:protected] => 1
[_isObjectNew:protected] =>
[_data:protected] => Array
(
[entity_id] => 160
[entity_type_id] => 4
[attribute_set_id] => 4
[type_id] => simple
[sku] => 104580
[has_options] => 0
[required_options] => 0
[created_at] => 2014-12-01 10:40:25
[updated_at] => 2014-12-01 11:51:15
[cat_index_position] => 1
[price] => 4.4900
[tax_class_id] => 4
[final_price] => 4.4900
[minimal_price] => 4.4900
[min_price] => 4.4900
[max_price] => 4.4900
[tier_price] =>
[name] => E Shisha E Liquid eKaiser *Menthol Flavour* 10ml Platinum Bottle Refill for Rechargeable E cigarette and E Shisha
[msrp_enabled] => 1
[msrp_display_actual_price_type] => 1
[thumbnail] => amazon_images/104580.jpg
[small_image] => amazon_images/104580.jpg
[image_label] =>
[small_image_label] =>
[thumbnail_label] =>
[url_key] => e-shisha-e-liquid-ekaiser-menthol-flavour-10ml-platinum-bottle-refill-for-rechargeable-e-cigarette-and-e-shisha
[short_description] => The eKaiser Platinum e Liquid range is made specifically for Cigarette smokers.
I need the only [small_image] value, which returns me only the amazon_images/104580.jpg
If any One have any idea, how to do it
Please help me.
Thank you
And also you can do like this :
$product = Mage::getModel('catalog/product')->load($_product->getId());
foreach ($product->getMediaGallery('images') as $image) {
...
}
You can do like this on listing page.
$product = Mage::getModel('catalog/product')->load($_product->getId());
foreach ($product->getMediaGalleryImages() as $image) {
var_dump($image->getUrl());
}
A for loop in listing with getModel will slow down your listing page considerably.
With listing page you should only use flat tables for collection.
So you need to make sure that small image is populated in flat table.

Set up PhpStorm+Vagrant+Xdebug

I've already banged my head to the wall trying to set up debug process on Vagrant virtual machine.
I've got Windows 8.1 on my host machine and Ubuntu 14 onthe guest machine.
Here is my xdebug.ini:
zend_extension="/usr/lib/php5/20121212/xdebug.so"
xdebug.remote_log=/var/xdebug.log
xdebug.remote_host="10.0.2.2"
xdebug.remote_port="8000"
xdebug.remote_enable=1
xdebug.remote_autostart=0
xdebug.remote_handler="dbgp"
xdebug.idekey=vagrant
But in a log file I see such message:
Log opened at 2014-11-13 04:32:18
I: Checking remote connect back address.
I: Remote address found, connecting to 10.10.10.1:9000.
E: Time-out connecting to client. :-(
Log closed at 2014-11-13 04:32:18
Why there are different ip and port?
I've searched around where it can be overwritten, but no luck. In php.ini I found nothing.
Also strange thing: in my path mapping settings at PHPStorm I have slashes replaced by backslahes. I don't know, is it come to a problem.
EDIT: Here is result of php -i | grep xdebug
24:/etc/php5/cli/conf.d/20-xdebug.ini,
47: with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
767:xdebug
769:xdebug support => enabled
777:xdebug.auto_trace => Off => Off
778:xdebug.cli_color => 0 => 0
779:xdebug.collect_assignments => Off => Off
780:xdebug.collect_includes => On => On
781:xdebug.collect_params => 0 => 0
782:xdebug.collect_return => Off => Off
783:xdebug.collect_vars => Off => Off
784:xdebug.coverage_enable => On => On
785:xdebug.default_enable => On => On
786:xdebug.dump.COOKIE => no value => no value
787:xdebug.dump.ENV => no value => no value
788:xdebug.dump.FILES => no value => no value
789:xdebug.dump.GET => no value => no value
790:xdebug.dump.POST => no value => no value
791:xdebug.dump.REQUEST => no value => no value
792:xdebug.dump.SERVER => no value => no value
793:xdebug.dump.SESSION => no value => no value
794:xdebug.dump_globals => On => On
795:xdebug.dump_once => On => On
796:xdebug.dump_undefined => Off => Off
797:xdebug.extended_info => On => On
798:xdebug.file_link_format => no value => no value
799:xdebug.idekey => vagrant => vagrant
800:xdebug.max_nesting_level => 100 => 100
801:xdebug.overload_var_dump => On => On
802:xdebug.profiler_aggregate => Off => Off
803:xdebug.profiler_append => Off => Off
804:xdebug.profiler_enable => Off => Off
805:xdebug.profiler_enable_trigger => Off => Off
806:xdebug.profiler_output_dir => /tmp => /tmp
807:xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p
808:xdebug.remote_autostart => Off => Off
809:xdebug.remote_connect_back => On => On
810:xdebug.remote_cookie_expire_time => 3600 => 3600
811:xdebug.remote_enable => On => On
812:xdebug.remote_handler => dbgp => dbgp
813:xdebug.remote_host => 10.0.2.2 => 10.0.2.2
814:xdebug.remote_log => /var/xdebug.log => /var/xdebug.log
815:xdebug.remote_mode => req => req
816:xdebug.remote_port => 10000 => 10000
817:xdebug.scream => Off => Off
818:xdebug.show_exception_trace => Off => Off
819:xdebug.show_local_vars => Off => Off
820:xdebug.show_mem_delta => Off => Off
821:xdebug.trace_enable_trigger => Off => Off
822:xdebug.trace_format => 0 => 0
823:xdebug.trace_options => 0 => 0
824:xdebug.trace_output_dir => /tmp => /tmp
825:xdebug.trace_output_name => trace.%c => trace.%c
826:xdebug.var_display_max_children => 128 => 128
827:xdebug.var_display_max_data => 512 => 512
828:xdebug.var_display_max_depth => 3 => 3
Alright, so my problem has been resolved by setting remote_connect_back option to Off. Important note: I have used PuPHPet to generate Vagrant config file, and I didn't know, that there, in the PuPHPet config file, xDebug configuration dwells. Hence somehow host and port was always 10.10.10.10 and 9000 respectively. So it seems that all configurations have to be done by the initial Vagrant config, not by the SSH afterwards.

Magento 1.6 does not seem to be using APC

I am using Magento 1.6 with APC 3.1.9.
I am getting 99% miss and only 0.4% hit.
Magento local.xml has this entry
<config>
<global>
<cache>
<backend>apc</backend>
<prefix>MAGE_</prefix>
</cache>
......
.....
I have tweaked most of the params in apc.ini as per the Magento forums.
When i run,
php -r 'phpinfo();' | grep 'apc'
output is
additional .ini files parsed => /etc/php.d/apc.ini,
apc
apc.cache_by_default => On => On
apc.canonicalize => On => On
apc.coredump_unmap => Off => Off
apc.enable_cli => On => On
apc.enabled => On => On
apc.file_md5 => Off => Off
apc.file_update_protection => 2 => 2
apc.filters => no value => no value
apc.gc_ttl => 3600 => 3600
apc.include_once_override => Off => Off
apc.lazy_classes => Off => Off
apc.lazy_functions => Off => Off
apc.max_file_size => 20M => 20M
apc.mmap_file_mask => no value => no value
apc.num_files_hint => 10000 => 10000
apc.preload_path => no value => no value
apc.report_autofilter => Off => Off
apc.rfc1867 => Off => Off
apc.rfc1867_freq => 0 => 0
apc.rfc1867_name => APC_UPLOAD_PROGRESS => APC_UPLOAD_PROGRESS
apc.rfc1867_prefix => upload_ => upload_
apc.rfc1867_ttl => 3600 => 3600
apc.serializer => default => default
apc.shm_segments => 1 => 1
apc.shm_size => 1024M => 1024M
apc.slam_defense => On => On
apc.stat => On => On
apc.stat_ctime => Off => Off
apc.ttl => 0 => 0
apc.use_request_time => On => On
apc.user_entries_hint => 10000 => 10000
apc.user_ttl => 0 => 0
apc.write_lock => On => On
Not sure how to debug this issue and resolve the 99%cache miss.
What have I missed?
Please help.
make sure that you did a rm -rf /var/www/var/cache/* after changing local.xml.
try to optimizing your apc cache
http://blog.nexcess.net/2011/03/25/optimizing-apc-cache-settings-for-magento/
and make sure that you check
Additional Advice for APC configuration:
turn off apc.optimization (experimental and unstable, may cache user
session info, useless items which should not be cached, such as
admin pages and logged-in site pages)
turn off apc.include_once_override
turn off apc.slam_defense (may cause objects to be replaced with PHP
warnings which are displayed to the user)
set apc.user_ttl = 0 (allows your php scripts to set appropriate
timeouts for queries and objects)
set apc.mmap_file_mask = /tmp/apc-yourusernamehere.XXXXXX for
file-backed mmap; make file mask unique by adding your unique
string; XXXXXX (exactly 6 X’s) must remain to allow APC to add
random string OR set to /dev/zero for anonymous mmap if you can
spare the memory
source : http://blog.magikcommerce.com/configuring-apc-cache-for-faster-magento/

Resources