Get Transaction status from Paypal using Merchant's transaction id - api

Paypal provides GetTransactionDetails API call to get the transaction status of a transaction. But it requires TRANSACTIONID as mandatory parameter which is transaction id assigned by Paypal to this transaction.
This TRANSACTIONID is returned by Paypal after completion of the payment. But in scenarios when the customer has made the payment and is returning to merchant page and the network is disrupted, the merchant won't be able to get the status of payment as well as the transaction id of paypal. How would the merchant be able to get the transaction later using API call? Is there any way to get the status using the transaction Id of the merchant?

You can pass your own invoice id in the variable "INVNUM" and then run the "TransactionSearch" API to get the details by passing the "INVNUM" which will give you the response with PayPal's transaction id (if transaction would have been gone thru ).
And once you get the transaction id for PayPal , run the "GetTransactionDetails" API to the detailed information . I have included the sample request and response where in the first api I used my own invnum to fetch the details and then using the PayPal's txn id in response I fetched the complete detail.
NVP Request:
USER=us-XXXX&PWD=XXXX&SIGNATURE=XXXX&VERSION=109.0&METHOD=TransactionSearch&STARTDATE=2015-08-08T00:00:00Z&TRANSACTIONCLASS=All&INVNUM=MyOWNID123456
NVP Response:
L_TIMESTAMP0=2015-08-20T16:43:10Z
L_TIMEZONE0=GMT
L_TYPE0=Payment
L_NAME0=John Test
L_TRANSACTIONID0=33407257W5286551J
L_STATUS0=Completed
L_AMT0=0.01
L_CURRENCYCODE0=USD
L_FEEAMT0=-0.01
L_NETAMT0=0.00
TIMESTAMP=2015-08-20T16:44:22Z
CORRELATIONID=7247ad390a76
ACK=Success
VERSION=109.0
BUILD=000000
NVP Request:
USER=XXXX&PWD=XXXX&SIGNATURE=XXX&VERSION=109.0&METHOD=GetTransactionDetails&TRANSACTIONID=33407257W5286551J
NVP Response:
RECEIVERBUSINESS=XXXXX
RECEIVEREMAIL=XXXXXX
RECEIVERID=XXXXX
PAYERID=RPP8F58J274JG
PAYERSTATUS=unverified
COUNTRYCODE=US
ADDRESSOWNER=PayPal
ADDRESSSTATUS=None
INVNUM=MyOWNID123456
SALESTAX=0.00
SHIPAMOUNT=0.00
SHIPHANDLEAMOUNT=0.00
TIMESTAMP=2015-08-21T04:03:50Z
CORRELATIONID=db0509e83df7c
ACK=Success
VERSION=109.0
BUILD=000000
FIRSTNAME=John
LASTNAME=Test
TRANSACTIONID=33407257W5286551J
RECEIPTID=5098-8700-1518-0878
TRANSACTIONTYPE=webaccept
PAYMENTTYPE=instant
ORDERTIME=2015-08-20T16:43:10Z
AMT=0.01
FEEAMT=0.01
TAXAMT=0.00
CURRENCYCODE=USD
PAYMENTSTATUS=Completed
PENDINGREASON=None
REASONCODE=None
PROTECTIONELIGIBILITY=Ineligible
PROTECTIONELIGIBILITYTYPE=None
L_QTY0=1
L_TAXAMT0=0.00
L_CURRENCYCODE0=USD
L_TAXABLE0=false

Related

Create Refund on square_connect Ruby sdk gives INTERNAL SERVER ERROR

I am using square_connect ruby gem to refund payments.
body =
#<SquareConnect::CreateRefundRequest
#amount_money=#<SquareConnect::Money #amount=200, #currency="USD">,
#idempotency_key="be70cc12-28dd-4168-96ea-6eb78f299207",
#tender_id="asdkasdkakdakdakda">
All other parameters are just as intended. I have changed Tender key too.
result = api_instance.create_refund(authorization, location_id, transaction_id, body)
This gives me INTERNAL SERVER ERROR.
ETHON: performed EASY effective_url=https://connect.squareup.com/v2/locations/BP6GXQNEANA9B/transactions/b2fd4689-af1b-40a4-b706-aafd592e1111/refund response_code=500 return_code=ok total_time=1.883598
SquareConnect::ApiError: Internal Server Error - {"errors":[{"category":"API_ERROR","code":"INTERNAL_SERVER_ERROR","detail":"An internal error has occurred, and the API was unable to service your request."}]}
Are you sure that your tender_id matches a tender you want to refund? 500 isn't the correct response, but it seems like you are likely not selecting a correct tender to refund.
Also you should look into upgrading your SDK to the latest version.
This is a major bug in the Square Connect API. I was actually trying with a wrong transaction ID, instead of getting something like "Incorrect Transaction ID" I was getting 500 Internal Server Error.
I have been using Stripe, Payflow. Authorize.net, Braintree and Moneris API for almost 2 years now but I have never received a 500 Internal server error for a wrong transaction Id. So Square needs to address it on urgent basis.

