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.
Related
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
I'm trying to identify each user by some unique key, which is added to /start command. For each user, I will generate some key, and show URL to the user. This is described step by step in the official documentation https://core.telegram.org/bots#deep-linking
Link for the users is in the format:
https://telegram.me/ExampleBot?start=uniqueKey
It works perfectly in the telegram app. The probem is, that when opened in the browser, only button "Start" is visible. When the user clicks, the uniqueKey is not send to the bot.
How to add a uniqueKey to /start command to make it work in telegram web app too? How should look like the generated URL? So user can just click, and does not need to write the code?
Make your uniqueKey as Base64 and test again...
Based on Telegram documents it is recommended to using base64url to encode parameters with binary and other types of content.
I am using ServiceStack, and sending a GET request to ../api/auth/logout.
The logout is happening as expected, but afterwards the user gets redirected to ../../#s=-1, and I can't figure out how to customize this URL.
Can somebody point me in the right direction?
Thanks very much
The /auth/logout service redirects to the first existing route in the following order:
The Continue parameter if set, e.g. ?continue=/path
The Referrer Url on the Users Session i.e. IAuthUserSession.ReferrerUrl
The Referer HTTP Header (i.e. redirects back to where it came from)
The CallbackUrl of the first AuthProvider registered
For more details here's the source code for the Logout action that does this.
I need to get automatically login to website from my windows application. I am doing it with HttpWebRequest but what i want is to
Click on the button in my application.
Open the Index page (page after getting login)
Reason : I don't want to enter user name and pasword, i just want to click button and any browser(default browser) open with index page (page after login)
Normal Example :
I open a link " http://mail.yahoo.com " it shows me a page asking my email address and
password.
I enter the email id and password and press Login.
It redirects me to my Mail box page.
What to Do ?
click on the button
Automatically send my email id or user name and password to the website
Open my Mail box page.
Hint :
get cookie from HttpWebRequest.
set it to the browser.
Open browser and pass the credentials to login automatcially
can anyone help me?
I also need to solve the same issue, and the problem is hint point 2 in your list.
ie. how to set a cookie in a browser, without limiting yourself to using a specific broswer.
The conclusion I am coming to, is that I need to use a standard 'Single Sign-On' logic, where we update the web-server to use short term tokens such as mentioned here...
http://msdn.microsoft.com/en-us/library/ms972971.aspx
In this case the steps would be something like:
1. In app - Logon with HttpWebRequest.
2. Get short-term token (the link suggests validity lifetime of just 2 seconds)
3. Open browser with url
http://MyWebsite>/SignNn?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxx
4. Next I need to confirm if the SignOn process can return cookies correctly.
I dont think you can solve this in a generic way.
What usually happens in such scenarios is that the form within the web page is submited to web server, the web server reads the user name / password values from the form and authenticates the user against the underlying user managment repository.
You can write such a solution for specific sites, by analzying with a sniffer the posted form in the authentication pages, and then creating such an http message yourself and sending it to the relevant site.
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