I need to integrate paypal payflow payment in my website. I have Used this Library.
My sample paypal pay flow sample response, Sample Output:
Array
(
[RESULT] => 0
[PNREF] => A30A2C9B2AD0
[RESPMSG] => Approved
[AUTHCODE] => 785PNI
[AVSADDR] => Y
[AVSZIP] => Y
[CVV2MATCH] => Y
[HOSTCODE] => A
[PROCAVS] => Y
[PROCCVV2] => M
[VISACARDLEVEL] => 12
[TRANSTIME] => 2018-01-22 03:51:49
[BILLTOFIRSTNAME] => Tester
[BILLTOLASTNAME] => Testerson
[AMT] => 10.50
[ACCT] => 1111
[EXPDATE] => 1219
[CARDTYPE] => 0
[IAVS] => N
[PREFPSMSG] => No Rules Triggered
[POSTFPSMSG] => No Rules Triggered
[RAWREQUEST] => BUTTONSOURCE[18]=Paypal Transaction&VERBOSITY[4]=HIGH&USER[8]=aswinraj&VENDOR[11]=Vigneshwari&PARTNER[6]=Paypal&PWD[13]=vickyaswin#13&TENDER[1]=C&TRXTYPE[1]=S&ACCT[16]=4111111111111111&EXPDATE[4]=1219&AMT[5]=10.50&FREIGHTAMT[4]=5.00&TAXAMT[4]=2.50&COMMENT1[15]=This is a test!&COMMENT2[20]=This is only a test!&CVV2[3]=123&BILLTOEMAIL[22]=sandbox#testdomain.com&BILLTOPHONENUM[12]=816-555-5555&BILLTOFIRSTNAME[6]=Tester&BILLTOLASTNAME[9]=Testerson&BILLTOSTREET[13]=123 Test Ave.&BILLTOCITY[6]=TUCSON&BILLTOSTATE[2]=AZ&BILLTOZIP[9]=123456789&BILLTOCOUNTRY[3]=USA&SHIPTOFIRSTNAME[6]=Tester&SHIPTOLASTNAME[9]=Testerson&SHIPTOSTREET[13]=123 Test Ave.&SHIPTOCITY[6]=TUCSON&SHIPTOSTATE[2]=AZ&SHIPTOZIP[9]=123456789&SHIPTOCOUNTRY[3]=USA
[RAWRESPONSE] => RESULT=0&PNREF=A30A2C9B2AD0&RESPMSG=Approved&AUTHCODE=785PNI&AVSADDR=Y&AVSZIP=Y&CVV2MATCH=Y&HOSTCODE=A&PROCAVS=Y&PROCCVV2=M&VISACARDLEVEL=12&TRANSTIME=2018-01-22 03:51:49&BILLTOFIRSTNAME=Tester&BILLTOLASTNAME=Testerson&AMT=10.50&ACCT=1111&EXPDATE=1219&CARDTYPE=0&IAVS=N&PREFPSMSG=No Rules Triggered&POSTFPSMSG=No Rules Triggered
)
I have got only RESULT column as 0 and RESPMSG as approved in error response . But I need success Response .Please help me to fix the issue .
If Payflow API responds as RESTULT=0 & RESPMSG=approved, it means transaction has been completed without any error.
Click here to know about Payflow API response.
Click here to know more about RESPMSG with its explanation.
Related
I have a website where I need the user to log in. After logging in the user needs to make a payment and then he/she can check the rest of the website.
Now the problem that I'm facing is:
Suppose I log in with an account : 'a#gmail.com',
password : ******.
After that I get redirected to Paypal,
and there I log in using different credentials which are:
email : 'abc#gmail.com', password: ******.
All the process works perfectly till here. And my payment is even succesful.
But the issue that I face is:
How will I manage the Payment Status in my DB?
The log that I receive from paypal is:
Array
(
[mc_gross] => 30.00
[protection_eligibility] => Ineligible
[payer_id] => 9CABB2SHMA4MW
[tax] => 0.00
[payment_date] => 23:31:25 Nov 08, 2015 PST
[payment_status] => Completed
[charset] => windows-1252
[first_name] => abc
[mc_fee] => 1.47
[notify_version] => 3.8
[custom] =>
[payer_status] => unverified
[business] =>asadd#asd.com
[quantity] => 1
[verify_sign] => AQx90ScEndGDbMxp11maXxRe9dElAiIDxUQmtFtv8ASyfExv42B1SAra
[payer_email] => abc#gmail.com
[txn_id] => 54J45833C00682608
[payment_type] => instant
[last_name] => Prajapat
[receiver_email] => asadd#asd.com
[payment_fee] => 1.47
[receiver_id] => 8DMUTQEYCK35S
[txn_type] => web_accept
[item_name] => Membership Cost
[mc_currency] => USD
[item_number] => Abc
[residence_country] => IN
[test_ipn] => 1
[handling_amount] => 0.00
[transaction_subject] =>
[payment_gross] => 30.00
[shipping] => 0.00
[ipn_track_id] => aae79d1f40a3a
)
So, please suggest to me whether there is any solution for it.
Or at the time of registration, do I need to mention to users that you need to use only that id which is registered with paypal?
Please help me, I'm new to paypal and I have no knowledge about it.
Finally after searching a lot, I got the solution. I just hope that it helps others as well if they face the same issue.
This url solved my issue. Add a custom variable to your form and then retrieve it on your success payment page.
Example :
<input type='hidden' name='custom' value='<?php echo $email; ?>'/>
and then retrieve it as :
$_POST['custom']
I hope it solves others issue as well.
Here is example of PayPal Express Checkout Recurring Payment IPN request:
[mc_gross] => 6.56
[period_type] => Regular
[outstanding_balance] => 0.00
[next_payment_date] => 03:00:00 Jun 21, 2012 PDT
[protection_eligibility] => Ineligible
[payment_cycle] => Weekly
[tax] => 0.00
[payer_id] => K48P3Fxxxx
[payment_date] => 16:52:28 Jun 14, 2012 PDT
[payment_status] => Completed
[product_name] => Virtual Subscription $6.56 / week for 3 weeks
[charset] => windows-1252
[rp_invoice_id] => 208
[recurring_payment_id] => I-4DHKxxxx
[first_name] => Test
[mc_fee] => 0.38
[notify_version] => 3.4
[amount_per_cycle] => 6.56
[payer_status] => verified
[currency_code] => USD
[business] => xxxx#gmail.com
[verify_sign] => AlAlnsACWRTf4OV6vRMZG4sCyEdYACBnr7ishagKt60BxtlJgPjaRIAh
[payer_email] => xxxx#gmail.com
[initial_payment_amount] => 0.00
[profile_status] => Active
[amount] => 6.56
[txn_id] => 3PE0612xxxx
[payment_type] => instant
[last_name] => User
[receiver_email] => xxxx#gmail.com
[payment_fee] => 0.38
[receiver_id] => TYDEKWLxxxx
[txn_type] => recurring_payment
[mc_currency] => USD
[residence_country] => US
[test_ipn] => 1
[transaction_subject] => Virtual Subscription $6.56 / week for 3 weeks
[payment_gross] => 6.56
[shipping] => 0.00
[product_type] => 1
[time_created] => 23:48:22 Jun 13, 2012 PDT
[ipn_track_id] => b2c853ddxxxx
As you can see, there is field called rp_invoice_id which is The merchant’s own unique reference or invoice number, which can be used to uniquely identify a profile.
When creating API call CreateRecurringPaymentsProfile, how to pass this value, which field should I set in the API call?
Thank you
You need to use the PROFILEREFERENCE parameter to pass in a value that will be returned via IPN in the rp_invoice_id parameter.
PROFILEREFERENCE
(Optional) The merchant's own unique reference or invoice number.
Character length and limitations: 127 single-byte alphanumeric characters
https://developer.paypal.com/webapps/developer/docs/classic/api/merchant/CreateRecurringPaymentsProfile_API_Operation_NVP/
It will not work like this, newer versions of API are using REST calls.
To make this working you have to first download Paypal SDK. It is available at http://paypal.github.io/sdk/
Make sure you use official version of SDK, there might be chances that you may use different version and someone may be sitting there to steal your valuable information. My suggestion is before start working go through original documentation, to have an idea.
Once you install SDK, then you could use the example given in the link below
https://devtools-paypal.com/guide/recurring_payment_cc/php?interactive=ON&env=sandbox
This will make API call.
Also you can try with complete documentation available at https://developer.paypal.com/webapps/developer/docs/api/
Happy Coding!
Atul Jindal
I have read other posts on the very same subject but I am pretty sure I have not fallen foul of the issues of those posts. This is really frustrating me now so any help or advice would be appreciated.
I am building the following array to be sent in the SetExpressCheckout call but upon each submission i get "The totals of the cart item amounts do not match order amounts " but I dont understand how!!
[METHOD] => SetExpressCheckout
[USER] => myusername
[PWD] => 1398341028
[SIGNATURE] => xxxsignaturexxx
[VERSION] => 85.0
[RETURNURL] => http://www.mysite.dev/payment/process
[CANCELURL] => http://www.mysite.dev/payment/cancelled
[PAYMENTREQUEST_0_PAYMENTACTION] => SALE
[NOSHIPPING] => 0
[PAYMENTREQUEST_0_AMT] => 189.00
[PAYMENTREQUEST_0_ITEMAMT] => 189.00
[PAYMENTREQUEST_0_TAXAMT] => 0
[PAYMENTREQUEST_0_SHIPPINGAMT] => 0
[PAYMENTREQUEST_0_HANDLINGAMT] => 0
[PAYMENTREQUEST_0_SHIPDISCAMT] => 0
[PAYMENTREQUEST_0_INSURANCEAMT] => 0
[PAYMENTREQUEST_0_CURRENCYCODE] => GBP
[LOCALECODE] => GB
[ALLOWNOTE] => 1
[L_PAYMENTREQUEST_0_NAME0] => Website Order
[L_PAYMENTREQUEST_0_NUMBER0] => 28424747
[L_PAYMENTREQUEST_0_AMT0] => 189.00
[L_PAYMENTREQUEST_0_QTY0] => 1
Many Thanks for reading.
Kris
I went ahead and tested your call using a test account and initially it gave a similar error to what you described. I did get it to work with the only modifications I made being the format and spacing of the call.
This is the call I submitted and got a successful response, note I did have to change the user, pwd, signature, version, returnrul, and cancelurl to be able to test it:
USER=chad_1311276857_biz_api1.x.com
PWD=NGAEWP367NNSDXP2
SIGNATURE=Aef0iZ4csmtdchFhBLFKNKS88OSVA0f08rNWMEUk1J-tsdbDOFq0JpNi
METHOD=SetExpressCheckout
VERSION=113.0
RETURNURL=http://ccaples.com/index.php/api-s/paypal-nvp/nvp-quick-test
CANCELURL=http://ccaples.com/index.php/api-s/paypal-nvp/nvp-quick-test
PAYMENTREQUEST_0_PAYMENTACTION=SALE
NOSHIPPING=0
PAYMENTREQUEST_0_AMT=189.00
PAYMENTREQUEST_0_ITEMAMT=189.00
PAYMENTREQUEST_0_TAXAMT=0
PAYMENTREQUEST_0_SHIPPINGAMT=0
PAYMENTREQUEST_0_HANDLINGAMT=0
PAYMENTREQUEST_0_SHIPDISCAMT=0
PAYMENTREQUEST_0_INSURANCEAMT=0
PAYMENTREQUEST_0_CURRENCYCODE=GBP
LOCALECODE=GB
ALLOWNOTE=1
L_PAYMENTREQUEST_0_NAME0=Website Order
L_PAYMENTREQUEST_0_NUMBER0=28424747
L_PAYMENTREQUEST_0_AMT0=189.00
L_PAYMENTREQUEST_0_QTY0=1
I use Express Checkout API (Name-Value Pair) to do the PayPal checkout. The problem is the login screen doesn't show Order Summary. I tried to set the below params like this post but it still shows empty info.
$options["PAYMENTREQUEST_0_DESC"] = "hieutot";
$options["PAYMENTREQUEST_0_ITEMAMT"] = "123";
$options["PAYMENTREQUEST_0_AMT"] = 300;
$options["PAYMENTREQUEST_0_PAYMENTACTION"] = "Sale";
$options["L_PAYMENTREQUEST_0_NAME0"] = "zzz";
$options["L_PAYMENTREQUEST_0_QTY0"] = 1;
$options["L_PAYMENTREQUEST_0_AMT0"] = 1000.00;
$options["L_PAYMENTREQUEST_0_NAME1"] = "test";
$options["L_PAYMENTREQUEST_0_QTY1"] = 1;
$options["L_PAYMENTREQUEST_0_AMT1"] = 200.00;
But when I tried to generate 10486 transaction error. The order summary appears! What a strange problem! How to fix it? Could it be a PayPal API bug? I'm using Zend Cart 1.3.8.
This is the request and response using cURL
REQUEST
Array
(
[ITEMAMT] => 0.00
[LOCALECODE] => US
[PAYMENTACTION] => Sale
[EMAIL] => sorryICannotShowThis#gmail.com
[PHONENUM] => xxxxxxxx
[SOLUTIONTYPE] => SOLE
[PAYMENTREQUEST_0_DESC] => hieutot
[PAYMENTREQUEST_0_ITEMAMT] => 123
[PAYMENTREQUEST_0_AMT] => 300
[PAYMENTREQUEST_0_PAYMENTACTION] => Sale
[L_PAYMENTREQUEST_0_NAME0] => zzz
[L_PAYMENTREQUEST_0_QTY0] => 1
[L_PAYMENTREQUEST_0_AMT0] => 1000
[L_PAYMENTREQUEST_0_NAME1] => test
[L_PAYMENTREQUEST_0_QTY1] => 1
[L_PAYMENTREQUEST_0_AMT1] => 200
[AMT] => 3,700.00
[RETURNURL] => https%3A%2F%2Flocalhost%2Fipn_main_handler.php%3Ftype%3Dec
[CANCELURL] => https%3A%2F%2Flocalhost%2Findex.php%3Fmain_page%3Dshopping_cart%26amp%3Bec_cancel%3D1
[PAGESTYLE] => Primary
[METHOD] => SetExpressCheckout
[CURRENCYCODE] => JPY
)
RESPONSE
Array
(
[TOKEN] => sorryICannotShowThis
[TIMESTAMP] => 2013%2d11%2d21T08%3a37%3a09Z
[CORRELATIONID] => 35adcd4bd76d5
[ACK] => Success
[VERSION] => 3%2e2
[BUILD] => 8549850
[CURL_ERRORS] =>
)
Please double check the VERSION used in your API requests:
[VERSION] => 3%2e2
I'd suggest to use any version above 63.0 (which can support Line item)
See: https://developer.paypal.com/webapps/developer/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/
"This field is introduced in version 53.0. L_NAMEn is deprecated since version 63.0. Use L_PAYMENTREQUEST_0_NAMEm instead."
hey guys was hoping you could help me out.
I cant seem to find any proper reference or documentation for their direct payments api and variables so I am asking here now.
I am doing direct payment for the first time and according to their integration guide, the payment status should be "successful" but this is the response I am getting (i.e i do print_r($doDirectPaymentResponse); where the variable comes from
$doDirectPaymentResponse = $paypalService->DoDirectPayment($doDirectPaymentReq,$credential_object);
)
DoDirectPaymentResponseType Object
(
[Amount] => BasicAmountType Object
(
[currencyID] => USD
[value] => 12.00
)
[AVSCode] => X
[CVV2Code] => M
[TransactionID] => 9H515811FE178263Y
[PendingReason] =>
[PaymentStatus] =>
[FMFDetails] =>
[ThreeDSecureResponse] =>
[PaymentAdviceCode] =>
[Timestamp] => 2013-02-01T15:56:31Z
[Ack] => Success
[CorrelationID] => a0a240936bf65
[Errors] =>
[Version] => 94.0
[Build] => 5060305
)
also, what exactly does the ack field tell?
Ack is the field you want to pay attention to. If it's Success or SuccessWithWarning, the payment went through successfully, and TransactionID has your transaction ID. If it's Failure or FailureWithWarning, it didn't go through.