Yii Framework Forum: Problem With Paypal Integration And Ipn (Instant Payment Notification) - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Problem With Paypal Integration And Ipn (Instant Payment Notification) Rate Topic: ***** 1 Votes

#1 User is offline   Rasto 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 06-February 13

Posted 08 February 2013 - 04:54 AM

Hello guys,

I am creating PayPal pays for first time.
Right now I want to do it according this article: PayPal Integration And IPN (Instant Payment Notification)
link to article: http://www.yiiframew...on/#add-comment

What I want?
I am offering 3 types of Premium package on my site. User can choose one and pay it through PayPal. When it is payed I will change some informations in specific user.
So I need PayPal where custom field will be Order ID (from Order I know which User did the Order). After click on "Pay by PayPal" it will be redirected to PayPal page where will be price... After that I need to receive information if Order was payed or not - so I need IPN.

My questions to that article.
// Define LIVE constant as true if 'localhost' is not present in the host name. Configure the detecting of environment as necessary of course.
defined('LIVE') || define('LIVE', strpos($_SERVER['HTTP_HOST'],'localhost')===false ? true : false);
if (LIVE) {
  define('PAYPAL_HOST', 'ipnpb.paypal.com');
  define('PAYPAL_URL', 'https://ipnpb.paypal.com/cgi-bin/webscr');
  define('PAYPAL_EMAIL',''); // live email of merchant
  define('PAYPAL_HOST', 'www.sandbox.paypal.com');
  define('PAYPAL_URL', 'https://www.sandbox.paypal.com/uk/cgi-bin/webscr');
  define('PAYPAL_EMAIL', ''); // dev email of merchant

my config/main.php
return array {
//here is all settings

so that code should be out of array or where? How it should look?
And second question to this block is: dev email of merchant is my email which I used to register on PayPal or email of Test Acount?
Can I test IPN from my localhost?

From view file I confused with this block
$.post(Yii::app()->getRequest()->getBaseUrl().'order/create'; ?>',$('#orderForm').serializeArray(),function(orderResp) {
            if(orderResp.error === undefined){
                var action;
                $('#orderForm').attr({action:'<?php echo PAYPAL_URL?>',onsubmit:true}).submit();

why is there ?>? Where it started? And how should looks Create action in OrderController? I have never created new record like this.

So the result of my post is that I need step by step what I should do when I want to create PayPal pays. Maybe after I will do it I can make article step by step with all steps (also configuration in PayPal)

Thank you for all answers

Share this topic:

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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