Yii Framework Forum: PPExt - PayPal extension - Yii Framework Forum

Jump to content

  • (6 Pages)
  • +
  • « First
  • 3
  • 4
  • 5
  • 6
  • You cannot start a new topic
  • You cannot reply to this topic

PPExt - PayPal extension I'm developing a PayPal extension Rate Topic: ****- 1 Votes

#81 User is offline   dckurushin 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 392
  • Joined: 16-March 11
  • Location:Israel

Posted 18 October 2011 - 08:20 AM

View Postasifa, on 18 October 2011 - 08:12 AM, said:

Solved that but now i have the following error
Fatal error: Call to undefined function curl_init() in C:\wamp\www\itmat\protected\modules\payPal\components\PPUtils.php on line 84


Any ideas plz?

Thanks,


install curl in your server... :rolleyes:
0

#82 User is offline   stianlik 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 14-October 10
  • Location:Norway

Posted 18 October 2011 - 11:30 AM

View Postasifa, on 18 October 2011 - 08:12 AM, said:

Solved that but now i have the following error
Fatal error: Call to undefined function curl_init() in C:\wamp\www\itmat\protected\modules\payPal\components\PPUtils.php on line 84


You need to install CURL on your server, see PHP manual - curl.
0

#83 User is offline   John J 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 05-July 11
  • Location:Golden Grove, South Australia

Posted 19 October 2011 - 05:35 AM

Thanks for this great extension. I've been following this discussion, and I've integrated PayPal into the project I am working on reasonably easily.

I am however encountering a problem now. (I don't want to call it a small problem, even though it probably is.)

I got the IPN notifications working on Monday. I made a PayPal payment using the sandbox and my code was notified of the payment and I was able to update the sales record as being payment complete. Very nice. I then went on to other parts of the project.

Today I decided to do another sandbox payment, and this time I did not receive any notification. PayPal IPN history tells me that it has sent a notification, but my logs do not show anything coming in. (They did when it worked the other day.)

From what I've read the sandbox can be a bit flakey, but this worries me. I believe my code is working (since it did) but I'd like to be sure.

Is this something you are experience with?

BTW, I've heard that there is an IPN simulator. But I can't find it. Any clues where to look?

Thanks.
0

#84 User is offline   John J 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 05-July 11
  • Location:Golden Grove, South Australia

Posted 20 October 2011 - 02:20 AM

I figured it out. Turns out the sandbox was sending, but I had added some code to force login on the module and forgot to exclude the IPN handler. Doh! :huh:

It's working nicely now! Woo Hoo!
0

#85 User is offline   imehesz 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 703
  • Joined: 13-June 09
  • Location:Jacksonville, FL

Posted 09 November 2011 - 05:14 PM

hello guys,

I'm trying to get this module to work but receiving the following error:

// ---- URL: payPal/PPTest/create

NVP request failed
Request:BUTTONTYPE=BUYNOW&METHOD=BMCreateButton&VERSION=63.0&USER=PAYPAL_USER_ID&PWD=PAYPALPASSWORD&SIGNATURE=PAYPALSIGNATURE
Response:TIMESTAMP=2011-11-09T22:06:30Z&CORRELATIONID=fa74e23d8b3121212205f&ACK=Failure&VERSION=63.0&BUILD=2230381&L_ERRORCODE0=10002&L_SHORTMESSAGE0=Security
error&L_LONGMESSAGE0=Security header is not valid&L_SEVERITYCODE0=Error
in /var/www/p/ppal/protected/modules/payPal/components/PPUtils.php (226)
in /var/www/p/ppal/protected/modules/payPal/components/PPButtonManager.php
(59)
in
/var/www/p/ppal/protected/modules/payPal/controllers/PPTestController.php
(22)


Security header is not valid&L_SEVERITYCODE0=Error

If I mess around with my username or pass I get a different error saying the I can't call that API, which means (I assume) that the Curl call works.

I also updated the PPUtils's httpGet with (but got the same result):

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);


thanks for your help,

--iM
It’s done, the great act of creation.
The maker rests. The wheel’s in motion.
-- Imre Madách

check out Yii Theme Factory at http://yii.themefactory.net
0

#86 User is offline   imehesz 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 703
  • Joined: 13-June 09
  • Location:Jacksonville, FL

Posted 09 November 2011 - 05:32 PM

View Postimehesz, on 09 November 2011 - 05:14 PM, said:

hello guys,

I'm trying to get this module to work but receiving the following error:
...


my bad, I was using the wrong `env`. works like a charm :)

thx,
--iM
It’s done, the great act of creation.
The maker rests. The wheel’s in motion.
-- Imre Madách

check out Yii Theme Factory at http://yii.themefactory.net
0

#87 User is offline   Kleverz 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 01-March 11

Posted 18 November 2011 - 06:49 PM

Is there any way to use a custom image with the Buy Now button without having it hosted on PP? I tried:

'L_BUTTONVAR7'=>'image=https://www.mysite.com/paypal-button.gif',

but that does nothing. Thanks!
0

