Slightly tweak paypal user interface - paypal

Perhaps a stupid question but I have to ask... Im targeting users in a country where PayPal does not support their (the country's) currency type as a billing amount so I changed PayPal payment.php page (is this allowed...?) like so:
//' TODO: Enter the total Payment Amount within the quotes.
//' example : $paymentAmount = "15.00";
//'------------------------------------
$usd_rate = "13.50"; //I might still add a funtion to get live exchange rate here
$zar = "50.00";
$amount = $zar / $usd_rate;
$amount = round($amount,2);
$paymentAmount = $amount;
The following is working and I am getting this:
What I want to do
Can you see the empty / blank circle on the left...? I would like to add the variable value $zar in that circle so it will read something like:
1st circle (left)
$50.00ZAR =
2nd circle (right)
$3.70 USD

PayPal does not support this tweak, unfortunately.
But you may want to try putting it in the item information to display on PayPal. The way to put it there depends on the product you use. PayPal docs will provide the info.
https://developer.paypal.com

Related

paypal Adaptive payment issue- fractional amount is rounded off

i have integrated paypal adaptive payment system in a website, but i get an error while i checkout that if the amount upto 2 decimal places is not rounded off, the fractional amount could be lost. what is the solution to this? I am currently rounding off the amounts, but any idea how to get the fractional amount too?
You have to make sure that the amount you're sending to PayPal is rounded properly for the currency. This means that a US dollar amount would have at most 2 subunits (cents).
If using the adaptive pay ruby gems and still experiencing issues:
Another issue that I recently ran into with their ruby gems is that they use floats instead of decimals, which is a bad practice for monetary values. Floats are inaccurate. For example in ruby...
2.20 - 2.01 = 0.1900000000000004
If you're properly setting the amount's subunits when passing in the param to their build_pay method and you're still getting the error...
If the fractional amount is rounded for currency conversion, funds could be lost
then the issue may very well be within their gem's use of float. Your logs will show this, and you can test it by using the amount 715.57, which their gem sends to their api as 715.57000000001 because of their use of .to_f in their paypal-sdk-core gem.
To fix this, I monkey patched their Float class in my rails app by adding this to my app, essentially casting it as a BigDecimal instead of a Float:
module PayPal::SDK::Core
module API
module DataTypes
module SimpleTypes
class Float < ::Float
def self.new(float)
# Floats are inccurate. BigDecimal is better.
# Ruby example: 2.20 - 2.01 = 0.1900000000000004
# To support currencies with up to 4 subunits, we round(4)
BigDecimal.new(float.to_f.round(4).to_s)
end
end
end
end
end
end
to my config/initializers/paypal.rb. I can't say this is the most elegant solution, but it works. I created an issue on their repo too, and can hopefully hear back soon.
More info on float problems with currency:
Reference 1: https://stackoverflow.com/a/3730040/1109211
Reference 2: https://stackoverflow.com/a/3730249/1109211
If you are using PHP you can apply this solution. It is working in my case
$amount = 50.4854;
$roundedAmount = number_format(round($amount, 2), 2, '.', '');
Send rounded amount to PayPal, Hope it will work!

Sending automatic e- mail on GOOGLE Spreadsheets

Good Morning,
I am developing a lending spreadsheet books ...
Like it when a column was written " LATE " ( let's assume it is cell D2 ) , an email was sent ( we assume that the registered e- mail was in cell G2 ) automatic for the user who took the borrowed book, saying that the delivery date has passed.
It is possible? Although not natively ...
If possible with the code
Grateful.
you can use this link and you can create otherwise if you want i can do for u but you have to pay :p
https://developers.google.com/apps-script/articles/sending_emails
https://sites.google.com/site/scriptsexamples/available-web-apps/add-reminders-to-spreadsheet

Obtain credits for a specific day

I can use the following to obtain a list of all my credits
<?php
$marketplace = Balanced\Marketplace::mine();
$credits = $marketplace->credits->query()->all();
?>
I can modify this to obtain the credits for a specific customer
$credits = $customer->credits->query()->all();
Note the chance is from querying $marketplace to querying $customer.
Can I modify all() or by other means obtain credits with different parameters.
e.g. Credits in the last 24 hour or for a specific day,...
I know I can get the entire list of credits and then search though it but it seems resource hungry to get everything if only a sub-section is required.
I believe you can filter like this
$customer->credits->query()->filter(
Credit::$f->created_at->lt($before),
Credit::$f->created_at->gte($after),
)->all();
Here's another example on the internet that shows how to filter via the meta field too - https://gist.github.com/mjallday/5166040

joomla chronoform saving data

I have a problem with chronoform.
I created my form and everything. but when people input data, sometimes it doesn't get saved, sometimes the data look strange (encrypted?), but when it's me trying the form, it always works!
here an example of the strange data:
REGISTRATION DATE 2011-02-24 - 08:24:14
NAME xjvcZiqVZOf
SURNAME mbYCUldaGCfE
CHARGE CDOWWXMGA
CARD FdaYQzKjvJRjDdHiN
PHONE fUCjEIKBOQgBdtRUcdS
EMAIL qwrelb#gzblvr.com
HOW DID YOU GET TO KNOW THE LABMOND? w2yCfW iuykmqzzrasu,[url=http://stxpmgksgwqu.com/]stxpmgksgwqu[/url], [link=http://qdchzokvtmyk.com/]qdchzokvtmyk[/link], http://fxbqxghstmyn.com/
LABMOND LEVEL 2° Livello
LOCAL OFFICE Campobasso
Any idea?
Turn on the built in captch or ReCaptcha, I bet these submissions are bots.

Problem in GWT realex integration while registering new card

In my application I am using realex to pay amount.While doing that I registered new user with realex but after that when I tried to add new card then I am getting response from realex that Sha1 hash incorrect.I checked sha1 hash structure it is all right but still I am getting this error.If anyone know this so please tell me.
may be you missing any dot in your SHA1 Generation method
Chk it.
You were trying to process a card-new transaction I believe? The correct fields to use in the sha1hash are
timestamp.merchantid.orderid.amount.currency.payerref.chname.cardnumber
In a card-new request, amount and currency will be blank, so you will create a string by concatenating the other values joined with dots, e.g.
20130312105733.yourclientid.yourorderid...yourpayerref.cardholdername.4242424242424242
Get the sha1hash of this (make sure you convert the resulting hash to lower case hex letters! This is vital so that the next step is performed the same way Realex do it)
fc63ee950d69f275a0d54927072e4d675133ccfd
(Not: FC63EE950D69F275A0D54927072E4D675133CCFD - your SHA1 library may produce upper case hashes - you must convert to lowercase.)
Then add a dot and your secret and hash again.
fc63ee950d69f275a0d54927072e4d675133ccfd.yoursecret
To get:
112bf11fae62dc3116800b4a00457206dc2f1308
Again, make sure you convert to lowercase hex letters like I have.
Owen
Make sure you pass the right data as perameters.. I'm currently using below method and it works fine on my site..
$today_timestamp :- Current timestamp
$merchant_id :- your merchantID
$order_id: make sure you are passing the right order id and validated using the rules provided in the developer documentation..
$amount :- Current Price. This has to be full digit. ex: if a user wants to pay $4 then it has to be 400..
$currency:- ths is GBP in my case..
$sha1hash = $today_timestamp . "." . $merchant_id . "." . $order_id . "." . $amount . "." . $currency ;
$sha1hashed_string = sha1($sha1hash);
$string_with_shared_secret = $sha1hashed_string . "." . $shared_secret;
$sha1hash_string = sha1($string_with_shared_secret);