paypal payments pro direct payment check if successful - php

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.

Related

Paypal PayFlow pro Response always Fail

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.

PayPal Express Checkout - Create Recurring Payment Profile not working

We are Using Recurring Payments with the Express Checkout API. We follow the following link
https://developer.paypal.com/docs/classic/paypal-payments-pro/integration-guide/WPRecurringPayments/#id086513007E9
Recurring payment with Initial amount :-
My request to create recurring payment
METHOD=CreateRecurringPaymentsProfile&VERSION=86&PWD=password&USER=XXXXXXXXXX&SIGNATURE=signature&TOKEN=token&PROFILESTARTDATE=2014-11-26T10%3A15%3A48Z&DESC=Silver+-+USD+3.95&BILLINGPERIOD=Day&BILLINGFREQUENCY=4&INITAMT=1&AMT=1&CURRENCYCODE=USD&IPADDRESS=127.0.0.1&BUTTONSOURCE=PP-ECWizard
The response of request :-
Array
(
[PROFILEID] => I-L28955XWTU84
[PROFILESTATUS] => PendingProfile
[TIMESTAMP] => 2014-11-26T10:15:54Z
[CORRELATIONID] => 83fa402749c8c
[ACK] => Success
[VERSION] => 86
[BUILD] => 13630372
)
In response PROFILESTATUS is "PendingProfile" but it supposed to "ActiveProfile" and in customer account no amount deducted.
Without initial amount recurring
METHOD=CreateRecurringPaymentsProfile&VERSION=86&PWD=password&USER=XXXXXXXXXX&SIGNATURE=signature&TOKEN=token&PROFILESTARTDATE=2014-11-26T10%3A26%3A13Z&DESC=Silver+-+USD+3.95&BILLINGPERIOD=Day&BILLINGFREQUENCY=4&AMT=1&CURRENCYCODE=USD&IPADDRESS=127.0.0.1&BUTTONSOURCE=PP-ECWizard
The response of request :-
Array
(
[PROFILEID] => I-1RXFKHJ5H846
[PROFILESTATUS] => ActiveProfile
[TIMESTAMP] => 2014-11-26T10:26:21Z
[CORRELATIONID] => 6f793b6e64a35
[ACK] => Success
[VERSION] => 86
[BUILD] => 13630372
)
When I am doing recurring without initial amount it returns "ActiveProfile".
I want to do recurring with initial amount and expecting an active profile with instant initial amount deduction from the customer account, so please help me to fix this problem. Please note - pwd/signature/token is masked, in actual code we have put the real pwd/signature/token.
Thanks.
remove String INITAMT=1 ------> ActiveProfile

This transaction cannot be processed. Please enter a valid credit card number and type

Using Paypal's DoDirect Payment method I am getting This transaction cannot be processed. Please enter a valid credit card number and type. error.
I have entered correct Visa card number, Exp. date, and Correct US address with correct zip code.
I have check this error on paypal. Its showing me Invalid Data.
I am using sandbox account for test with test visa card number provided by paypal.
Please help me on this issue.
Thanks
EDITED
I am getting below error.
DoDirectPaymentResponseType Object
(
[Amount] => BasicAmountType Object
(
[currencyID] => USD
[value] => 0.01
)
[AVSCode] =>
[CVV2Code] =>
[TransactionID] =>
[PendingReason] =>
[PaymentStatus] =>
[FMFDetails] =>
[ThreeDSecureResponse] =>
[PaymentAdviceCode] =>
[Timestamp] => 2014-09-23T06:37:51Z
[Ack] => Failure
[CorrelationID] => bb70f300ab2bd
[Errors] => Array
(
[0] => ErrorType Object
(
[ShortMessage] => Invalid Data
[LongMessage] => This transaction cannot be processed. Please enter a valid credit card number and type.
[ErrorCode] => 10527
[SeverityCode] => Error
[ErrorParameters] =>
)
)
[Version] => 106.0
[Build] => 12932421 )
Based on very limited info you provided. I think you should set the both the server and the client to TEST mode in order to use the test VISA number in debug mode.
It seems that credit card number is not at all being passed to the PayPal , only the credit card type is being passed . Please check your code and make sure the credit card number is passed to the PayPal .

The totals of the cart item amounts do not match order amounts

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

php - paypal express checkout ipn order total

I'm trying to integrate PayPal's express checkout option to my website. Although when I submit the form I get this error:
Error : Order total is missing.
Array
(
[TIMESTAMP] => 2013%2d10%2d26T11%3a02%3a21Z
[CORRELATIONID] => b560763f62a46
[ACK] => Failure
[VERSION] => 76%2e0
[BUILD] => 8252112
[L_ERRORCODE0] => 10400
[L_ERRORCODE1] => 10001
[L_SHORTMESSAGE0] => Transaction%20refused%20because%20of%20an%20invalid%20argument%2e%20See%20additional%20error%20messages%20for%20details%2e
[L_SHORTMESSAGE1] => Transaction%20failed%20due%20to%20internal%20error
[L_LONGMESSAGE0] => Order%20total%20is%20missing%2e
[L_LONGMESSAGE1] => Internal%20Error
[L_SEVERITYCODE0] => Error
[L_SEVERITYCODE1] => Error
)
&CURRENCYCODE=USD
&PAYMENTACTION=Sale
&ALLOWNOTE=1
&PAYMENTREQUEST_0_CURRENCYCODE=USD
&PAYMENTREQUEST_0_AMT=
&PAYMENTREQUEST_0_ITEMAMT=
&L_PAYMENTREQUEST_0_QTY0=1
&PAYMENTREQUEST_0_AMT=
&L_PAYMENTREQUEST_0_NAME0=Fund+your+balance
&L_PAYMENTREQUEST_0_NUMBER0=rbl
&AMT=
&RETURNURL=http%3A%2F%2Fdomain.com%2Fincludes%2Fipn%2Fpaypal%2Fprocess.php
&CANCELURL=http%3A%2F%2Fdomain.com%2Faccount
I can't seem to find the issue...
Couple of problems
PAYMENTREQUEST_0_AMT is repeated twice
PAYMENTREQUEST_0_ITEMAMT and PAYMENTREQUEST_0_AMT are empty. You have to provide an amount you want to process. Your error message actually says this

Categories