Can the PayPal Sandbox "charge" a transaction fee? - paypal

I am trying to test how my listener file treats PayPal transactions, but the Sandbox does not pass anything about the transaction fee. I am pretty sure that the live PayPal site does pass the transaction fee to a listener file.
Here is what is posted to the listener file:
mc_gross => 25.00
protection_eligibility => Ineligible
address_status => confirmed
item_number1 => C-1001
tax => 0.00
item_number2 => C-1002
payer_id => XXXXXXXXXXXXX
address_street => 1 Main St
payment_date => 15:10:14 May 27, 2013 PDT
payment_status => Pending
charset => windows-1252
address_zip => 95131
mc_shipping => 0.00
mc_handling => 0.00
first_name => Jon
address_country_code => US
address_name => Jon Doe
notify_version => 3.7
custom => *Member ID passed as custom variable*
payer_status => verified
address_country => United States
num_cart_items => 2
mc_handling1 => 0.00
mc_handling2 => 0.00
address_city => San Jose
verify_sign => XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-999999999999999999999999
payer_email => jon#mydomain.com
mc_shipping1 => 0.00
mc_shipping2 => 0.00
tax1 => 0.00
tax2 => 0.00
txn_id => XXXXXXXXXXXXXXXXX
payment_type => instant
last_name => Doe
address_state => CA
item_name1 => General Expenses
receiver_email => finance#ourdomain.org
item_name2 => Building Fund
quantity1 => 1
quantity2 => 1
pending_reason => unilateral
txn_type => cart
mc_gross_1 => 10.00
mc_currency => USD
mc_gross_2 => 15.00
residence_country => US
test_ipn => 1
transaction_subject => *Member ID passed as custom variable*
payment_gross => 25.00
ipn_track_id => 9999999999999

You should see variables for mc_fee and payment_fee. If you are not seeing thise variables, can you provide the transaciton id and I can take a look at it on my side. Also, you can find a list of the IPN/PDT variables listed here.

Related

Paypal (NVP APIs) how to discount for the order?

For example, this is my request paramaters,the order total is 270.00, if I want to use a coupon($10.00) to discount this order, than the order total must be 260.00, but now, I can't find any about discount AMT parameter in this api (https://developer.paypal.com/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/), I neglect it?
Array(
[PAYMENTREQUEST_0_CURRENCYCODE] => USD
[PAYMENTREQUEST_0_PAYMENTACTION] => Sale
[PAYMENTREQUEST_0_AMT] => 270.00
**[some parameter? DISCOUNT_AMT ?] => 10.00 // have this parameter ??**
[PAYMENTREQUEST_0_ITEMAMT] => 219.00
[PAYMENTREQUEST_0_SHIPPINGAMT] => 39.00
[PAYMENTREQUEST_0_HANDLINGAMT] => 12.00
[L_PAYMENTREQUEST_0_AMT0] => 219.00
[L_PAYMENTREQUEST_0_QTY0] => 1
[L_PAYMENTREQUEST_0_NAME0] => Goods title
[L_PAYMENTREQUEST_0_DESC0] => Goods description
);
Sorry about my poor English, thanks for buddies.
You will need to add the discount as an additional line item with a negative value and then adjust the ITEMAMT and AMT accordingly.
Array(
[PAYMENTREQUEST_0_CURRENCYCODE] => USD
[PAYMENTREQUEST_0_PAYMENTACTION] => Sale
[PAYMENTREQUEST_0_AMT] => 260.00
[PAYMENTREQUEST_0_ITEMAMT] => 209.00
[PAYMENTREQUEST_0_SHIPPINGAMT] => 39.00
[PAYMENTREQUEST_0_HANDLINGAMT] => 12.00
[L_PAYMENTREQUEST_0_AMT0] => 219.00
[L_PAYMENTREQUEST_0_QTY0] => 1
[L_PAYMENTREQUEST_0_NAME0] => Goods title
[L_PAYMENTREQUEST_0_DESC0] => Goods description
[L_PAYMENTREQUEST_0_AMT1] => -10.00
[L_PAYMENTREQUEST_0_QTY1] => 1
[L_PAYMENTREQUEST_0_NAME1] => Discount
[L_PAYMENTREQUEST_0_DESC1] => Coupon Code ABC123
);

