From the beginning of this (June 2018) month most of my clients can not pay with 2Checkout by card, everything was OK before.
I begin collecting the responses, they are always the same:
"validationErrors":null,
"exception":{
"errorMsg":"Authorization Failed",
"httpStatus":"400",
"exception":false,
"errorCode":"600"
},"response":null
I have no idea what is going on, I tried to contact their support team, but everything they said, that everything should work, but actually it doesn't!
I use API to process payments. The website code haven't changed since that time.
The request to 2CO looks like this:
Array
(
[method] => POST
[timeout] => 45
[headers] => Array
(
[Accept] => application/json
[Content-Type] => application/json
)
[body] => {
"sellerId":"my seller id",
"privateKey":"my private key",
"merchantOrderId":just a random number,
"token":"token received from 2CO",
"currency":"USD",
"total":"130.00",
"billingAddr":{
"name":"name from debit/credit card here",
"addrLine1":"customer address here",
"addrLine2":"",
"city":"customer city here",
"state":"",
"zipCode":"",
"country":"MX",
"email":"customer email here"
},
"lineItems":[{
"name":"product name here",
"price":"130.00",
"type":"product",
"quantity":"1"
}]
}
)
Above is the example for a Mexico customer, so, addrLine2, state and zipCode are not required.
Thanks for help in advance!
Related
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"
}
]
}
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.
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.
I'm using telegram bot api for implementing an inline bot. For sending query result to the user, I'm using answerInlineQuery method in this way. This is just an example for showing a photo that exist on telegram server to user:
$results = array(
array(
"type" => "photo",
"id" => "1",
"photo_file_id" => the file id,
"title" => "test title",
"description" => "test description",
"caption" => "test caption",
"parse_mode" => "HTML"
),
);
$postFields["results"] = json_encode($results);
$postFields["cache_time"] = 0;
//send $postFields to telegram bot api server with curl
This works and after user sending inline query, one image shows as the result list. But the problem is two fields title and description does not show in the result list, even these are exist in telegram api documentation here.
What's is the problem and whay these two fields does not present in the result list?
Consider a JSON object such as:
{
name: 'ben',
employer: 'The Sherwin-Williams Company',
emails: ['ben#gmail.com', 'ben#sherwin-williams.com']
}
In MongoDB you can index the emails field such that you can find any object with 'ben#gmail.com' as an email. Is this possible in Riak? I couldn't tell from reading the docs.
You certainly can, but you have to manually enter the index entries.
Here's an example in Ruby:
require 'riak'
client = Riak::Client.new(:protocol => "pbc", :host => "127.0.0.1", :pb_port => 10047, :http_port => 10048)
ben = client['people'].get_or_new('ben')
ben.data = { :name => "ben",
:employer => "The Sherwin-Williams Company",
:emails => ['ben#gmail.com', 'ben#sherwin-williams.com'] }
ben.indexes['email_bin'] << "ben#gmail.com"
ben.indexes['email_bin'] << "ben#sherwin-williams.com"
ben.store
Now you can look it up via the ruby library, or through your web browser at http://127.0.0.1:10018/buckets/people/index/email_bin/ben#gmail.com
On my system this returns:
{"keys":["ben"]}
I know the Java and the Ruby Riak libraries support adding/editing index entries, I will have to check on the others and get back to you though.