Quantcast

PayPal Direct Payment API Component

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

PayPal Direct Payment API Component

Mariano Iglesias

Hi my fellow Bakers,

 

I’ve just submitted a Component to the Bakery that allows the integration of two of PayPal’s services:

 

  • Direct Payment API: processing credit cards without leaving your website.
  • Express Checkout: user confirms your order on PayPal and gets sent back to your website for processing.

 

It is still awaiting approval. Once it is approved it should be available at the following URL:

 

http://bakery.cakephp.org/articles/view/168

 

If this happens within the next {$ NUMBER_OF_DAYS_GOOGLE_ALLOWS_POSTS_TO_BE_OPEN} days then I’ll post a reply to this post confirming availability.

 

Here’s a preview of how you do a Direct Payment with the component:

 

$order = array(

      'action' => CAKE_COMPONENT_PAYPAL_ORDER_TYPE_SALE,

      'description' => 'CakePHP Component',

      'total' => 100.00,

      'buyer' => array (

            'first' => 'Mariano',

            'last' => 'Iglesias',

            'address1' => '123 CakePHP Street',

            'address2' => 'Apartment A',

            'city' => 'San Diego',

            'state' => 'CA',

            'zip' => 92014,

            'country' => 'US'

      ),

      'cc' => array (

            'type' => 'Visa', // Can be: Visa, MasterCard, Amex, Discover

            'number' => '0000000000000000',

            'expiration' => '01/2010',

            'cvv2' => '999',

            'owner' => array (

                  'first' => 'Mariano',

                  'last' => 'Iglesias'

            )

      )

);

 

$this->Paypal->setEnvironment(CAKE_COMPONENT_PAYPAL_ENVIRONMENT_SANDBOX);

$this->Paypal->setUser('ApiUser');

$this->Paypal->setPassword('ApiPassword');

$this->Paypal->setCertificate('cert_perm.txt');

$this->Paypal->setOrder($order);

 

// Make payment via PayPal

 

$result = $this->Paypal->directPayment();

 

// Check PayPal status

 

if ($result === false)

{

      switch($this->Paypal->getErrorCode())

      {

            case CAKE_COMPONENT_PAYPAL_ERROR_INVALID_CREDIT_CARD:

                  echo 'INVALID CREDIT CARD';

                  exit;

                  break;

            case CAKE_COMPONENT_PAYPAL_ERROR_INVALID_CVV2:

                  echo 'INVALID Credit Card Verification Number.';

                  exit;

                  break;

            default:

                  echo 'ERROR: ' . $this->PayPal->getError();

                  exit;

                  break;

      }

}

else

{

      echo 'Woha! Got the money!';

      echo '<pre>'; print_r($result); echo '</pre>';

      exit;

}

 

Anyway, keep you posted.

 

-MI

 


Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge.

 

Bake on!

 


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: PayPal Direct Payment API Component

Claudio Poli

whoa Mariano, thanks for that, I will look into it soon :)


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: PayPal Direct Payment API Component

Mariano Iglesias

Sure, no problem.

Let's hope the article gets approved soon so you all can take a look at it.

-MI

---------------------------------------------------------------------------

Remember, smart coders answer ten questions for every question they ask.
So be smart, be cool, and share your knowledge.

BAKE ON!


-----Mensaje original-----
De: [hidden email] [mailto:[hidden email]] En nombre
de Claudio Poli ?
Enviado el: Martes, 28 de Noviembre de 2006 12:17 a.m.
Para: Cake PHP
Asunto: Re: PayPal Direct Payment API Component

whoa Mariano, thanks for that, I will look into it soon :)


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: PayPal Direct Payment API Component

Mariano Iglesias

It finally got approved. You can see this component at:

http://bakery.cakephp.org/articles/view/168

-MI

---------------------------------------------------------------------------

Remember, smart coders answer ten questions for every question they
ask.
So be smart, be cool, and share your knowledge.

BAKE ON!


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: PayPal Direct Payment API Component

dcowen
This post has NOT been accepted by the mailing list yet.
Hi Mariano,

I have have a application that was created in 2010 that I support now.  I have an error that I can't seem to pinpoint and hoping you would have a suggestion.  The paypal link has been working with no errors since inception, but 3 days ago we started getting this error when the user clicks the paypal button.

ERROR: curl_exec error 60 SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

thank you in advance for your time.  

Denise

Loading...