PayPal Express Checkout Shipping Address should not be editable

I have already spent a lot of hours to find an answer for my problem but unfortunately i can't find a soloution.
I implement PayPal (Express Checkout) in our Shop-System. In our shop, the customer enters his shipping address. I don't want the customer to get the option to change his shipping address in PayPal. I only want the shipping address to be displayed which was entered before.
For example, here is an express checkout implementation like I want it:
Shipping Address only displayed:
How can i make this possible?
I use the PayPalSDK for ASP.NET
In your SetExpressCheckout request you can add the ADDROVERRIDE parameter and set its value to 1. Then make sure to include the shipping address parameters in your SEC request as well.
What this will do is simply display the address you pass over to PayPal without the ability for the user to change it.
The value 1 indiciates that the PayPal pages should display the
shipping address set by you in the SetExpressCheckout request, not the
shipping address on file with PayPal. This does not allow the
customer to edit the address here. Must be 1 or 0
Here's a sample of an SEC request I just sent to the PayPal sandbox:
[REQUESTDATA] => Array
(
[USER] => *****
[PWD] => *****
[VERSION] => 97.0
[BUTTONSOURCE] => AngellEYE_PHPClass
[SIGNATURE] => *****
[METHOD] => SetExpressCheckout
[MAXAMT] => 200.00
[RETURNURL] => http://paypal.angelleye.com/standard/samples/DoExpressCheckoutPayment.php
[CANCELURL] => http://paypal.angelleye.com/paypal/class/cancel.php
[REQCONFIRMSHIPPING] => 0
[NOSHIPPING] => 1
[ALLOWNOTE] => 1
[ADDROVERRIDE] => 1
[BRANDNAME] => Angell EYE
[CUSTOMERSERVICENUMBER] => 555-555-5555
[BUYEREMAILOPTIONENABLE] => 1
[SURVEYENABLE] => 1
[BUYERREGISTRATIONDATE] => 2012-07-14T00:00:00Z
[PAYMENTREQUEST_0_AMT] => 100.00
[PAYMENTREQUEST_0_CURRENCYCODE] => USD
[PAYMENTREQUEST_0_ITEMAMT] => 80.00
[PAYMENTREQUEST_0_SHIPPINGAMT] => 15.00
[PAYMENTREQUEST_0_TAXAMT] => 5.00
[PAYMENTREQUEST_0_DESC] => This is a test order.
[PAYMENTREQUEST_0_SHIPTONAME] => Tester Testerson
[PAYMENTREQUEST_0_SHIPTOSTREET] => 123 Test Ave.
[PAYMENTREQUEST_0_SHIPTOCITY] => Kansas City
[PAYMENTREQUEST_0_SHIPTOSTATE] => MO
[PAYMENTREQUEST_0_SHIPTOZIP] => 64111
[PAYMENTREQUEST_0_SHIPTOCOUNTRY] => US
[PAYMENTREQUEST_0_SHIPTOPHONENUM] => 816-555-5555
[PAYMENTREQUEST_0_NOTETEXT] => This is a test note before ever having left the web site.
[PAYMENTREQUEST_0_PAYMENTACTION] => Sale
[L_PAYMENTREQUEST_0_NAME0] => Widget 123
[L_PAYMENTREQUEST_0_DESC0] => Widget 123
[L_PAYMENTREQUEST_0_AMT0] => 40.00
[L_PAYMENTREQUEST_0_NUMBER0] => 123
[L_PAYMENTREQUEST_0_QTY0] => 1
[L_PAYMENTREQUEST_0_ITEMURL0] => http://www.angelleye.com/products/123.php
[L_PAYMENTREQUEST_0_NAME1] => Widget 456
[L_PAYMENTREQUEST_0_DESC1] => Widget 456
[L_PAYMENTREQUEST_0_AMT1] => 40.00
[L_PAYMENTREQUEST_0_NUMBER1] => 456
[L_PAYMENTREQUEST_0_QTY1] => 1
[L_PAYMENTREQUEST_0_ITEMURL1] => http://www.angelleye.com/products/456.php
[L_PAYMENTREQUEST_0_ITEMCATEGORY1] => Digital
)
And here's what I see when I log in to PayPal as the buyer after this SEC call...

