Paypal Payflow Profile Library

I already have an express check integrated with my Codeigniter application. Now I want to integrate seamless paypal where I collect CC information and pass it to Paypal (via the backend), and as soon as everything is approved, my application shows it to the user. All this ever going to the Paypal website.

I know Paypal provides a bunch of sample code, but they have so many different products that advertise in order to do the same.

Is there any wrapper library in PHP that I can use to handle all this?

What design decision is associated with the transition to such a system? Do I need SSL certificates for this?

+5
source share
2 answers

I created an e-commerce site in CodeIgniter, also making Paypal seamless integration.

There did not seem to be any object oriented suuuuuper-pretty shells when I did my hunt, but I noticed some good attempts.

My decision turned out to be a bit bland. I downloaded the PHP API from here: https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_PHP_NVP_Samples.zip

I saved the file CallerService.phpas I application/helpers/paypal_helper.phpadded it in application/config/autoload.phpto paste it into the application.

Now it CallerService.phprequires constants.php, so you need to either copy and paste it, or include the file constants.phpin the directory of your assistants. I just copied and pasted. Then be sure to configure all the constants for your account.

:

  $nvp_query_string = '&PAYMENTACTION=Sale'
                . '&AMT='.urlencode($order->total)
                . '&CREDITCARDTYPE='.urlencode($this->input->post('credit_card_type'))
                . '&ACCT='.urlencode($this->input->post('acct'))
                . '&EXPDATE='.urlencode(str_pad($this->input->post('exp_date_month'), 2, '0', STR_PAD_LEFT).'20'.$this->input->post('exp_date_year'))
                . '&CVV2='.urlencode($this->input->post('cvv2_number'))
                . '&FIRSTNAME='.urlencode($first_name)
                . '&LASTNAME='.urlencode($last_name)
                . '&STREET='.urlencode($order->billing_address_1)
                . '&CITY='.urlencode($order->billing_city)
                . '&STATE='.urlencode($order->billing_state)
                . '&ZIP='.urlencode($order->billing_zip)
                . '&COUNTRYCODE=US&CURRENCYCODE=USD';

  $response = hash_call('doDirectPayment', $nvp_query_string);
  if (strpos(strtoupper($response['ACK']), 'SUCCESS') !== false) {
    // Product purchase was successful.
  }
  else {
    // Product purchase was unsuccessful.
    // The Paypal response will be in $response['ACK'].
    // The Paypal error message to show the customer will be in $response['L_LONGMESSAGE0'].
  }

, .

, SSL. 30 . , . SSL , CC , ( Wi-Fi) . , , CC, https://, http://.

+2

, , , - (, ), ssl. (paypal.com), . , , paypal.com, , .

, -, ssl , ?

0

All Articles