How to set new account creating optional in PayPal Express Checkout? - paypal-sandbox

Is it possible to define creating a new PayPal account in PayPal Express Checkout as not required?
I'm try this my code and getting two different results - once new paypal account as optional and the other time as an essential.
METHOD => SetExpressCheckout
MAXAMT => 4.50
RETURNURL => https://...
CANCELURL => https://...
REQCONFIRMSHIPPING => 0
SOLUTIONTYPE => SOLE
NOSHIPPING => 0
LOCALECODE => EN
LANDINGPAGE => Billing
HDRIMG => http://.../logo.jpg
PAYFLOWCOLOR =>
CHANNELTYPE => Merchant
ALLOWNOTE => 0
PAYMENTREQUEST_0_SHIPTONAME => Stephan K Schwartz
PAYMENTREQUEST_0_SHIPTOSTREET => Heiligengeistbrücke 76
PAYMENTREQUEST_0_SHIPTOSTREET2 => Freistaat Bayern
PAYMENTREQUEST_0_SHIPTOCITY => Windsbach
PAYMENTREQUEST_0_SHIPTOSTATE =>
PAYMENTREQUEST_0_SHIPTOZIP => 91575
PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE => DE
ADDROVERRIDE => 1
PAYMENTREQUEST_0_SHIPPINGAMT =>
PAYMENTREQUEST_0_CURRENCYCODE => EUR
PAYMENTREQUEST_0_PAYMENTACTION => Sale
L_PAYMENTREQUEST_0_DESC0 =>
L_PAYMENTREQUEST_0_NAME0 => Product name
L_PAYMENTREQUEST_0_NUMBER0 => 4260568520853
L_PAYMENTREQUEST_0_AMT0 => 2.50
L_PAYMENTREQUEST_0_QTY0 => 1
L_PAYMENTREQUEST_0_ITEMURL0 => https://....
L_PAYMENTREQUEST_0_NUMBER1 => tax
L_PAYMENTREQUEST_0_NAME1 => VAT 20%
L_PAYMENTREQUEST_0_AMT1 => 0.50
L_PAYMENTREQUEST_0_QTY1 => 1
PAYMENTREQUEST_0_ITEMAMT => 3.00
PAYMENTREQUEST_0_AMT => 3.00
Guest checkout is turned on, of course, in both cases. Version 109.0.