Paypal sandbox 'Pending' multicurrency

Im currently using PayPals rest api. When executing payment it is returning as 'Pending' and the reason its stating is 'Multi Currency'.
The reason behind this is because the default 'facilitators' account is set to US i need it to all be in GB. The problem is I can login to user-facilitators#email.co.uk's account on sandbox.paypal.co.uk. I'm entering the email and password (which is 100% correct) and It wont let me login to sandbox so I can change the currency preferences back to GBP.
Does anybody no why?
In order to log into a Sandbox Paypal account, you have to be logged into your Paypal Developer Account
as the default 'facilitators' account is set to US and you want to change it to other country. but this edit is not possible in sandbox.
so an alternate solution is to create an another sandbox account and set it to business account. set your desired country and then currency will be your country currency, automatically.
after doing this, use this business account for testing instead of that default 'facilitators' account.
like this you can create any number of business accounts for any country/currency.
hope this will help to you and understood.
Yes, once we register on Paypal developer site, as default, Paypal will issue us two default test account, one is merchant account and another is user test account. All there are fine.
But the problem is their default currency is US, and We can't change them.
When your Magento store's base currency has been set others, like AU, this issue definitely will come out with following system log:
[CURRENCYCODE] => AUD
[PAYMENTSTATUS] => Pending
[PENDINGREASON] => multicurrency
Create another merchant account and set the same currency with your Magento store, it will be fixed.
payment_paypal_express.log
2014-12-12T01:51:34+00:00 DEBUG (7): Array
(
[url] => https://api-3t.sandbox.paypal.com/nvp
[GetTransactionDetails] => Array
(
[TRANSACTIONID] => 15Y48062WM0910211
[METHOD] => GetTransactionDetails
[VERSION] => 72.0
[USER] => ****
[PWD] => ****
[SIGNATURE] => ****
[BUTTONSOURCE] => OneStepCheckout_SI_MagentoCE
)
[response] => Array
(
[RECEIVEREMAIL] => john.yin.au-facilitator#gmail.com
[RECEIVERID] => VQ37QYGD3SFPW
[EMAIL] => john.yin.au-buyer#gmail.com
[PAYERID] => LXDH2RT89NRAS
[PAYERSTATUS] => verified
[COUNTRYCODE] => US
[SHIPTONAME] => john h
[SHIPTOSTREET] => 33
[SHIPTOSTREET2] => esdfd re
[SHIPTOCITY] => ddw
[SHIPTOSTATE] => AL
[SHIPTOCOUNTRYCODE] => AU
[SHIPTOCOUNTRYNAME] => Australia
[SHIPTOZIP] => 34343
[ADDRESSOWNER] => PayPal
[ADDRESSSTATUS] => Confirmed
[INVNUM] => 100000036
[SALESTAX] => 0.00
[TIMESTAMP] => 2014-12-12T01:51:34Z
[CORRELATIONID] => 2ef746f5f1a77
[ACK] => Success
[VERSION] => 72.0
[BUILD] => 14077178
[FIRSTNAME] => Test
[LASTNAME] => Buyer
[TRANSACTIONID] => 15Y48062WM0910211
[TRANSACTIONTYPE] => cart
[PAYMENTTYPE] => instant
[ORDERTIME] => 2014-12-12T01:50:39Z
[AMT] => 44.00
[TAXAMT] => 0.00
[SHIPPINGAMT] => 0.00
[HANDLINGAMT] => 0.00
[CURRENCYCODE] => AUD
[PAYMENTSTATUS] => Pending
[PENDINGREASON] => multicurrency
[REASONCODE] => None
[PROTECTIONELIGIBILITY] => Eligible
[PROTECTIONELIGIBILITYTYPE] => ItemNotReceivedEligible,UnauthorizedPaymentEligible
[L_NAME0] => color swatch te
[L_NUMBER0] => ZP-D3241-WHITE-L
[L_QTY0] => 1
[L_TAXAMT0] => 0.00
[L_SHIPPINGAMT0] => 0.00
[L_HANDLINGAMT0] => 0.00
[L_CURRENCYCODE0] => AUD
[L_AMT0] => 44.00
)
[__pid] => 30696
)

