Paypal Integration with APEX
452675Apr 16 2010 — edited Apr 16 2010I am using the document: "APEX & Paypal Website Payments Standard with IPN Integration Guide". I have made all the code changes prescribed and can invoke a transaction with Paypal. However, the return process fails with 404 Page not found error.
Has anyone successfully implemented the code in the article? I believe my problem lies with the owa_util calls. Any help would be greatly appreciated.
Here is my procedure code:
create or replace
procedure accept_payment (name_array in
owa_util.ident_arr,
value_array in
owa_util.ident_arr
)
/***********************************************************************
*****
* This procedure is called from the "Return to Merchant" button on the
* Paypal website after completing payment.
*
* It's purpose is to redirect the user to your payment confirmation
page
* whilst maintaing session state by using the session id posted in the
* "custom" variable. You will need to modify the app id and page id as
* appropriate for your application.
*
* You need to set up the call to this procedure via the "return"
variable of
* the form on your APEX page that generates the Paypal "Buy Now"
button.
* Eg. <input type="hidden" name="return"
value="http://yourhost/pls/apex/!yourschema.accept_payment">
*
************************************************************************
*****/
is
l_custom number;
begin
-- Loop through the posted variables in the array parameters and
-- get the value of the 'custom' variable
-- This contains your session id
for i in name_array.first .. name_array.last loop
case name_array (i)
when 'custom' then
l_custom := value_array (i);
else
null;
end case;
end loop;
-- Redirect the user to the payment confirmation page in your app
-- Modify as appropriate
owa_util.redirect_url ('f?p=233:202:' || l_custom);
exception
when others then
htp.p (sqlerrm);
end;