Paypal direct payment method

Developer Blog

1.firstly you shoud have paypal account to use the payment method
2.Then you need credentials of credit card from the customer so that he can pay
$api_version = ‘98.0’;
$api_endpoint = ‘https://api-3t.sandbox.paypal.com/nvp’;
$api_username = ”;
$api_password = ”;
$api_signature =”;
// Store request params in an array
$request_params = array
(
‘METHOD’ => ‘DoDirectPayment’,
‘USER’ => $api_username,
‘PWD’ => $api_password,
‘SIGNATURE’ => $api_signature,
‘VERSION’ => $api_version,
‘PAYMENTACTION’ => ‘Sale’,
‘IPADDRESS’ => $_SERVER[‘REMOTE_ADDR’],
‘CREDITCARDTYPE’ => $ctype,
‘ACCT’ => $cnumber,
‘EXPDATE’ => $e,
‘CVV2’ => $cvv,
‘FIRSTNAME’ => $fname,
‘LASTNAME’ => ‘Testerson’,
‘STREET’ => ‘707 W. Bay Drive’,
‘CITY’ => ‘Largo’,
‘STATE’ => ‘FL’,
‘COUNTRYCODE’ => ‘US’,
‘ZIP’ => $zip,
‘AMT’ => $amount,
‘CURRENCYCODE’ => ‘USD’,
‘DESC’ => ‘Testing Payments Pro’
);

// Loop through $request_params array to generate the NVP string.
$nvp_string = ”;
foreach($request_params as $var=>$val)
{
$nvp_string .= ‘&’.$var.’=’.urlencode($val);
}

// Send NVP string to PayPal and store response

View original post 42 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s