PAYPAL IPN custom field missing

I'm facing troubles implementing paypal recurring payment with the API process and the sandbox.
I succeed to create the subscription button and redirect the user to the paypal express checkout page.
But the custom field is missing in some IPN generated by paypal and I really need this field.
Here are the requests I send while generating the subscription button:
METHOD=SetExpressCheckout
&VERSION=94.0
&PWD=123456
&USER=myEmail#biz.com
&SIGNATURE=mySignature
&PAYMENTREQUEST_0_AMT=5.00
&PAYMENTREQUEST_0_PAYMENTACTION=Sale
&PAYMENTREQUEST_0_CURRENCYCODE=EUR
&RETURNURL=http%3A%2F%2Fwww.myWebSite.com?ok
&CANCELURL=http%3A%2F%2Fwww.myWebSite.com?ko
&L_BILLINGTYPE0=RecurringPayments
&L_BILLINGAGREEMENTDESCRIPTION0=test+paypal
&REQCONFIRMSHIPPING=0
&NOSHIPPING=1
&L_PAYMENTREQUEST_0_ITEMCATEGORY0=Digital
&L_PAYMENTREQUEST_0_NAME0=test+paypal
&L_PAYMENTREQUEST_0_AMT0=5.00
&L_PAYMENTREQUEST_0_QTY0=1
&PAYMENTREQUEST_0_CUSTOM=custom_var1%3Dvalue1%7Ccustom_var2%3Dvalue2
After the user has confirmed the transaction, he is coming back to my website and I have to verify the informations and to create the recurring profil.
Here are the requests I do :
METHOD=GetExpressCheckoutDetails
&VERSION=94.0
&PWD=123456
&USER=myEmail#biz.com
&SIGNATURE=mySignature
&TOKEN=theToken
METHOD=CreateRecurringPaymentsProfile
&VERSION=94.0
&PWD=123456
&USER=myEmail#biz.com
&SIGNATURE=mySignature
&TOKEN=theToken
&AMT=5.00
&CURRENCYCODE=EUR
&PROFILESTARTDATE=2013-02-04T15%3A16%3A24%2B01%3A00
&BILLINGPERIOD=Day
&BILLINGFREQUENCY=1
&DESC=test+paypal
METHOD=DoExpressCheckoutPayment
&VERSION=94.0
&PWD=123456
&USER=myEmail#biz.com
&SIGNATURE=mySignature
&TOKEN=theToken
&PAYERID=JZUVX4TAHRHRU
&PAYMENTREQUEST_0_PAYMENTACTION=Sale
&PAYMENTREQUEST_0_AMT=5.00
&PAYMENTREQUEST_0_CURRENCYCODE=EUR
&PAYMENTREQUEST_0_NOTIFYURL=http%3A%2F%2Fwww.myWebSite.com?notify
&PAYMENTREQUEST_0_CUSTOM=custom_var1%3Dvalue1%7Ccustom_var2%3Dvalue2
After doing this I receive these IPN :
Array
(
[transaction_subject] => test paypal
[payment_date] => 06:01:52 Feb 04, 2013 PST
[txn_type] => express_checkout
[last_name] => numerik
[residence_country] => FR
[item_name] =>
[payment_gross] =>
[mc_currency] => EUR
[payment_type] => instant
[protection_eligibility] => Ineligible
[verify_sign] => myVerifySign
[payer_status] => verified
[test_ipn] => 1
[tax] => 0.00
[payer_email] => myEmail#per.com
[txn_id] => 6XC11065S3796804E
[quantity] => 1
[receiver_email] => myEmail#biz.com
[first_name] => buyer
[payer_id] => myPayerId
[receiver_id] => myReceiverId
[item_number] =>
[handling_amount] => 0.00
[payment_status] => Completed
[payment_fee] =>
[mc_fee] => 0.42
[shipping] => 0.00
[mc_gross] => 5.00
[custom] => custom_var1=value1|custom_var2=value2
[charset] => windows-1252
[notify_version] => 3.7
[ipn_track_id] => ab76ea3421261
)
Array
(
[payment_cycle] => Daily
[txn_type] => recurring_payment_profile_created
[last_name] => numerik
[next_payment_date] => 02:00:00 Feb 04, 2013 PST
[residence_country] => FR
[initial_payment_amount] => 0.00
[currency_code] => EUR
[time_created] => 06:01:47 Feb 04, 2013 PST
[verify_sign] => myVerifySign
[period_type] => Regular
[payer_status] => verified
[test_ipn] => 1
[tax] => 0.00
[payer_email] => myEmail#per.com
[first_name] => buyer
[receiver_email] => myEmail#biz.com
[payer_id] => myPayerId
[product_type] => 1
[shipping] => 0.00
[amount_per_cycle] => 5.00
[profile_status] => Active
[charset] => windows-1252
[notify_version] => 3.7
[amount] => 5.00
[outstanding_balance] => 0.00
[recurring_payment_id] => myRecurringPaymentId
[product_name] => test paypal
[ipn_track_id] => a8adfdf8b61d3
)
As you can see in the 1st IPN the field custom is available but not in the second one.
Does anyone know what I'm missing for retrieving the custom field in the 2nd IPN ?
Your DoExpressCheckoutPayment request includes the custom parameter which is why you're getting it back for that transaction. Your CreateRecurringPaymentsProfile request does not have a custom parameter included, so it would not come back.
That said, it doesn't look like the custom parameter is available to CRPP so you'll need to save your data locally and include your local record ID in the PROFILEREFERENCE paramter of your CRPP request. This way it will come back in IPN as rp_invoice_id like Matt Cole suggested, and you can pull your custom data back out of your database using that record ID accordingly.
Your best bet is to add PROFILEREFERENCE to your CreateRecurringPaymentsProfile call. It will come back in the IPN as rp_invoice_id.