How to get received/sent transactions from bitcoin core?

I have configured bitcoin core daemon. Using JSON-RPC I want to build web wallet. This why I need list of all incoming/outgoing transactions.
listtransactions returns only incoming transactions.
Questions:
How to get outgoing & incoming transactions?
In listtransactions field address - is it receiver or sender?
If I can't get outgoing transactions using listtransactions, why here is may be three categories like "move", "receive" and "send"?
Problem was in provided account. When I set it to "*" all transactions was received.
Wrong
listtransactions('my_account', 100)
Right
listtransactions('*', 100)
For getting listtransactions of bitcoind server command is
bitcoin-cli listtransactions (This command will return last 10 transactions)
bitcoin-cli listtransactions "*" 100 0 (This command will return last 100 transactions here 0 to 100 transactions)

Paypal error 10413

I am working with the paypal express checkout API and am having issues.
I have a request like so:
METHOD=SetExpressCheckout
...
&L_PAYMENTREQUEST_0_NAME0=Individual%20Gross%20&%20Net
&L_PAYMENTREQUEST_0_AMT0=65.00
&L_PAYMENTREQUEST_0_QTY0=1
&PAYMENTREQUEST_0_AMT=70.26
&PAYMENTREQUEST_0_TAXAMT=5.26
&PAYMENTREQUEST_0_ITEMAMT=65.00
&PAYMENTREQUEST_0_PAYMENTACTION=Sale
&PAYMENTREQUEST_0_CURRENCYCODE=USD
I have reviewed this many times and see no error in the math, yet this is what paypal sends me.
TIMESTAMP : 2017-03-22T01:41:05Z
CORRELATION ID : e22e8009c7018
ACK : Failure
VERSION : 88.0
BUILD : 31129382
L_SEVERITYCODE0 : Error
Error Code : 10413
Transaction refused because of an invalid argument. See additional error messages for details.
The totals of the cart item amounts do not match order amounts.
I found that PayPal responded this way because I did not include L_PAYMENTREQUEST_0_NUMBER0 . After including that field, it was accepted. I must say that the error message sent to me lead to me to the wrong issue

Braintree Sandbox Test Transaction settle() returns transaction status SETTLING instead of SETTLED

I'm following documentation for testing Braintree settlement status:
https://developers.braintreepayments.com/reference/general/testing/php#settlement-status
Doc says:
$result = Braintree_Test_Transaction::settle($sale_result->transaction->id);
$result->success
# true
$result->transaction->status
# Braintree_Transaction::SETTLED
I was testing with VISA card.
So expected result is transaction status "settled" (Braintree_Transaction::SETTLED).
Actual result is transaction status "settling" (Braintree_Transaction::SETTLING)
It's not a big deal but still I would be expecting SETTLED as stated in the documentation.
Anyone having same experience testing \Braintree\Test\Transaction::settle($transactionId) ?
Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.
While I can't personally recreate this behavior, I could imagine the gateway returning SETTLING rather than blocking until the settlement completes. Once the settle() call has returned, you can call
Braintree\Transaction::find($sale_result->transaction->id)
and inspect the status of that transaction response object to see if the settlement has been completed.

Is credit card transaction expected to be declined for test transaction?

I am doing some development using payflow api
I created test only payflow account. (Transaction Process Mode = Test)
My program uses secure token with hosted check out page.
When I submit my credit card info in the hosted checkout page, the error URL of my program gets called with error code "12" transaction declined.
I try manual testing the payment by going to Paypal Manager-->Virtual Terminal-->Single Transaction. I filled up all the info (along with actual credit card details) and I got the same error - Result Code = 12. Response Message = Declined.
But when I click on "Transaction Details" --> Response Message (Declined) "Click here for fraud details"; it says "Status" as "Passed".
I tried this for both transaction type Sale and Authorize.
So is the error code 12 and Response message "Declined" is because of "Transaction Mode" is Test?
some extra info:
TYPE = 'S'
PREFPSMSG = 'No Rules Triggered'
RESPMSG = 'Declined'
RESULT = '12'
Payflow and Braintree (I believe) give you different results based on what amount so that you can test decline, etc. Make sure your test amount is less than $1001.