Paypal Adaptive Chained Payment - paypal

I am super confused on what this documentation is trying to say.(https://developer.paypal.com/docs/classic/adaptive-payments/integration-guide/APCallsHeadersAndPaymentTypes/)
Basically, I am trying to facilitate payments between 2 users. I also want to have a fee paid to me during this transaction. The confusing part of the documentation are the headers.
According to the reference you need these.
headers.put("X-PAYPAL-SECURITY-USERID", "tok261_biz_api.abc.com");
headers.put("X-PAYPAL-SECURITY-PASSWORD","123456");
headers.put("X-PAYPAL-SECURITY-SIGNATURE","Signature"
headers.put("X-PAYPAL-REQUEST-DATA-FORMAT", "JSON");
headers.put("X-PAYPAL-RESPONSE-DATA-FORMAT", "JSON");
headers.put("X-PAYPAL-APPLICATION-ID", "APP-APPID");
I don't know what to put for X-PAYPAL-SECURITY-USERID or X-PAYPAL-SECURITY-PASSWORD. I do not want to put my actual username and password. Is this what I am supposed to be doing to achieve this?

Those are your API credentials. You obtain those values in your PayPal profile under API Access, then choose the signature method.
Alternatively, you can click this link and login with your PayPal account to quickly obtain those values.

Related

Paypal sandbox showing wrong STORE name

I have tested my paypal payment with sandbox account using my API details. Now I want to use Clients API details for sandbox and changed code accordingly. But it still redirects me to the previous store.
Any idiea what is wrong i am doing.
it looks like your code didn't change the API credentials in some way. Try to check again the new APIs that you want to use and replace the previous one.
Usually, for example in ExpressCheckout, when you initially call the SetExpressCheckout you provide the API credentials of the seller so that when the checkout is displayed you can connect to the seller shop to pay and all the money will be directed there.

Paypal Pay Now Button

Been looking at the PayPal API documentation, there is so much to look it i thought i would ask here to get a more clear answer from someone that's done similar.
I'm looking to add a 'pay now' PayPal button to invoices that are generated by users within a web app for their customers. So a payment should never reach me at all. I understand that the button is probably the best option however it will need to be the encrypted button to be more secure.
I understand i need to use my PayPal account to be able to access the API and generate these encrypted buttons? it's literally just a matter of setting the item, cost and business parameters really, I don't want any transaction hitting my account.
What are my options? and is this even possible.
Thanks!
If you're familiar with web service API's skip the standard buttons altogether and just go with the Pay API.
That will allow users to easily pay by signing in to a PayPal or using a credit card (guest checkout). In most cases users would be authenticating the payment during checkout, but you could also tie in the ability for people to use Preapproval profiles so that future payments are automatic (or one-click, or whatever you want.) You use the Preapproval API to generate a preapproval key for the user, and then future Pay requests can include that key for immediate payment without further authentication.
If you're working with PHP my class library for PayPal will make this very simple for you.

Sending information using paypal API without creating a complete payment

Is there a way to use the paypal API to send basic details of a payment without actually creating the payment itself? What I mean is, I'm working with a non profit organization that does not currently employ SSL. They want to use paypal to accept donations, but they want their own branded form on their page, they don't want to use the simple donate button. I had thought I might be able to send basic details, such as name and address along with the amount they wish to donate and a few other details using the paypal API, and then have the actual payment information processed on paypal's secure servers. All the examples I can find on how to use their API however are creating complete payments and sending them to Paypal, something I'm not able to do for obvious reasons. Short of employing SSL, something that we should probably do anyways, and capturing a complete payment, is there a way of sending just select information over the API and handling the rest on paypal's end?
If you want to control the form itself you don't have any choice but to go SSL. Any other route would require sending the user to PayPal, where you would no longer have that control.

Paypal custom variable solution using php

I'm trying to using paypal as payment for my site.
My site only sell a virtual currency, like "Diamond" in Online game.
So after reading i starting to use Express Checkout for Digital Goods, Is that right ? or i must other payment method ?
Then my question is when using Express Checkout for Digital Goods, how to pass custom variable ?
Let say i want to pay user_id, diamond_id, and some other variable from my database to the paypal api. It seem like paypal don't support custom variable to pass on the api call. I want after user complete the payment, then Paypal notify my server that the payment is complete by user_id and some other variable that i pass, so easy for me to know the detail.
after searching i find some solution,
First solution is to store "TOKEN"(Generated from "SetExpressCheckout" Method) and my custom variable which is belong to the TOKEN in the database, Then after payment complete paypal will notify my server the same TOKEN saved before. So i will query based on the TOKEN.
Second Solution is using get style in RETURNURL variable http://www.mysite.com/successpayment.php?user_id=13&diamond_id=88 So i will easy to grab the GET variable.
Which solution is right ? Is there any solution ? and how to secure the payment confirmation, i mean if someone know and hack my returnurl.
Thanks in advance
There are two parts to be able to successfully identify your order in the whole process:
To identify your order when the user is redirected back via the success or cancel URL, just pass the order id via the query string of the URL.
To identify your order when Paypal sends notifications about the transaction and associated events (refunds, reversals, disputes etc.) via IPN: Paypal does support a pass-through variable, which allows you to associate IPNs to the order record in your DB.
For express checkout you set PAYMENTREQUEST_0_INVNUM in the SetExpressCheckout call
In case you are creating a recurring profile, the parameter is named PROFILEREFERENCE in the CreateRecurringPaymentsProfile call
When you receive an IPN the invoice is passed as 'invoice' or 'rp_invoice_id' respectively
(My general advice, though: use Paypal only if you really have to)

How to link username in site to PayPal information email?

It's not a problem but i don't know how to do this; let's say that I have a sign up form with some fields: username, password, email, as you know the user clicks on the BUY BUTTON and pay's up.
Well, how can I know the username that just made the payment, I mean how can I link those two things together, one idea it's to use the email address, but mose of the people sign up with different email addresses, mabe they have a different paypal address...you know...I need this information because I need a way to activate the account.
And I also need to know, if the user canceled a subscription will paypal post a message to my IPN link?
I suggest you use the following PHP script for easy integration with PayPal's service (assuming you're using PHP): http://www.micahcarrick.com/04-19-2005/php-paypal-ipn-integration-class.html
If you do, the e-mail you will be looking for will be supplied in
$paypal->ipn_data['payer_email']
(again, assuming that $paypal is your object of the paypal_class class)
Obviously you have to follow the setup steps first. I suggest using the example script. It is really easy to do - in only four steps.
I suggest you read the official paypal documentation about IPN and recurring payments.
PayPal issues a IPN for every event that occurs to the user subscription, for example:
subscr_signup
subscr_eot
subscr_cancel
subscr_failed
About the parameter, you can use a parameter named "custom" to pass a value, for example the user id or email, and that parameter will be sent you in every IPN.
Here are implementations of the PayPal IPN in both C# and VB:
http://www.xdevsoftware.com/PPIPNDesc.aspx
Here's an account of how I incorporated it into a PayPal subscriptions scenario:
http://www.codersbarn.com/post/2008/07/10/ASPNET-PayPal-Subscriptions-IPN.aspx