The Imaginary Scenario:
The Affiliates earn money on my website by selling items/services/widgets to their clients. You can think of it as a simple affiliate program. This money is stored in a single account until the Affiliate requests their money.
The Affiliates don't want to wait for a check to come in the mail; they want to log-on to their administration section (on my site) and click the magical "Transfer My Hard-Earned Money Now! Fool" button and have their millions deposited directly to their bank account (this transfer might take "3-4 days" if it has to --- the Affiliates just want to feel like they can always take control over their money).
Now, PayPal already does the "Send My Hard-Earned Money Now! Fool." function just fine. Their API even allows transferring money from one Paypal account to another; it just doesn't allow deposits to bank accounts. The Affiliates are lazy and don't want to log-in to their Paypal account to transfer their money.
So, what can a developer do?
I don't want to bother with Storing Credit Card information (PCI compliance...no thank you).
I don't really care to integrate directly with a bank
I want to (in psudeo code):
.
// affiliate and crdentials are pulled from my database.
Affiliate affiliate = db.Affiliates.GetByID(123456);
Credentials creds = affiliate.GetBankCredentials();
// paymentAPI is, well, its an API.
Xml response = paymentAPI.InitiateMoneyTransfer({from: myAccountCrdentials, to: creds, amount: 123, currency: "USD"});
if(response.success){
print "Bling Bling! Transfer initiated";
}
else{
print response.msg;
}
p.s. I'm in the USA
Go with a different payment processor/gateway. Use Paypal for Paypal related accounts/transactions, and Authorise.NET, Chase Payment TEK or similar provider of the sort to do deposits to real bank accounts.
You will not be able to get away with PCI compliance. Moreover, you will not be able to get away without a payment gateway such as the one's listed above.
So the scenario is simple:
Return (from paypal)
Paypal->YourBankAccount->Authorize.NET->Consumer Account.
Return (from your bank account)
YourBankAccount->Authorize.NET->Consumer Account.
We decided to go with ACH Works for our project. It's the only provider I found that understood exactly what I wanted to do (which is very similar to what you're doing), and was very helpful in explaining exactly how to do it. They have a very simple SOAP API for triggering ACH transfers.
Another possible option is PayPal's PayFlow Pro ACH Payment Service.
Here's the PayFlow Pro ACH API Doc.
Someone else recommended Payments Gateway, but I don't have any experience with them...
Related
When I send to PayPal the data the client wants to buy from my store I get an approval link. After the client check out I execute the payment.
I want to add my client username to the payment. After it will execute I will get the payment information and also the username and I will know which username paid me.
Is that possible to add another information to payments?
I actually don't think thats possible.
I remember we tried to add customerID to the call without succeeding.
What we did was to save the userdata we wanted to add to the request along with a session ID and then took the payment/order ID that you receive after making the call to Paypal and match the session ID with the one you saved before the request.
Something like that anyway, was a while ago :)
I need to integrate PayPal Payment Preapproval in my already working Adaptive Payments app. I found this .NET sample, which explains a lot of things, but I still don't get the whole picture. I have a few questions, if anyone can explain.
I make a call to set up the preapproval. Then I make a call to set up the first payment, or to set up the payment plan and it will automatically charge the client on the spacified basis?
I make the two calls separetely(in different methods), or I have to make them in a single method, one after the other? If they are seperate methods, Paypal will return some of the information, or I have to put the approved key in the url and then store locally some info with this key(so I can retrieve it)?
Do I get IPN for both calls? Is there an IPN sample, so I can see what does the call include?
I read the integration guid on the PayPal site, but it does not explain these things.
The Preapproval API gives you a preapproval key for the buyer that allows your app to make payments on their behalf at any time in the future without further approval.
You would simply pass the preapproval key into the Pay API along with the amount you're paying and other payment details, and the payment happens right away upon that Pay request completing successfully. No redirect to PayPal or anything at that point. It just processes the payment instantly because you have a preapproval key.
So with a database full of preapproval keys you could build your own subscription system (I'm assuming that's what you're doing..??)
So if you want to charge somebody once per month, or per week, per day, per minute, or whatever, you would build that logic into your own system, and just use the preapproval keys to process payments when necessary via the Pay API.
You will get IPNs for each step in the process.
Here's an example of an IPN you'd get when a preapproval profile is created:
[max_number_of_payments] => null
[starting_date] => 2016-07-19T00:00:51.000-07:00
[pin_type] => NOT_REQUIRED
[currency_code] => USD
[sender_email] => mrudul#talentslist.com
[verify_sign] => ApPqhQzUdN-1AdXqLkHRLMacdubFA00qBz08sedMIOkLAaOPPyc726Fs
[test_ipn] => 1
[date_of_month] => 0
[current_number_of_payments] => 0
[preapproval_key] => PA-3A023836LS390262L
[ending_date] => 2016-10-18T23:59:51.000-07:00
[approved] => true
[transaction_type] => Adaptive Payment PREAPPROVAL
[day_of_week] => NO_DAY_SPECIFIED
[status] => ACTIVE
[current_total_amount_of_all_payments] => 0.00
[current_period_attempts] => 0
[charset] => windows-1252
[payment_period] => 0
[notify_version] => UNVERSIONED
You'll get different IPNs when the Pay requests take place, too. One important thing to remember with IPN when using Adaptive Payments is that the URL you set in ipnNotificationUrl is "app specific" and will contain details related to the app itself. The PayPal account that receives the payment would need IPN configured to get an IPN with more payment specific details.
So if you have an app setup using ipnNotificationUrl and the payment is going to your own PayPal account which also has IPN configured with it, you would get 2 separate IPNs for that transaction. One for the preapproval profile being created (app specific from the API request) and another for the payment being made (transaction specific from the PayPal account profile).
Hope that helps.
Preapproval Key is useful for future payment. When you are calling preapproval, you have to set up a starting date and an ending date. After successfully calling API, you have to redirect your buyer to agree it and then you will get the pre-approval key. In the future you can use the pre-approval key with Pay API to charge your buyer without their consent because they have already agree it before.
But be careful, the key only works during the period you set up and buyers can always cancel it by themselves.
Surely, you will get IPN after succesfully calling preapproval or pay with preapproval-key.
I've sucesfully integrated paypal's express checkout and IPN notifications, therefore I have problem with recurring payments. I use NVP API to make request with method: CreateRecurringPaymentsProfile it goes well and returns profileId (eg I-GK8NCPH2N712). and profileStatus (eg. ActiveProfile). But when I request GetRecurringPaymentsProfileDetails with this profileId I get error 11546 with description:
Profile ID is not valid for this account. Please resubmit request with the correct profile ID.
I've checked that profileId is correct at the buyer and also seller page in history.
Is it an issue with sandbox environment? Or maybe is it something that profile start is delayed in time, it will start after one month (property PROFILESTARTDATE)? Or maybe a merchant can't access recurring payment, but that would be pretty disaster.
Please share any ideas, what to check or what could it be.
I resolved my problem after reading article of Derek MacDonald:
http://derekmd.com/2009/02/paypal-development-the-art-of-obfuscation/
Problem was that I had created profile using API credentials of one seller and then tried to do something using another seller with different credentials.
Stupid fool of me, but as Derek MacDonald wrote, error message could be a bit more informative...
If an anonymous user on a site returns multiple times in a certain period (lets say three times a week), then I need to suggest the user to log in/register on the site.
I was thinking about keeping this info in a cookie, but is there a better way of doing this? Or maybe a standardized way build in .NET or in a third party library?
For anonymous user the only way is the cookie.
You place an encrypted ID to the cookie and connect that id with your anonymous user on the database.
Google set up advertising cookies to last for 30 days for example
http://www.google.com/privacy/ads/
Google analytic set up up to 2 years
http://code.google.com/apis/analytics/docs/concepts/gaConceptsCookies.html
Google Analytics sets an expiration date of 2 years for unique visitor
tracking. However, if your visitors delete their cookies and revisit
your site, then Google Analytics will set new cookies (including new
unique visitor cookies) for those visitors. While you can configure
the duration of a user session cookie (from the default 30 minutes)
using the _setSessionCookieTimeout() method, you cannot configure the
duration of the unique visitor cookie.
There are a few ways, but they not 100% accurate. That said, a cookie would be adequate for your situation.
One other way is that you can check the and store the visitor's IP address combined with the UserAgent value. This might not be entirely accurate since sometimes a company could have lots of internal users, but using only one public IP address.
Hope this helps. Cheers.
You can also use Javascript and localStorage to display the information.
if (localStorage.getItem('lastVisit')) {
alert('You have been here before!');
} else {
localStorage.setItem('lastVisit', new Date());
}
In short, just use a cookie, there isn't anything wrong with this method. Also, this allows the user to clear such information from their system and is the expected behavior of a website from an end-user, so its good practice.
Also quickly, a 'Visitor' is generally defined as a visit from a unique address (eg. IP Address). So you would want to check the IP to consider it as the same visitor. If they visit the website from a different IP, that would be considered a second visitor which is also expected behavior. You could go a bit further here though, and check the browser and consider that a separate visitor, or other specific information that would be available through all web browsers.
Conclusion, just use a cookie and IP Address, try not to over-complicate it, and definitely don't choose an option that isn't cross-browser if you don't go the cookie/IP route.
Hope this helped.
I'm trying to use AdaptivePayments to send funds from one user to another user via my site, so I can check whether or not they've actually gone through with the payment. The payment goes through, but they're not returned to my site so I can't track the payment.
I'm redirecting to `https://www.sandbox.paypal.com/webscr&cmd=_ap-payment&paykey=MYKEY
But I jsut get takn to 'My Account' and see the payment is successful, but not redirected.
I've also tried redirecting to https://sandbox.paypal.com/webapps/adaptivepayment/flow/pay?&paykey=MYKEY but I get:
This transaction has already been approved. Please visit your PayPal
Account Overview to see the details.
I'm redirecting by setting is NVPRequest["returnUrl"] = "http://mysite.com/APReturn.aspx but this is seemingly ignored. Is there a way to do this or a better method of achieving what I need?
Late, but for those who come across this on Google:
You should redirect to https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_ap-payment&paykey=MYKEY (note the addition of cgi-bin and change of & to ?).
In addition, I would strongly discourage you of using the return page as a means to track a buyer. Buyers can (and will) close their browser as soon as a payment has been completed.
Instead, I'd highly suggest looking into using PayPal Instant Payment Notifications (IPN).
PayPal IPN allows you to (asynchronously) process order information while not having to depend on the buyer to return to your website to complete the order.
You can use IPN by setting up a script which receives this (POST) data from PayPal. In addition, you must include the following code in your button and/or API call(s):
For Website Payments Standard (where "xxxxxxxx" is the full URL to your IPN script):
For Express Checkout:
Include NOTIFYURL=xxxxxxxx in your SetExpressCheckout and DoExpressCheckoutPayment API call
For Website Payments Pro
Include NOTIFYURL=xxxxxxxx in your DoDirectPayment API call
For Adaptive Payments
Include ipnNotificationUrl in your Pay request.
You can find sample code, documentation and further information on PayPal IPN at https://www.paypal.com/ipn
Not sure but have you tried this https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_AdaptivePayments.pdf ? Try to run serch through the documenet with keyword='returnurl' or keyword='retrun url'
Turns out that setting the email of the sender pre-approves the transaction.
The reason for the "This transaction has already been approved" may be that you're using an incorrect test account as the "sender" in the call to the PAY api.
Here's how to create the correct test account: http://www.pashabitz.com/2011/12/18/Adaptive+Payments+Error+This+Transaction+Has+Already+Been+Approved.aspx