Ok after a few hours of trying I found out it's question about amount of order.
If a customer is paying small order under about 200 USD or 500 EUR (I couldn't find exact limits), the customer will be promped to get registered. (right side of the picture in question)
But if a customer is paying more than the above estimated amount, the registration is not required. (left side of picture in question)
Makes this sense or am I wrong?

I had a similar issue, and there was no answer to it. I even contacted PayPal several times, my problem was that when the user used a mobile device the guest checkout wasn't available, however exactly same page, same product did show a guest checkout when opened from a desktop.
To add to this, the code was running for a while and guest checkout was available on mobile, then one day it disappeared, while nothing was changed on my code.
All I learned from countless calls to tech support is that it's something which is decided at server (PayPal) level and you as a developer don't have too much influence over it.
Yes there is an option to enable guest payment: (See https://developer.paypal.com/docs/integration/direct/payments/guest-payments/# ) but it's not really guaranteed it will work.
To add to this, after a period of time (again without changing the code) the guest option appeared again on the mobile versions.
As a footnote and slightly off topic:
This (and the very high fees) where the reasons I decided to dump PayPal checkout, bite the bullet, set up a PCI compliant server, sign up for a gateway and merchant account, and start taking card payments directly.

Related

Using a single Cloudflare account in Wordpress with WP Super Cache with visible API key

We are starting to use Cloudflare on a few Wordpress client accounts and notice in the CDN settings that my email address and API key are visible to the client.
Is this a potential security issues where others can see my Cloudlflare email address and API key? Should I be using 1 Cloudflare account per client account?
Here is a screenshot (i have blurred the API key and deleted the email input box in the console) but both these values are visible to the customer.
What is the worse thing they could do with these 2 pieces of data?
you have to use tokens instead of global api key. you strict token to certain zone only
This only will NOT solve the problem, you have to manually modify wp fastest cache plugin to modify the request to match API tokens usage.
the requests can be found in inc\cdn.php
The modified file:
https://gist.github.com/ahmed-abdelazim/7c8170f7fc4e821c6b015d770fcbf14a
so
$header = array("method" => "DELETE",
'headers' => array(
"X-Auth-Email" => $email,
"X-Auth-Key" => $key,
"Content-Type" => "application/json"
),
"body" => '{"purge_everything":true}'
);
is converted to
$header = array("method" => "DELETE",
'headers' => array(
//"X-Auth-Email" => $email,
"Authorization" => "Bearer ".$key,
"Content-Type" => "application/json"
),
"body" => '{"purge_everything":true}'
);
and this occured five times in the plugin in the cdn.php file
simply creating API Token worked for me. There are some pre made template. There was for wordpress one as well. Just selected and created and added it to wp fastest cache and that worked.

Tracking offline purchases with Enhanced Ecommerce and Measurement Protocol

We've deployed Google Analytics Enhanced Ecommerce to better track our sales. Everything's working great except that some of our transactions are paid offline. We were already using the "standard" ecommerce analytics and this had been solved by reporting these transactions with the Measurement Protocol.
Right now we're unable to use MP in conjunction with Enhanced Ecommerce. Our reports seem to be accepted by the collection engine but they're not being linked to the Shopping Behaviour / Checkout Behaviour Reports (which is crucial for us).
Since the Enhanced Ecommerce is working for online payments, we're narrowing this down to our Measurement Protocol usage.
Here's an example of one such call:
'v' => 1,
'tid' => 'UA-XXXXXXXX-3',
'cid' => 'YYYYYYYYYY',
't' => 'pageview',
'ti' => 219950,
'ta' => 'our property name',
'tr' => 14.99,
'pa' => 'purchase',
'ni' => '0',
'pr1id' => '53731',
'pr1nm' => 'Product description',
'pr1pr' => '14.99',
'pr1qt' => '1',
'pr1ps' => 1,
We've tried sending the Hit Type ('t' parameter) as Event, instead of Pageview, with no success.
We're recording the Client ID ('cid' parameter) on the checkout. We've tried sending it with and without the timestamp (the numeric part that procedes the . separator).
We've trying sending this as a Non-Interactive hit ('ni' parameter).

Set goal location through measurement protocol event

I'm using the measurement protocol to send an event to Google Analytics. The event shows up fine, but this event also completes a goal for us and the location keeps coming up as (entrance). I've looked around and read some suggestions saying that the cause might be a late (or non-existent) pageview in GA. This makes a bit of sense, since the event is fired from the backend. I'm using cURL to send the request to analytics and the request looks something like the code below. The goal completion location should be the WordPress page the user was previously on, which I've included by sending _wp_original_http_referer with the request.
$data = array(
'v' => '1',
'tid' => 'UA-XXXXXXXX',
't' => 'event',
'ec' => 'Category',
'ea' => 'Action',
'el' => 'Label',
'ev' => '0',
'dl' => $_REQUEST['_wp_original_http_referer']
);
Should I try a property other than dl? I've tried dp as well but had no luck. The documentation doesn't say much about specifying goal locations either.

Corrupt Drupal menu

Running Drupal 7.26 with nothing fancy and have started to encounter a corruption issue with the menu system. We started seeing the following error (truncated to fit). Doing a drush or a manual clear cache doesn't fix it, setting menu_router.weight to NULL yes, truncating both the menu_links and menu_router tables still produces the error. Links oddly menu still appear on the site, but only some not all.
I suspect that the issue might be caused by a page view (using views3) with a set path, but I can't see why that would be as it is again just a normal path.
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column
'weight' at row 9: INSERT INTO {menu_router} (path, load_functions, to_arg_functions,
access_callback, access_arguments, page_callback, page_arguments, delivery_callback, fit,
number_parts, context, tab_parent, tab_root, title, title_callback, title_arguments,
theme_callback, theme_arguments, type, description, position, weight, include_file) VALUES
.... (truncated) ....
(:db_insert_placeholder_184, :db_insert_placeholder_185, :db_insert_placeholder_186,
:db_insert_placeholder_187, :db_insert_placeholder_188, :db_insert_placeholder_189,
:db_insert_placeholder_190, :db_insert_placeholder_191, :db_insert_placeholder_192,
:db_insert_placeholder_193, :db_insert_placeholder_194, :db_insert_placeholder_195,
:db_insert_placeholder_196, :db_insert_placeholder_197,); Array (
.... (truncated) ....
[:db_insert_placeholder_180] => Ajax callback for view loading.
[:db_insert_placeholder_181] => [:db_insert_placeholder_182] => 0
[:db_insert_placeholder_183] => sites/all/modules/contrib/views/includes/ajax.inc
[:db_insert_placeholder_184] => volunteering/opportunities [:db_insert_placeholder_185] =>
[:db_insert_placeholder_186] => [:db_insert_placeholder_187] => ctools_access_menu
[:db_insert_placeholder_188] => a:1:{i:0;a:2:{s:4:"type";s:4:"none";s:8:"settings";N;}}
[:db_insert_placeholder_189] => page_manager_page_execute [:db_insert_placeholder_190] =>
a:1:{i:0;s:13:"volunteering_";} [:db_insert_placeholder_191] =>
[:db_insert_placeholder_192] => 3 [:db_insert_placeholder_193] => 2
[:db_insert_placeholder_194] => 0 [:db_insert_placeholder_195] =>
[:db_insert_placeholder_196] => volunteering/opportunities [:db_insert_placeholder_197] =>
Volunteering opportunities [:db_insert_placeholder_198] => t [:db_insert_placeholder_199]
=> [:db_insert_placeholder_200] => [:db_insert_placeholder_201] => a:0:{} ) in
_menu_router_save() (line 3837 of /var/mysite/dev/includes/menu.inc).
For some strange reason the function page_manager_list_page() in ctools page manager > page_manager.admin.inc wasn't setting a numeric weight. Not sure how or why it isn't checking it is not a an integer, but it doesn't which caused the issue.

Decrypting Drupal / Ubercart Credit Card Info Externally

Right now I have a simple PHP script outside of my drupal installation that just compiles a CSV for my client of orders and the credit card type (Visa, Mastercard..)
It seems like an older version of Drupal 6 just had this part of data serialized in the database "cc_card" however now it seems to be encrypted.
Is there a way to decrypt this data (Stored in us_orders.data) so that I could see the card type?
The uc_credit_cache() function should do what you want:
$order = uc_order_load($order_id);
$cc_data = uc_credit_cache('save', $order->data['cc_data'], TRUE);
$cc_data should look something like this:
Array
(
[cc_type] => visa
[cc_owner] =>
[cc_number] => 4111111111111111
[cc_start_month] =>
[cc_start_year] =>
[cc_exp_month] => 9
[cc_exp_year] => 2012
[cc_issue] =>
[cc_cvv] => 222
[cc_bank] =>
)

Resources