ogone error unknown order/0/s/ - php

I'm trying to configure my script to use ogone payment gateway
i've assigned a pass phrase let's say e.g: abcd1234
so the code that will be hased is
$sh = "AMOUNT=5000abcd1234CURRENCY=USDabcd1234LANGUAGE=en_USabcd1234ORDERID=1122abcd1234PSPID=MyIDabcd1234";
and i'm using this form
<FORM METHOD="post" ACTION="https://secure.ogone.com/ncol/test/orderstandard.asp" id="form1" name="form1">
<INPUT type="hidden" NAME="PSPID" value="MyID">
<INPUT type="hidden" NAME="ORDERID" value="1122">
<INPUT type="hidden" NAME="AMOUNT" value="5000">
<INPUT type="hidden" NAME="CURRENCY" value="USD">
<INPUT type="hidden" NAME="LANGUAGE" value="en_US">
<INPUT type="hidden" NAME="SHASIGN" value="<?php echo $sh; ?>">
<input type="submit" value="Your button lib" id="submit2" name="submit2">
</form>
after adjusting the referrer URL of this webpage i get this error unknown order/0/s/
Any idea please?

The error unknown order/0/s means that you are not sending the proper SHA-1 signature.
This is related to a parameter configured in Ogone's backoffice there :
Configuration > Technical information > Data and origin verification

I am very late, but the answer to this question is to hash the SHASIGN value with an algorithm that is chosen within the Merchant portal.
Passing the hashed value solves the issue.

Related

encrypt paypal buy now button html form

I've a classic paypal buynow button form in html. I need to encrypt the form to hide the parameters like amount or seller email data...
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="+++++++++">
<input type="hidden" name="lc" value="IT">
<input type="hidden" name="on0" value="DESCRIPTION">
<input type="hidden" name="os0" value="PAYMENT OBJECT n.<?php echo $_SESSION["ordernumber"]; ?>">
<input type="hidden" name="item_name" value="PAYMENT ORDER n. <?php echo $_SESSION["ordernumber"]; ?>">
<input type="hidden" name="item_number" value="VSTCB">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="amount" value="<?php echo $topaypal; ?>">
<input type="hidden" name="rm" value="1">
<input type="hidden" name="return" value="www.++++++.com/ok.php">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">
<input type="image" src="https://www.paypalobjects.com/it_IT/IT/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal รจ il metodo rapido e sicuro per pagare e farsi pagare online.">
<img alt="" border="0" src="https://www.paypalobjects.com/it_IT/i/scr/pixel.gif" width="1" height="1">
</form>
I've my private key and public certificate generated with openssl, and I've also the cert_Id of paypal and the relative paypal_public_certificate, but I'm not able at all to encrypt my html form, I've only found this command line on paypal site:
"PPEncrypt CertFile PrivKeyFile PPCertFile InputFile OutputFile"
Ther reference page for these information is on the paypal site at the address:
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/encryptedwebpayments/
but I don't know how to use it...
does anyone know how to encrypt the form using the command line provided by paypal, a kind of step by step guide if it's possible?
many regards helping me
The command line "PPEncrypt CertFile PrivKeyFile PPCertFile InputFile OutputFile" breaks down to the following components:
PPEncrypt - PayPal's encryption algorithm
CertFile - The pathname to your own public certificate
PKCS12File - The pathname to the PKCS12-format of your own public certificate
PPCertFile - The pathname to a copy of the PayPal public certificate
Password - The passphrase to the PKCS12-format of your own public certificate
InputFile - The pathname to file containing the non-encrypted Website Payments HTML Form variables
OutputFile - A file name for the encrypted output
[Sandbox] The optional word Sandbox that lets you test payment buttons in the PayPal Sandbox that you protected with Encrypted Website Payments
However, you may want to opt for a button hosted by PayPal, as hosting means that you won't have to re-generate the certificates each time the form parameters are updated.
Hope this helps! :)

Paypal not posting data on Return url on mobile browsers

I am using html form to integrate Paypal and my form is as
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="POST">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="hosted_button_id" value="XXXXXXXXXX">
<input type="hidden" name="business" value="admin#domain.com" />
<input type="hidden" name="item_name" value="Item Name" />
<input type="hidden" name="quantity" value="1" />
<input type="hidden" name="amount" value="100.00" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="return" value="http://domain.com/success" />
<input type="hidden" name="cancel_return" value="http://domain.com/fail/" />
<input type="hidden" name="cbt" value="Please Click here to Complete Your Order" />
</form>
When I am testing this Website code on desktop browsers this is posting paypal data back on return url perfectly. But when I am testing same website code on my Mobile browser payapl is not posting back any data on return url. It just get back on return url without any data.
Please help me.
do you get ANY kind of request on callback on mobile? You should log every POST request on callback page and review them
also try with notify_url as well, IPN should be sent here
Please set "no_note"
Please see following links
Link: http://www.paypalobjects.com/en_US/ebook/subscriptions/html.html
I'm pretty sure your problem is that you need to add this line to your code:
<input type="hidden" name="no_note" value="1">
Hope this helps.

PayPal express API call doesn't re-direct response back to my URL

