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.



