How to get the value of converted money in PayPal - paypal

My currency_code is in USD but it is converted to PHP after donated
My problem is when I insert it on my database, the USD is being inserted but not the converted PHP value. for example: I donated 10USD is it equivalent to more or less 450PHP, how can I insert 450 in my database?

I think the problem on your code is not the Paypal API it is the setting of the variables.
$donation = $_POST["donation"]; // this is sample return value
$converted_donation = convent_donation($donation); // function that convert USD to PHP
you are inserting the $donation variable I guess, that's why your data is wrong
anyway, you can set the currency code in the paypal api to PHP and insert it directly on your database, there is no need to convert it $config["currency_code"] = 'PHP';

It sounds like you're converting the value after the PayPal response is returned? In which case, are you sure you're not just inserting the wrong variable (such as the value returned in the response directly)?

Related

WooCommerce rest api include parameter not fetching variation with variable product

https://example.com/wp-json/wc/v3/products/10 product type=variable and it is working fine
https://example.com/wp-json/wc/v3/products/11 product type=variation and it is working fine
But it fetch only one product (with id 10) using include parameter like
https://example.com/wp-json/wc/v3/products?include=10,11
I need help so that i can fetch 2 or more products (any type) in one API call
Do you need to retrieve all the products in woo commerce. If try with this call " /wp-json/wc/v3/products"
A bit late but maybe someone has the same problem still
The include parameter should be array and as this thread explains How to pass an array within a query string?
you should send your parameters as this
https://example.com/wp-json/wc/v3/products?include[]=10&include[]=11

woocommerce customer Fetch with time filter

I am requesting customer data using Rest Api of woocommerce. Woocommerce api documentation says
"All endpoints (except for customer orders) support date filtering via created_at_min and created_at_max as ?filter[] parameters. e.g. ?filter[created_at_min]=2013-12-01".
However, when I am giving date filter in request URL it results in blank response!!
My question is,can the customer data be fetched via date filter in woocommerce.
Thanks.
You can pass Filter with time in REST API of WooCommerce.
Just pass the filter in H:i:s format.
Note : while trying to generate the signature, I found, the URL encoding needs to be done twice because of extra space between DateTime filter criteria. Just encode the clean text once to get RFC3986 encoding, and do it again to generate the signature. Pass the first encoded string and append the generated signature. I saw the filter to be working.

Yodlee - Retrieving bank data in the US but "tranListFromDate" and "tranListToDate" properties are null

I am using Yodlee to retrieve bank account transaction details for a real-world US bank.
I am retrieving a lot of transaction data, but I was surprised to see the "transListFromDate" and "tranListToDate" properties of the BankData class have a NULL value for both of them.
I am wondering if these are always NULL for all "bank" containers/sites supported by Yodlee, or if this is just an issue with this particular bank.
If these date fields ARE populated with some banks, can anyone supply me with details (possibly sample sample values) about these related properties for these particular dates?
displayTimeZone (string)
localFormat (string)
timezone (string)
Thanks in advance!
Eden, these data elements are usually not set.
"transListFromDate" indicates the "Transaction From date" and "tranListToDate" indicates the "Transaction to date" used during the last refresh attempt respectively and hence is of no much significance. It does not represent the complete transaction duration range that the user has.

Paypal NVP can I pass multiple custom fields

I know I can pass a field name "CUSTOM" which is supposed to come back in IPN can I pass two values as for example CUSTOM0 and CUSTOM1? or something like that
You can't pass multiple fields, but you could pass multiple values in that 1 field if you need to. For example, you might include a value like...
val1|val2|val3|val4
Then in your IPN script, you could handle it like the following PHP sample...
$custom_values = explode('|',$_POST['custom']);
Then your custom values would all be available in the $custom_values array for you to use accordingly.
You could also send an NVP string or an XML string if that help you keep things straight, but keep in mind the CUSTOM parameter only accepts 256 characters.
If you need more than that, or if you just prefer, you could always save the data in a local database and then just pass a record ID in the CUSTOM field so that you can pull all those details back out of your database within your IPN script using that record ID.

fql bug: page_id is greater that max int value

The developers of facebook states that page_id in the page table is integer.
But because of many facebook pages, it number increased greater that max int value
http://developers.facebook.com/docs/reference/fql/page/
so the fql's select gives smth like this e+123213
This seems like a bug in page table documentation. In Graph API documentation for page object refer to this field as string.
It's actually better to save/use any id returned by Facebook as string since in many cases value of id will cause overflow over integer boundaries. And for some objects id may contain characters other that numbers (underscore).
Update:
To clarify some things. The issue is really not only with documentation but with return data too. API return response as JSON (or if you using old REST API you can specify XML format too) string. So the response do contain full and correct page_id, but in the phase of JSON parsing you loose it due to fact that it's parsed as integer.
In PHP 5.4 json_decode function have additional options parameter which may be JSON_BIGINT_AS_STRING to overcome this issue. You should check if the parsing method you use supports something like this.
There is couple of bugs opened for this issue on Facebook (it's not for the page_id in page table, but same behavior for uid field on other tables):
UID's treated as integers for FQL queries in PHP SDK and exceed PHP_INT_MAX on 32-bit systems
Invalid uid format when fetching FQL page_fan table with fql via GRAPH api
Actually you can do something to overcome this issue:
If you using PHP you may either:
use 64bit version of run-time which have no this issue due to bigger PHP_INT_MAX
use PHP 5.4 with JSON_BIGINT_AS_STRING option passed to json_decode
If you using PHP or any other technology:
use alternative JSON parser (I'm not aware of any JSON parser in PHP that able to handle this)
Use quick and dirty reqular expression to wrap all numbers in response with quotes $response = preg_replace('/(\b\d+\b)/', '"$1"', $response) (this is for PHP, but you'll get the idea)
Also I recommend filing additional Bug on Facebook and updating your question so we can subscribe to it as well.