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

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.

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.

Some errors while changing default currency in odoo 10.0...

How to change the default currency in Odoo 10.0 without exchange rate ?
I tried the method from http://www.surekhatech.com/blog/change-currency-in-pos-in-odoo-10
But I got the errors such as
When in POS, I tried to "Validate Closing & Post Entries", I got Odoo warning There is no account defined on the journal Cash for Profit involved in a cash difference and can not post the POS transaction.
While in POS checkout, the unsolved problems on https://www.odoo.com/forum/help-1/question/10-0-a-transaction-can-t-have-a-0-amount-none-error-on-validate-odoo-pos-payment-121554
How to fix them ?
I also includeed the recorded screen on youtube at : https://youtu.be/IahubLwnDDE
In solution of your 1st error you need to define opening and closing account in payment methods define in POS front. For that POS >> Configuraion >> Payment Methods. In that choose payment method which active in POS and from that there are 2 fields name "Default Debit Account" and "Default Credit Account" define accounts here. By adding accounts here your 1st error is resolved. Don't know much about second error if you know then late me know. :)

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.

Get Transaction status from Paypal using Merchant's transaction id

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

Can't get PayPal checkout errors when insufficient funds

Can't get my head around PayPal payment response errors or at least warnings. I am Australian developer (at least I am located in Australia and using AUD as a currency).
Could you please tell me why if the sandbox user has insufficient funds the transaction has a positive (valid) response on the request for payment?
So I have user_A who is buyer and a seller_user. user_A has 0AUD and makes a transaction of 20AUD of recurring payments and the response is successful??? Why?
What is the way to get to know that user doesn't have sufficient funds for the transaction?
gem: paypal-recurring
rails: 3.2.14
location: Australia
====== Controller action for redirecting to checkout url
ppl = PayPal::Recurring.new(
return_url: paypal_confirm_url(:plan_id => params[:plan_id], :user_id => current_user.id),
cancel_url: paypal_no_checkout_url,
description: "Starter",
amount: 15,
currency: "AUD"
)
response = ppl.checkout
if response.valid?
redirect_to response.checkout_url
else
redirect_to :back
end
==== Controller action after confirmation
ppr = PayPal::Recurring.new(
token: params[:token],
payer_id: params[:PayerID],
description: plan.name,
amount: plan.value,
currency: "AUD",
period: :monthly,
start_at: Time.zone.now,
frequency: 1
)
response = ppr.request_payment
if response.errors.any?
flash.keep[:error] = "Something went wrong please contact paypal or ask our development team: team.grapple1#gmail.com"
return false
end
response = ppr.create_recurring_profile
paypal_recurring_profile_token = response.profile_id # response.profile_id = nil????
save!
All PayPal sandbox accounts have a dummy bank account attached with unlimited funds. So when the PayPal account has $0, it just pulls from that "bank". For an insufficient funds error to occur, you would need to turn on negative testing somehow, though I think that produces errors based on trigger AMT variables. For classic APIs, I recommend just having your code look for an ACK response containing Success and treating the rest as an exception (perhaps printing out RESPMSG as a customer notice, though sometimes you'll want to replace that with your own error messaging)