Can't make payment in Paypal sandbox but works fine in my live account - paypal-sandbox

I have set up a custom cart to make payments through Paypal Payments Standard. but I I have not got the return flow and IPN flow completed and tested yet as I can't get this to run in sandbox. I can get it to run on my live Paypal account but that means making live payments to get to the return flows.
I am using encrypted form data and the sandbox related certs/keys/cert_id, url, test business account, return paths
and seem to be passing the decryption process. (it fails decryption if I enter wrong values).
I am also logged into my developer account in another tab.
But I get the following screen:
Cookies are not the issue as I have used a different browser that has never visited either site before.
Why will this process payments on my live account and not my sandbox account?
Here is my data:
item_name_1 => Test product 1
amount_1 => 0.01
item_number_1 => T-1
quantity_1 => 1
item_name_2 => Test Product 2
amount_2 => 100.00
item_number_2 => AC-H
quantity_2 => 1
tax_2 => 10
invoice => 001
cmd => _cart
return => http://my site/confirm_payment.php
cancel_return => http://my site/cart.php?payment=cancelled
upload => 1
business => **sandbox receiving business account**
cert_id => **sandbox cert_id***
Here is the form:
<form id="paypal_form" method="post" action=" https://www.sandbox.paypal.com/cgi-bin/webscr">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value=" -----BEGIN PKCS7-----
MIIIZQYJKoZIhvcNAQcDoIIIVjCCCFICAQAxggE6MIIBNgIBADCBnjCBmDELMAkG
*******************************************************
MaLf05hTBRkTdFPzrnrslM72Ihz6C2NNGn8Ss3lcJ6vxi3dKvyLeUWc=
-----END PKCS7-----">
<input type="submit" name="paypal" value="Pay via Paypal">
</form>So why would this work in my live account and not the sandbox?

Related

WooCommerce REST API: Gateway does not support admin changing the payment method on a Subscription

I am using WooCommerce Subscription REST API to extend the subscription of the user. The problem that I have is that when I want to update expire time I get this error:
Gateway does not support admin changing the payment method on a Subscription
Does someone know where is the problem?
I am using the following code to update the subscription expire time:
return $this->guzzleClient->request('PUT', 'wp-json/wc/v1/subscriptions/'.$id, [
'json' => [
'end_date' => $endDate->toDateTimeString(),
'status' => 'active',
]
]);
We ran into a similar issue. Instead of passing the whole subscription object back, we instead only passed the necessary information (in our case we wanted to add to the coupon_lines field).
Our resulting payload looked like:
{
coupon_lines: [
{
code: "sample-code",
amount: "10.00"
}
]
}

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.

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

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.

jms payment corebundle integtation issue URL return

I'm integration the jms payment bundle in symfony 2.6.
I had followed all document in : http://jmspaymentcorebundle.readthedocs.io/en/stable/guides/accepting_payments.html
I'm getting this error :
You must configure a return url.
I had configured the return URL into ON in my account , and it seems not working, getting the same error.
My confirmation url is a page in which there is some text like :
Thank you for your payment. Your transaction has been completed,
and a receipt for your purchase has been emailed to you.
You may log into your account at www.paypal.com to view details of this transaction.
The error persists.
What should i do ?
Solved , they mean in the controller. I added :
'predefined_data' => array(
'paypal_express_checkout' => array(
'return_url' => $this->generateUrl('payment_complete', array(
'orderNumber' => $order->getOrderNumber(),
), true),
For more documentation http://jmspaymentpaypalbundle.readthedocs.io/en/latest/usage.html

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).

Resources