ReturnURL for Paypal Adaptive Payments - c#

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

Related

Redirect from successful stripe checkout

I am using Stripes payment gateway with C# .Net. I started with creating a checkout which redirects the user to Stripe's payment gateway (I didnt want the hassle of maintaining the card numbers etc so this way it forwards to Stripe to ask for the card details, process the payment etc) https://stripe.com/docs/payments/checkout/one-time - this was done in code-behind.
I set my success URL as www.example.com/myHandler.ashx (Generic Handler)- this URL sets the order id as successful. My handler code is similar to https://stripe.com/docs/webhooks/build (since im using a Generic Handler i'm using forms and not MVC)
After a successful payment, the payment is recorded to my database.
Considering this is a webhook, how do i display/redirect to a thank you page?
You have more than one way to solve this.
Option 1:
Combine the success page with your webhook. This means it will display the page to the user and update the state of the transaction on the backend.
your url would look like this
SuccessUrl = "https://example.com/success?session_id={CHECKOUT_SESSION_ID}"
Then use the session ID to handle the state change like you would with your webhook but return the html page to the user (Technically this wouldn't be a webhook).
Based on your question it could be that the SuccessUrl gives a session object as body because otherwise your current code shouldn't be working but I'm not sure.
To get the session object based on the Id you can make another call to stripe see:
https://stripe.com/docs/api/checkout/sessions/retrieve#retrieve_checkout_session
Once payment is successful, the Checkout Session will contain a reference to the Customer, and either the successful PaymentIntent or an active Subscription.
Option 2:
Create a webhook separately from your thank you page. This means that the SuccessUrl would be your thank you page.
The webhook needs to be defined separately and globally with stripe. You can look here on how this is done: https://stripe.com/docs/webhooks/configure

Add my extra data to PayPal payment in order to get it back after approval

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 :)

Which is paypal cancel url response parameter

I am using paypal sandbox account for testing purposes. When any user clicks on cancel and returns to the site, then which parameter will be received in the response?
?
I am trying to change "You'll be able to see your order details before you pay" text to "You will be able to view your order details before you pay".
Can any one have idea, How to it possible?
For the cancel url, you don't get any parameters in the response. The cancel url is the url you set either in your account or in your button using "cancel_return" parameter (documentation)
You cannot change that text, is part of PayPal's site. However, you can contact PayPal and tell them a very good reason for them to change that text.

Paypal sandbox doesn't recognize freshly returned ProfileID (error 11546)

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...

Sending money from [SomePaymentProcesingCompany] to bank account

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...

Categories