Does Paypal IPN mc_gross include shipping and handling? - paypal

I'm trying to setup a Paypal payment on a website and I'm analyzing IPN response to the cmd=_notify-validate request. The official documentation says that mc_gross is:
Full amount of the customer's payment, before transaction fee is subtracted.
From this statement, it seems that mc_gross includes all costs substained by customer (including shipping and handling costs). But documentation also talks about mc_shipping and mc_handling. So does mc_gross include shipping and handling or it's simply the sum of item costs?

Yes it does - it is the full payment amount which means everything included. mc_shipping etc are just variables to track what shipping amount was passed to Paypal.

Related

paypal reference transactions billing agreement

We require reference transactions via PayPal to bill customers monthly with varying amounts.
e.g. first month is $30, second month may be $35, third month may be $25 etc
So far this seems to be the best approach: https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECReferenceTxns/
I am using the PayPal recommended SDK from this page: https://developer.paypal.com/docs/classic/api/nvpsoap-sdks/
and using the ExpressCheckout Method. (paypal/merchant-sdk-php installed via composer)
We have a free PayPal business account.
Testing via Sandbox I am able to:
Get a token (SetExpressCheckout) - category->Digital, billingAgreement, Type=Sale
forward customer to sandbox paypal login
Confirm the payment
redirect back to our system (returnUrl)
Process the payment (GetExpressTocket + doExpressCheckout)
Questions:
Does the PayPal business account require any switch/status/upgrade to enable Reference transactions on the live environment?
How do you setup a $0 billing agreement to invoice an amount later in the month? When passing a 0 amount in step 1 above and error is displayed
Item name, amount and quantity are required if item category is
provided, ErrorCode 10003
This contradicts to documentation https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECReferenceTxns/#setting-up-a-billing-agreement-before-payment which states to set the amount to 0...?
UPDATE: Removing the setting $itemDetails->ItemCategory = 'Digital'; solved the $0 amount issue.
Billing ID is not returned even though I've passed the BillingAgreement data
// Billing agreement details
$billingAgreementDetails = new BillingAgreementDetailsType('MerchantInitiatedBillingSingleAgreement');
$billingAgreementDetails->BillingAgreementDescription = $billingAgreementTxt;
$setECReqDetails->BillingAgreementDetails = array($billingAgreementDetails);
I know there are a few questions within the post but I believe they are all related to the scope of 'Reference Transactions' within PayPal.
I'm looking for recommendations on approach and explanations to the contradictions in documentation. (or if I'm doing something wrong then happy to hear it)
To answer your question:
1) Does the PayPal business account require any switch/status/upgrade to enable Reference transactions on the live environment?
If you are receive an error when calling for Reference Transaction, probably that the setting is turned off in your account. You will need to contact PayPal Business Support team to enable it.
2) Billing ID is not returned.
To setup billing agreement, you will need to pass paymentaction=authorization in SetExpressCheckout request. You will not be able to setup billing agreement if you set the paymentaction as sale.

PP REST API charge tax and shipping without sending address?

Using the REST API, how can I charge tax or shipping if I send the user to PayPal to collect shipping information (and pay, of course)?
Doing some research it almost seems like that isn't possible, but I can't imagine that being the case. If I have to collect shipping information myself, the value prop for using PP is greatly reduced.
With the REST API, just like the Classic API, a PayPal payment is executed in three steps:
1) Send initial information to PayPal to get a token. Redirect customer to PayPal. Customer authorizes payment.
2) Get payment details (like the shipping address)
3) Confirm payment.
So, in this case, after getting the shipping address, you display an order review page to the customer where it will generate the shipping options and tax amount to the customer. They then have to select a "Confirm Order" button which will then finalize the charge to PayPal with the new tax/shipping and final amount.
In API terms, the final step is done with the /execute command. This accepts the payer_id you received in step 2, and a transactions array that supports a new amount object.
The amount object includes a details object that includes shipping, tax, handling fee, insurance, etc.
Include the details the customer decides on your review page and PayPal will charge the updated amount to the customer's funding source of choice.