#88 User is offline   stianlik 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 14-October 10
  • Location:Norway

Posted 19 November 2011 - 04:35 AM

View PostTwinMoons, on 18 November 2011 - 06:49 PM, said:

Is there any way to use a custom image with the Buy Now button without having it hosted on PP? I tried:

'L_BUTTONVAR7'=>'image=https://www.mysite.com/paypal-button.gif',

but that does nothing. Thanks!


See Post #70
0

#89 User is offline   Kleverz 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 01-March 11

Posted 19 November 2011 - 02:57 PM

View Poststianlik, on 19 November 2011 - 04:35 AM, said:



I have tried BUTTONTYPE=PAYMENT but it gives me this error:

Response:TIMESTAMP=2011-11-19T19:34:57Z&CORRELATIONID=a32e1c3cb5bba&ACK=Failure&VERSION=65.2&BUILD=2230381&L_ERRORCODE0=13117&L_SHORTMESSAGE0=Invalid Argument&L_LONGMESSAGE0=Subtotal amount is not valid.&L_SEVERITYCODE0=Error

So I added a Subtotal field:

'L_BUTTONVAR8'=>'subtotal=' . sprintf('%02.2f', $orderTotal),

Now it DOES generate a "Pay Now" button but when you click on it it goes to securepayments.paypal.com instead of www.paypal.com and I get the error:

Your payment can't be processed at this time. Please try again later.

I just want to be able to create a BUYNOW button with a custom image. I know that when you create buttons via the PayPal site you can select the Buy Now button or Pay Now button or a custom image, but then that is a button with a fixed total value. I need to assign the orderTotal value dynamically. Any suggestions? Thanks.
0

#90 User is offline   Kleverz 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 01-March 11

Posted 19 November 2011 - 03:26 PM

View Poststianlik, on 19 November 2011 - 04:35 AM, said:



Well, I haven't been able to figure out how to do it with php so I'm doing it with jquery:

<script>
$('input[type="image"]').attr('src', 'https://www.mysite.com/images/paypal-button.gif');
</script>


Is this bad/unsecure?
0

#91 User is offline   stianlik 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 14-October 10
  • Location:Norway

Posted 20 November 2011 - 07:13 AM

View PostTwinMoons, on 19 November 2011 - 03:26 PM, said:

Well, I haven't been able to figure out how to do it with php so I'm doing it with jquery:

<script>
$('input[type="image"]').attr('src', 'https://www.mysite.com/images/paypal-button.gif');
</script>


Is this bad/unsecure?


It's not insecure (assuming that you do all the validation and payment processing server-side), but I would do it in PHP, you can use DOMDocument to parse HTML, or do it using a simple regex (DOMDocument would be the best solution).

Example regex:
// Supports the following format (will fail if src is placed before type): 
// <input ... type="image" src="..." ...
// $buttonHtml is button code from PayPal
$myurl = 'http://myimage.png';
echo preg_replace('/(<\s*input.*?type="image".*?src=").*?(")/', '$1'.$myurl.'$2', $buttonHtml);


0

#92 User is offline   Kleverz 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 01-March 11

Posted 20 November 2011 - 01:37 PM

View Poststianlik, on 20 November 2011 - 07:13 AM, said:

It's not insecure (assuming that you do all the validation and payment processing server-side), but I would do it in PHP, you can use DOMDocument to parse HTML, or do it using a simple regex (DOMDocument would be the best solution).

Example regex:
// Supports the following format (will fail if src is placed before type): 
// <input ... type="image" src="..." ...
// $buttonHtml is button code from PayPal
$myurl = 'http://myimage.png';
echo preg_replace('/(<\s*input.*?type="image".*?src=").*?(")/', '$1'.$myurl.'$2', $buttonHtml);




Thank you Stianlik, the regex worked like a charm! Since I only have one button on the checkout page that is of type image, regex worked perfectly. Thank you for your prompt and helpful response as always.
0

#93 User is offline   nib.111 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 05-October 11

Posted 04 December 2011 - 10:16 AM

I meet a error, can you tell me how to fix it, thank you ^^

Quote

Parse error: syntax error, unexpected T_FUNCTION in /home/a9357140/public_html/protected/modules/payPal/controllers/PPDefaultController.php on line 52


and say me wrong if i setup a IPN with url: http://mysite.com/payPal/PPDefault/ipn
0

#94 User is offline   DG Esteban A. Pérez 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 35
  • Joined: 16-September 10
  • Location:Bs. As., Argentina

Posted 06 December 2011 - 07:48 PM

Hi!,

Really, nice module...

I'm writing a kind of "brief starting up" tutorial to those who want to use it...

I managed to create the button and modify its properties.. But, the big question is... What is next when the user press the "buy now" button" and the controller (actionCreate function, for instance) knows the button ID provided for paypal?.. How I continue with IPN or PDT procedure? :S

Could you give me some directions? :S

Thanks in advance!!!!!

E.
0

#95 User is offline   fernandrez 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 08-April 12

