I am using Paypal's Adaptive Payments (Preapproval API) for one of my projects.
Everything is working fine, the payments are processed exactly as I want. My only problem is that I can't use the page_style variable as i could with a classic PayPal refirection solution.
When I obtain the pay key for PayPal, I prepare a form like this:
<form method="post" id="gateway_form" name="gateway_form" action="https://www.paypal.com/webscr?cmd=_ap-preapproval&preapprovalkey=PA-XXXXXXXXX">
<input type="hidden" name="page_style" value="mystyle">
<button type="button" class="continue-with-payment" onclick="checkDonateForm(327, 'gateway_form');">
<span>Proceed to Payment</span>
</button>
</form>
Where mystyle is a custom page I have created on my Paypal account which is the application owner.
I have also tried to send page_style as a GET variable e.g. https://www.paypal.com/webscr?cmd=_ap-preapproval&preapprovalkey=PA-XXXXXXXXX&page_style=mystyle but nothing happened.
Any suggestions ?
The page_style variable is for Payments Standard transactions - not Adaptive Payments. I checked to see if there was an equivalent for Adaptive Payments but there doesn't seem to be.
I'll submit a Feature Request asking to include one but I cannot guarantee that it will be implemented - sorry.
Related
As the subject states, I created a PayPal Checkout button by simply adding the HTML code for the button and modified the text and remove the PayPal logo image.
Normally the code below would be used to generate the button, which of course is limiting:
{{ content_for_additional_checkout_buttons }}
However, I have instead added this HTML in its stead:
<div class="paypal-checkout-button">
<button name="goto_pp" type="submit" id="paypal-express-button" class="additional-checkout-button additional-checkout-button--paypal-express" value="paypal_express">
CHECKOUT WITH PAYPAL
</button>
</div>
The button's functionality is perfectly fine; I even processed a test payment through it. A developer friend of mine told me it wasn't possible without some hacky solution; however, the simple HTML snippet above seems to be a perfect solution to customizing the PayPal button on the cart / product page.
Am I missing anything? Or is this perfectly fine to do?
Appreciate any you can provide on the matter.
It's not the button on the cart that Shopify people have issues/problems with.
It's the button on the checkout and that can't be modified (without a lot of hassle) unless the store owner has a Plus account. That is almost certainly what your developer friend is talking about.
Not to mention, of course, that changing the appearance of the button or forcing it not to appear before the Shopify checkout process is a violation of the PayPal express user agreement.
I have a simple windows application (C++) that I would like to sell. The user downloads the full application which runs for 2 weeks. At the end of that time, the user must buy an access code ($1 - $5) to continue using the application.
The simplest way I've come up with for doing this is to have the application generate a UUID which is written into the registry. The application generates the access code based off the UUID. I would like to pass the access code to Paypal when the user initiates a purchase. If the purchase is successful, I would like Paypal to give the access code to the user (e.g. in an email confirming the purchase). Finally, the user will type the access code into the application to unlock it.
1) If someone has an easier way to do this, please send me an example. My requirements are only that the process require some detailed knowledge to hack (e.g. knowledge of a packet sniffer for my scheme above). (if my application becomes popular enough that someone wants to devote the time to hack it, I will be ecstatic).
2) What I have tried to implement the scheme above:
I have use the directions here to generate a paypal button for a purchase. I can click on the button and make a purchase using the sandbox. What I have been unable to do is a) add new hidden data to this button, and b) find a way for paypal to present that data back to the user on a completed transaction. (There is probably a way for me to do this by having a site that does the paypal ipn stuff found here)
The paypal ipn stuff just seems awfully complicated for something that I would think a lot of applications want to do. What I am hoping is that someone can point out a simpler way to do this with example code.
This is my first time using paypal as a merchant (in case that wasn't obvious).
Here is the sandbox-based button that I have from paypal.
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="SOMETHING">
<input type="hidden" name="machine_id" value="PASSCODE">
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
In this example, I was trying to send my passcode in the machine_id field. I can't figure out how to get paypal to send this back to my buyer.
Thanks.
Chris
You cannot use your own variables.
Try this <input type="hidden" name="custom" value="PASSCODE">
custom - Pass-through variable for your own tracking purposes, which buyers do not see.
Or see list of all variables
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/#id08A6HF00TZS
I have created a button that allows for users to pay via PayPal and it works,
however when I get back to my page I receive no url query string to catch.
Here is the current code:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<button class="ato4" name="submit" type="image" onmouseover="this.style.backgroundColor='#CCC9BD';return true;" onmouseout="this.style.backgroundColor='rgba(79,129,189,0.5)';return true;" style="cursor:pointer;float:right;margin-right:490px;">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="V84TB5GYULLYC">
<font class="shadowfilter">תשלום דרך האינטרנט
<br>
<font style="color:green;">PAYPAL</font>
</font>
</button>
</form>
How do I make paypal automatically redirect to my website without pressing the return button that PayPal has on their website?
apparently there is an option for all pages to auto return to -> url . well it's not as good as an individual pages but it gives the result
You have to enable auto return in your PayPal account, otherwise it will ignore the return field.
From the documentation (updated to reflect new layout):
Auto Return is turned off by default.
To turn on Auto Return:
Log in to your PayPal account at https://www.paypal.com.
The My Account Overview page appears.
Click the Profile subtab.
The Profile Summary page appears.
Click the My Selling Tools link in the left column.
Under the Selling Online section, click the Update link in the row for Website Preferences.
The Website Payment Preferences page appears
Under Auto Return for Website Payments, click the On radio button to enable Auto
Return.
In the Return URL field, enter the URL to which you want your payers redirected after
they complete their payments.
NOTE: PayPal checks the Return URL that you enter. If the URL is not properly formatted
or cannot be validated, PayPal will not activate Auto Return.
Scroll to the bottom of the page, and click the Save button.
IPN is for instant payment notification. It will give you more reliable/useful information than what you'll get from auto-return.
Documentation for IPN is here: https://www.x.com/sites/default/files/ipnguide.pdf
Online Documentation for IPN: https://developer.paypal.com/docs/classic/ipn/gs_IPN/
The general procedure is that you pass a notify_url parameter with the request, and set up a page which handles and validates IPN notifications, and PayPal will send requests to that page to notify you when payments/refunds/etc. go through. That IPN handler page would then be the correct place to update the database to mark orders as having been paid.
Ref.: Setting PayPal return URL and making it auto return?
I am using the PayPal in-context approach and upon launching PayPal in an in-context manner, I am able to:
Log in
Pay for my items
But after that, PayPal redirects me to the URL I provide however it does this within the in-context view? Is there a setting I am missing to make it close the mini window it opens after user pays? The documentation doesn't specify/mention anything on how to do this. I was expecting it to close the in-context window when a user clicks "pay now" and return back control to the page hosting it.
Apologies if the detail in the question seems light, if any further info is required then please comment and I shall try my best to update.
Should mention I am using the sandbox environment.
When using the PayPal In-Context checkout you should have a fully functional Express Checkout flow to begin with. There are some variables that would cause the In-Context checkout to display as the standard Express Checkout. This would cause the issue you are speaking about. I have a functional In-Context checkout here:
http://marshalcurrier.com/paypal/ExpressCheckout/SetDoInContext.php
I tried to implement In-Context Checkout with the WooCommerce plugin on Wordpress. This didnt work out so well, you can see what the checkout looks like here:
http://marshalcurrier.com/?product=test
For the most part the opening and closing should be handled through PayPal. That is why you call PayPal's Script:
For the most part everything was built to be plug and play. You drop in this near the end of your page:
<form id="myContainer" method="post" action="/checkout"></form>
<script>
window.paypalCheckoutReady = function () {
paypal.checkout.setup('9XKWYX3UHBPB2', {
environment: 'sandbox',
container: 'myContainer'
});
};
</script>
<script src="//www.paypalobjects.com/api/checkout.js" async></script>
Then add the div id to your form:
<form method='post' id="myContainer"><input type="text" name="CHARGE" value="1"/><input type="submit"/><form>
I have functioning sample code but need to get 10 reputation before I can post it.
I've been asked to implement Paypal "Donate Now" functionality on a web site, similar to Wikipedia's site.
I know how to generate "Buy/Donate Now" buttons with fixed amounts, and with variable amounts,
but I don't see how Wikipedia is able to have the user specify the amount on their site and then have it carry over to Paypal, so that the amount is pre-filled once they get there.
Paypal's own documentation does not seem to support an "amount" field (or I've missed it). I actually called Paypal support and was told that I'd have to use a 3rd-party shopping cart for this functionality, but if the carts support this, isn't it just a form param?
Yes, there's an HTML input parameter for this. Simply called 'amount'.
See https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables
Just include amount in any HTML input/select field and ensure you pass it over to PayPal. For example:
<label for="amount">Enter the amount you wish to donate:</label>
<input type="text" id="amount" name="amount" value"">
Or;
<label for="amount">Select the amount you wish to donate:</label>
<select name="amount" id="amount">
<option value="5.00">$5.00</option>
<option value="25.00">$25.00</option>
<option value="50.00">$50.00</option>
</select>
Wikipedia uses some server-side scripting to create a transaction before it sends you to Paypal. This is the shopping cart functionality, yes, specifically the Express Checkout part.
I believe that this image illustrates the process:
(source: paypal.com)
Don't worry - it looks harder than it is: it's very easy to implement.