paypal IPN get buyer transaction ID

I need the buyer transaction ID that correspond to the transaction PayPal notifies me by IPN.
I'm using
$_POST['txn_id']
but this stores the transaction ID for the seller, not the transaction ID of the buyer. At the same time the buyer hasn't access to the transaction ID of the seller.
I understand that PayPal assign two different transactions ID, but the seller needs to stores the buyer transaction ID in order to be able to communicate with the user about an specific transaction.
Anyone know how I can receive (or search for) the buyer transaction ID when PayPal send a notification to my IPN script?
I only receive the follow data:
Array
(
[mc_gross] => 7.00
[protection_eligibility] => Ineligible
[payer_id] => F6912JHUIIHA
[tax] => 0.00
[payment_date] => 10:14:55 Sep 11, 2011 PDT
[payment_status] => Completed
[charset] => windows-1252
[first_name] => Name
[mc_fee] => 2.08
[notify_version] => 3.2
[custom] =>
[payer_status] => verified
[business] => myemail#gmail.com
[quantity] => 1
[verify_sign] => 123232jh4i32u4u3h5n435i43u5455645
[payer_email] => payermail#gmail.com
[txn_id] => 123u4324324yuy4574
[payment_type] => instant
[btn_id] => 35428120
[last_name] => lastname
[receiver_email] => receiver#gmail.com
[payment_fee] => 2.08
[shipping_discount] => 0.00
[insurance_amount] => 0.00
[receiver_id] => OIUWDWUERWEU
[txn_type] => web_accept
[item_name] => Product name
[discount] => 0.00
[mc_currency] => USD
[item_number] => PRODNum
[residence_country] => SE
[handling_amount] => 0.00
[shipping_method] => Default
[transaction_subject] => Product to sell
[payment_gross] => 7.00
[shipping] => 0.00
[ipn_track_id] => ydedi23484rl4itm54oi
)
From the looks of the list of variables paypal sends back, there is no buyer transaction id.
Another option:
Usually when you send your order information to paypal, you can include an invoice/order number, the buyer, if needed, is able to search his history by your invoice number (the same way they would search by transaction id) if you include it when you send the info to paypal.
You can use the GetTransactionDetails API and pass in the buyer's transaction ID.
A sample API call would be:
METHOD=GetTransactionDetails&
TRANSACTIONID=buyers transaction ID&
See also: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_GetTransactionDetails