friends! Well, when working with Web Payments Standard and PDT, it was explained to me that when a user tries to pay with a credit card and without logging in, the auto forward back to my site does not work... same person recommended PayPal Express as my solution. So here I am implementing my very first ever API call, and instead of re-directing back to my site to look at the POST or GET response NVP data, I get a long response string on the PayPal API page... I am posting my code below. Any thoughts? I have a screen shot, but can't figure out how to post it...
<form action="https://api-3t.paypal.com/nvp" method="post" name="PPform" id="PPform">
<input type="hidden" name="USER" value=" user " />
<input type="hidden" name="PWD" value=" password " />
<input type="hidden" name="SIGNATURE" value="signature" />
<input type="hidden" name="VERSION" value="109.0" />
<input type="hidden" name="PAYMENTREQUEST_0_PAYMENTACTION" value="Sale" />
<input type="hidden" name="PAYMENTREQUEST_0_AMT" value="0.30" />
<input type="hidden" name="RETURNURL" value="https://www.masphotopdx.com/process.php" />
<input type="hidden" name="CANCELURL" value="https://www.masphotopdx.com/mas_cart.php" />
<input type="submit" name="METHOD" value="SetExpressCheckout" />
</form>
The variables are RETURN_URL and CANCEL_URL. You can also set the URL in your Paypal profile.

unable to get paypal post pramenters in the return url

I have one code for passing some custom variables to PayPal and these were collected in the return page, but when trying to get these values it is not working
I have a PayPal form like this :
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="image" src="submit.png" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"/>
<input type="hidden" name="add" value="1"/>
<input type="hidden" name="custom" value="IP"/>
<input type="hidden" name="cmd" value="_cart"/>
<input type="hidden" name="business" value=""/>
<input type="hidden" name="item_name" value=""/>
<input type="hidden" name="item_number" value=""/>
<input type="hidden" name="amount" value=""/>
<input type="hidden" name="page_style" value=""/>
<input type="hidden" name="no_shipping" value="1"/>
<input type="hidden" name="return" value="index.php?action=success"/>
<input type="hidden" name="notify_url" value="index.php?action=ipn"/>
<input type="hidden" name="cancel_return" value=""/>
<input type="hidden" name="rm" value="2"/>
<input type="hidden" name="cn" value="Additional Information"/>
<input type="hidden" name="currency_code" value="AUD"/>
<input type="hidden" name="bn" value="PP-ShopCartBF"/>
</form>
I am successfully returning to the URL after payment. and there I am just trying to print the POST Variable for now and It is not giving me any values.I have tried by both enabling and disabling 'auto return'. In both case I don't get values. Please help me, thanks in advance.
The "notify_url" will be contacted by paypal asynchronously (directly), without you having anything to do with this transaction. So you will never see in your browser any results whatsoever. You should use some kind of logging in your script to see what is actually being sent. Check your web server's access log to see if paypal is actually contacting your script (and make sure it's not "localhost" you're trying from)
If I remember correctly only the transaction id is sent back to the return_url. The notify_url receives that id also. From there you should be able to communicate both pages to fill your needs.

PayPal Payment Callback

I have searched for more than 4 hours now on how to do callback with PayPal after a payment have been proceeded.
The thing is, I have a site the sells tickets to a LAN Party, and the only way to pay is with PayPal.
Here is my PayPal buy button code:
<form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="_MY_PAYPAL_EMAIL_">
<input type="hidden" name="item_number" value="<?php echo mktime(); ?>">
<input type="hidden" name="cn" value="<?php echo $_SESSION['userid']; ?>">
<input type="hidden" name="return" value="http://80.202.213.240/apps/tickets/buy/success/" />
<input type="hidden" name="cancel_return" value="http://80.202.213.240/apps/tickets/buy/cancelled/" />
<input type="hidden" name="notify_url" value="http://80.202.213.240/apps/tickets/buy/ipn/" />
<input type="hidden" name="lc" value="NO">
<input type="hidden" name="item_name" value="BitHack - Standard Ticket">
<input type="hidden" name="amount" value="100.00">
<input type="hidden" name="currency_code" value="NOK">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="button_subtype" value="Tickets">
<input type="hidden" name="add" value="1">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest">
<input type="submit" value="Add to Cart" class="ticketShowButton submit" title="Payment via PayPal">
The info should then be inserted into a database, that part I have finished.
Just need the callback system to work.
Anyone know any good callback script examples?
BTW, is it possible do use custom inputs?
The callback function specified in the return and notify url variables are the programmer's responsibility. Why? Because each website has it's own table structure for orders. Try this as a guide:
On your Paypal profile set your preference to redirect automatically after an order. You will also need to set a default return url. this will be used if you forgot to specify a return url on your order form or query string sent to Paypal.
Next, set your rm field/variable to "2" (this will tell Paypal API to autoredirect to your return url after the order and pass the order info in POST format)
You can view the response from Paypal by doing a var_dump($_POST) or print_r($_POST).
One of the important variables from the response is $_POST['payment_status'] which will tell you the outcome of the order. A successful transaction is 'Completed'. A transaction that requires verification from Paypal or from the merchant's side is 'Pending'.
Lastly, don't forget to specify 'invoice' on your Paypal field/request so you can update the status of your order. Something like:
$status = $_POST['payment_status'];
$invoice = $_POST['invoice'];
mysql_query("UPDATE Orders SET status='$status' WHERE order_id='$invoice'");
I know this is bad and unsafe coding but at least you get the general idea in it's simplest form.
Again, don't rely on other's codes. Codes in the net exists for reference purposes and not as God's handwork. Only you have the power to create your own masterpiece :D
I hope that helps. Vote up if you like it. Ignore if not.
A commercial but low cost solution is the LinkLokIPN script at:
http://www.vibralogix.com/linklokipn/
No connection other than as a satisfied customer of the PHP version. Sometimes it is MUCH easier to buy (and perhaps adapt) a working solution than to reinvent the wheel.

Categories