Paypal API, What are its capabilities?

Well I asked though the paypal site, but have got no answer. I got the famous email with "Your question has been received. To review the status of your ticket, click on the link below." with no link in it. So I'm hoping I can get an answer here.
This is what I sent them:
It appears you have multiple APIs available and I'm having a hard time figuring out what the each API is capable of doing exactly. I want to create a site that in short, brings buyers and seller together. Here is what I am looking for:
Buyer and Seller make an agreement through site.
Buyer sends money, seller is unable to touch it yet though. (Basically can paypal secure a payment?)
Seller gets notice of money sent and notice to ship product ship product.
Alternative paths for step 4:
Buyer gets product and there are no issues, the buyer confirms the transaction and payment is released to the seller and a set % is sent to me. (Can paypal split payments?)
Seller never ships product or problem arise in shipping that cannot be resolved, paypal returns money to buyer without penalty. (Can paypal return funds without penalty?)
Product arrives, but has issues. There will be set penalties for said issues. Penalities are returned to the buyer, then rest is sent to seller and set % sent to me. (can paypal enact a penalty?)
Any general information or answers to my specific questions would be greatly appreciated. thank you for your time.
For #2, since you're the service provider, you'll be liable for product delivery. Paypal won't do it for you.
An ideal workflow would be:
Your buyers pay you
You withold the payment
Buyer okays the shipment
You keep your cut and pay the rest to the seller
If you have to refund your buyer (order cancellation, or some other reason), you can use paypal's refund api
To summarize, paypal is just a payment processor and would ensure that payment reaches from endpoint A to endpoint B. How you use paypal for your particular use cases is totally upto you.

Capture Card capabilities in PayPal Payments Pro

Capture Card as I understand it allows a seller to securely accept an online order with credit card name, number and code via a shopping cart. We can subsequently ship the order, add the freight to the invoice and submit the total amount to the credit card for payment. After the payment has been posted the credit card information is wiped from the order.
I was led to believe that I could do this with a PayPal Payments Pro account, so I created one and sent a test invoice through with my own credit card. The amount of the invoice with tax was immediately posted to my PayPal account without the opportunity to add freight.
Can anyone on this forum provide a solution or workaround?
Thanks!!
Are you processing this initially as a sale or an authorization. If you are wanting to use the DoDirectPayment API with Website Payments Pro, you could process a 1.00 authorization to validate the card. Then perform all of the calculations that you are needing to, and then process the payment using the DoReferenceTransaction API call where you send across the full amount you want to charge to the buyers card. You only have to reference the transaction id for the last successful 1.00 auth you did, and PayPal will use the same credit card information. Otherwise you could also process the DoDirectPayment API call with the full amount at the time of checkout, and just use the DoReferenceTransactions API call to charge any additional charges to where not initially charged such as tax and shipping.
Another option would be to use Express Checkout, and process the transaction as an order. This will allow you to make more then one authorization/capture against the order. You can also set a max amount in the Express Checkout API calls.

For a Paypal IPN what's the difference between auth_amount and mc_gross?

I'm having a hard time finding this out from the documentation. I have some code I've inherited which needs to get he payment amount from a Paypal IPN transaction. It's expecting the variable "auth_amount" from a Paypal IPN but is not getting passed this field. It looks to me from the Paypal docs as though I should be using the field "mc_gross" which is labelled as "Full amount of the customer's payment, before transaction fee is subtracted.".
The Paypal IPN docs describe the "auth_amount" field as "Authorization amount", which doesn't mean much to me.
I'm going to change it to use mc_gross, but I just want to check first that I'm not missing something silly?
Thanks!
Check this out:
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables
mc_gross
Full amount of the customer's
payment, before transaction fee is
subtracted. Equivalent to
payment_gross for USD payments. If
this amount is negative, it signifies
a refund or reversal, and either of
those payment statuses can be for the
full or partial amount of the original
transaction.