PayPal Development – DirectPayment function

Lately I have been working with Paypal Developing. I stumbled upon the wizard and it gave me step by step instructions but when I tested the script, the script said that the function “DirectPayment” is undefined. They forgot to include the function. So I googled and googled but nothing. So I made the function myself. For all of you that need it, here it is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function DirectPayment($paymentType, $paymentAmount, $creditCardType,
	$creditCardNumber, $expDate, $cvv2, $firstName, $lastName,
	$street, $city, $state, $zip, $countryCode, $currencyCode)
{
	$nvpstr="&PAYMENTACTION=$paymentType&AMT=$paymentAmount&".
		"CREDITCARDTYPE=$creditCardType&ACCT=$creditCardNumber".
		"&EXPDATE=$expDate&CVV2=$cvv2&FIRSTNAME=$firstName".
		"&LASTNAME=$lastName&STREET=$street&CITY=$city&STATE=$state&ZIP=$zip".
		"&COUNTRYCODE=$countryCode&CURRENCYCODE=$currencyCode";
 
 
	$resArray=hash_call("doDirectPayment",$nvpstr);
	return $resArray;
}

Also, you may find this helpful. I got my inspiration from there.



 
 
 
Leave a comment
* Required.
* Required. Not published.
If you have one.

 

What we do

We do web programming and we do it at its best:
  • Websites based on MVC platform
  • Wordpress plugins and templates
  • Drupal modules and themes

Facebook for Business Purposes

 

Facebook has long ended in being just a social networking website and nobody could have predicted that it will be used as a powerful marketing tool. The fact that boosted the evolution of this socializing platform into such a powerful instrument is that nowadays it is available on any device that has a basic modern [...]