Posted 09 April 2012 - 01:56 AM

hi stianlik, thanks a lot for this wonderful extension. While using the PPStoreExample/admin I successfully created a button. But when I try to remove it, it says it was successfully removed but it keeps being showed in the page. When i click on it i get an error from PayPal as if it was already removed from their servers. How can I do to remove it from my page too.
0

#96 User is offline   Seth Ballinger 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 23-January 12

Posted 10 April 2012 - 09:30 AM

Dear All,

My code is looking working properly but button is not showing in my view file. Please look below my code..


My config.php


'modules'=>array(
// uncomment the following to enable the Gii tool

'payPal'=>array(
'env'=>'',
'account'=>array(
'username'=>'my username here',
'password'=>'my password',
'signature'=>'my signature',
'email'=>'my email id',
'identityToken'=>'my id token',
),
'components'=>array(
'buttonManager'=>array(
//'class'=>'payPal.components.PPDbButtonManager'
'class'=>'payPal.components.PPPhpButtonManager',
),
),
),

In view (order/checkout.php)

$buttonManager = Yii::app()->getModule('payPal')->buttonManager;
$nvp = array( 'BUTTONTYPE'=>'BUYNOW', 'L_BUTTONVAR0'=>'currency_code=USD', 'L_BUTTONVAR1'=>'item_name=My item name', 'L_BUTTONVAR2'=>'amount=200.00', );
$btnId = helpers::genRandomString(); /// generate randon number
$buttonManager->createButton($btnId, $nvp);

In my log :

below message in showing yellow color

Successfully created buttonRequest:BUTTONTYPE=BUYNOW&L_BUTTONVAR0=currency_code=USD&L_BUTTONVAR1=item_name=Myitem name&L_BUTTONVAR2=amount=200.00&METHOD=BMCreateButtonin/home/website_dir/public_html/dev/protected/modules/payPal/components/PPButtonManager.php(240)in/home/website_dir/public_html/dev/protected/modules/payPal/components/PPButtonManager.php(72)in /home/website_dir/public_html/dev/protected/views/order/checkout.php (56)

But there is no button is showing in my view file.. Please help

Thanks in advance...

0

#97 User is offline   eli 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 31-January 12

Posted 30 April 2012 - 07:44 AM

View PostSeth Ballinger, on 10 April 2012 - 09:30 AM, said:

In my log :

below message in showing yellow color

Successfully created buttonRequest:BUTTONTYPE=BUYNOW&L_BUTTONVAR0=currency_code=USD&L_BUTTONVAR1=item_name=Myitem name&L_BUTTONVAR2=amount=200.00&METHOD=BMCreateButtonin/home/website_dir/public_html/dev/protected/modules/payPal/components/PPButtonManager.php(240)in/home/website_dir/public_html/dev/protected/modules/payPal/components/PPButtonManager.php(72)in /home/website_dir/public_html/dev/protected/views/order/checkout.php (56)

But there is no button is showing in my view file.. Please help

Thanks in advance...

You need to do
echo($buttonManager->webSiteCode);

0

#98 User is offline   jagsler 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 15-May 12

Posted 15 May 2012 - 08:00 AM

Hi,

I'm trying to get the extension working, but I'm already stuck at creating a button. Whenever I try to create a button I get the following:

require(/usr/home/c2p/sites/protected/modules/payPal/data/buttons.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory 


The error comes from: /usr/home/c2p/sites/protected/modules/payPal/models/PPPhpButton.php(78)

On my site users can add items to their shopping cart and when they're done adding stuff they can choose to pay with paypal (or another) so the amount etc. is going to be different each time, a lot like post 67.

Where am I going wrong?
0

#99 User is offline   samuel.m 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 29-March 12

Posted 28 June 2012 - 03:01 AM

Hi,

The extension works just great .
I have a question regarding the generated buttons.

I want to use it in a checkout process that means each amount is different , so i have to create a new button for each order checkout .
It will ends up with thousands of differents buttons that are only use once , what do you think ? is this could be an issue , is there any way to clean up buttons ?

Thanks again
0

#100 User is offline   nailgg 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 03-August 12

Posted 14 August 2012 - 11:22 AM

View Postjagsler, on 15 May 2012 - 08:00 AM, said:

Hi,

I'm trying to get the extension working, but I'm already stuck at creating a button. Whenever I try to create a button I get the following:

require(/usr/home/c2p/sites/protected/modules/payPal/data/buttons.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory 


The error comes from: /usr/home/c2p/sites/protected/modules/payPal/models/PPPhpButton.php(78)

On my site users can add items to their shopping cart and when they're done adding stuff they can choose to pay with paypal (or another) so the amount etc. is going to be different each time, a lot like post 67.

Where am I going wrong?



In webapp/config/main.php file, try commenting out the UrlManager component. But after this, if you hardcoded any links to one of your pages like (index.php/user/view) you need to modify them too.
0

Share this topic:


  • (6 Pages)
  • +
  • « First
  • 3
  • 4
  • 5
  • 6
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users