[FX.php List] Anyone done a PHP integration w/ Paypal?

Bob Patin bob at patin.com
Thu Dec 5 08:46:21 MST 2013


Glyn,

Thanks for the email; I don’t think they want to use a hosted order page though… it’d certainly be easier for me, however. :)

I may offer that to them rather than trying to make sense of the REST example I’m trying to grok…

Bob Patin
Longterm Solutions
bob at longtermsolutions.com
615-333-6858
FileMaker 9, 10, 11 & 12 Certified Developer
http://www.longtermsolutions.com
-
iChat: bobpatin at me.com
Twitter: bobpatin
—
FileMaker Consulting 
FileMaker Hosting for all versions of FileMaker
PHP • Full email services • Free DNS hosting • Colocation • Consulting

On Dec 5, 2013, at 9:40 AM, Glyn Devine <glyn.devine at quickseries.com> wrote:

> Bob,
> 
> I like to use Paypal’s “cart upload” for what you’re describing. Basically you POST the contents of your cart to PayPal and they respond with a webpage (which your client can customize visually by logging into his PayPal account) with everything a person needs to complete payment and be directed back to your client’s site afterwards.
> 
> Paypal’s documentation on that is here: https://cms.paypal.com/mx/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_cart_upload#id09BLDK0007Q
> 
> My code isn’t very generic so I’ll just leave you with the basic steps for setup:
> 
> Header:
> 
>         $output[] = '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="paypalform">';
>         $output[] = '<input type="hidden" name="cmd" value="_cart">';
>         $output[] = '<input type="hidden" name="business" value="PAYPAL_EMAIL at GOES.HERE">';
>         $output[] = '<input type="hidden" name="upload" value="1">';
>      
> For each product in your cart:
> 
> $paypalincrement must be a unique integer for each product you put into the form to POST
> $product_name is the product name
> $product_price is your unit price
> $product_qty is your quantity
> $product_id is your product code, a unique string identifiying the product
> 
>         $output[] = "<input type=\"hidden\" name=\"item_name_$paypalincrement\" value=\"$product_name\">";
>         $output[] = "<input type=\"hidden\" name=\"amount_$paypalincrement\" value=\"$product_price\">";
>         $output[] = "<input type=\"hidden\" name=\"quantity_$paypalincrement\" value=\"$product_qty\">";
>         $output[] = "<input type=\"hidden\" name=\"item_number_$paypalincrement\" value=\"$product_id\">";
> 
> Footers:
> 
> Optionally you can set your own $shippingcharge or you can configure your paypal account to set this for you automatically
> 
> $output[] = "<input type=\"hidden\" name=\"handling_cart\" value=\"$shippingcharge\">";
> 
> Finally, here’s my submit button and the end of the form:
> 
>         $output[] = '<input type="IMAGE" src="/images/paypalcheckout.jpg" value="PayPal Checkout">';
>         $output[] = '</form>';
> 
> 
> Hope this is useful!
> 
> Glyn
> 
> 
> 
>   
> 
> 
> On 12/5/13 10:21 AM, "Bob Patin" <bob at patin.com> wrote:
> 
>> Glyn,
>> 
>> I’m writing a payment app for a web portal; fairly simple, they just need to be able to run cards and I would of course return the results and write it into FileMaker. 
>> 
>> I just found a bit of code and am about to try it, but if you have a function that works, I’d love to take a look; I’ve done lots of integrations over the years, just not with Paypal.
>> 
>> Thanks,
>> 
>> Bob Patin
>> Longterm Solutions
>> bob at longtermsolutions.com
>> 615-333-6858
>> FileMaker 9, 10, 11 & 12 Certified Developer
>> http://www.longtermsolutions.com
>> -
>> iChat: bobpatin at me.com
>> Twitter: bobpatin
>>>> FileMaker Consulting 
>> FileMaker Hosting for all versions of FileMaker
>> PHP • Full email services • Free DNS hosting • Colocation • Consulting
>> 
>> 
>> On Dec 5, 2013, at 9:15 AM, Glyn Devine <glyn.devine at quickseries.com> wrote:
>> 
>>> I've done quite a bit with Paypal over the past few years. What are you
>>> writing, precisely? An IPN receiver? A cart? Something else?
>>> 
>>> Glyn Devine
>>> IT Manager
>>> QuickSeries Publishing Inc.
>> 
>> 
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20131205/36a9193e/attachment.html


More information about the FX.php_List mailing list