auth.net - Prior Auth Capture in Test Mode - authorize.net

I'm attempting to use Auth.net to authorize a transaction, then later capture it with prior_auth_capture. This works fine in a sandbox, but running against production in test mode I get some problems:
PRODUCTION_TESTMODE : Transaction Id: 0
PRODUCTION_TESTMODE : CC Authorization is APPROVED for 41.0 - customer Test User.
PRODUCTION_TESTMODE : Auth Code: 000000
Credit card transaction was successful - card was approved for 41.00.
Later, when we try to capture the transaction, we have a problem because auth.net won't accept the transaction ID 0:
PRODUCTION_TESTMODE : CC Capture is ERROR for 41.0 - transaction ID 0
PRODUCTION_TESTMODE : RRC_3_33 : (TESTMODE) A valid referenced transaction ID is required.
Credit card capture was not successful - reason: (TESTMODE) A valid referenced transaction ID is required.
I haven't been successful in finding any documentation around this. Is it normal that prior_auth_capture fails like this in test mode? Is there a way we can handle this, or must we check for transaction ID == 0 and introduce special handling here?

You must be running in Live Mode to process transactions.
Test mode doesn't actually process a transaction, it simply validates that the API Login and Transaction Key are correct for the targeted endpoint, and returns success.

Related

Im trying to fetch all transactions of a certain tron address

i couldnt find a way to get the history of transactions a certain Tron address is involved in
i tried the tronweb API : https://api.trongrid.io/v1/accounts/TJmmqjb1DK9TTZbQXzRQ2AuA94z4gKAPFh/transactions/trc20?limit=100&contract_address=TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t
yet this didnt do anything.
so has anyone managed to find a way to do this ?
It's quiet simple just make a GET request to the following url:
https://api.trongrid.io/v1/accounts/{wallet-address}/transactions/{standard}?&contract_address={contract-address}
Replace {wallet-address} with your desired tron wallet address.
Replace {standard} with the standard of token that you want e.g. trc20.
Replace {contract_address} with the address of the contract of your target token e.g. TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t (USD Tether).
Here are all possible parameters :
only_confirmed (boolean) :
true | false. If false, it returns both confirmed and unconfirmed transactions. If no param is specified, it returns both confirmed and unconfirmed transactions. Cannot be used at the same time with only_unconfirmed param.
only_unconfirmed (boolean) :
true | false. If false, it returns both confirmed and unconfirmed transactions. If no param is specified, it returns both confirmed and unconfirmed transactions. Cannot be used at the same time with only_confirmed param.
limit (int32) :
number of transactions per page, default 20, max 200
fingerprint (string) :
fingerprint of the last transaction returned by the previous page; when using it, the other parameters and filters should remain the same
order_by (string) :
block_timestamp,asc | block_timestamp,desc (default)
min_timestamp (date-time) :
minimum block_timestamp, default 0
max_timestamp (date-time) :
maximum block_timestamp, default now
contract_address (string) :
contract address in base58 or hex
only_to (boolean) :
true | false. If true, only transactions to this address, default: false
only_from (boolean)
true | false. If true, only transactions from this address, default: false
I had success by hitting this endpoint: (docs here)
https://api.trongrid.io/v1/contracts/${contractAddress}/events?block_number=${blockNumber}&only_confirmed=true
It looks like another option is to use TronWeb's getEvents() endpoint:
How to get TRC20 transactions to an address
There is also this, which seems kind of similar:
https://developers.tron.network/reference/geteventresult
The tron GET endpoint you're looking for is: "api.trongrid.io/v1/accounts/{address}/transactions"
Replace {address} with your tron wallet address. Cheers!
You can download it in a CSV format from the tronscan.org
but keep in mind that only the first 10,000 transactions are available.

Bitnami Parse Server Dashboard add mail adapter

I am using Parse Server from the market place of AWS and is able to access the database without a problem. But, I am not able to send email verification to newly signed up users.
After did some research, I know that I have to add Mail Adapter and enable a few parameters for the Parse Server but I don't know how to add Adapter from the dashboard
https://github.com/parse-community/parse-server#email-verification-and-password-reset
It's not possible to add a mail adapter using the dashboard. You should have the Mailgun adapter installed by default.
To add the configuration you need to access your server and add the following to your index.js file:
var server = ParseServer({
...otherOptions,
// Enable email verification
verifyUserEmails: true,
// if `verifyUserEmails` is `true` and
// if `emailVerifyTokenValidityDuration` is `undefined` then
// email verify token never expires
// else
// email verify token expires after `emailVerifyTokenValidityDuration`
//
// `emailVerifyTokenValidityDuration` defaults to `undefined`
//
// email verify token below expires in 2 hours (= 2 * 60 * 60 == 7200 seconds)
emailVerifyTokenValidityDuration: 2 * 60 * 60, // in seconds (2 hours = 7200 seconds)
// set preventLoginWithUnverifiedEmail to false to allow user to login without verifying their email
// set preventLoginWithUnverifiedEmail to true to prevent user from login if their email is not verified
preventLoginWithUnverifiedEmail: false, // defaults to false
// The public URL of your app.
// This will appear in the link that is used to verify email addresses and reset passwords.
// Set the mount path as it is in serverURL
publicServerURL: 'https://example.com/parse',
// Your apps name. This will appear in the subject and body of the emails that are sent.
appName: 'Parse App',
// The email adapter
emailAdapter: {
module: '#parse/simple-mailgun-adapter',
options: {
// The address that your emails come from
fromAddress: 'parse#example.com',
// Your domain from mailgun.com
domain: 'example.com',
// Your API key from mailgun.com
apiKey: 'key-mykey',
}
},
// account lockout policy setting (OPTIONAL) - defaults to undefined
// if the account lockout policy is set and there are more than `threshold` number of failed login attempts then the `login` api call returns error code `Parse.Error.OBJECT_NOT_FOUND` with error message `Your account is locked due to multiple failed login attempts. Please try again after <duration> minute(s)`. After `duration` minutes of no login attempts, the application will allow the user to try login again.
accountLockout: {
duration: 5, // duration policy setting determines the number of minutes that a locked-out account remains locked out before automatically becoming unlocked. Set it to a value greater than 0 and less than 100000.
threshold: 3, // threshold policy setting determines the number of failed sign-in attempts that will cause a user account to be locked. Set it to an integer value greater than 0 and less than 1000.
},
// optional settings to enforce password policies
passwordPolicy: {
// Two optional settings to enforce strong passwords. Either one or both can be specified.
// If both are specified, both checks must pass to accept the password
// 1. a RegExp object or a regex string representing the pattern to enforce
validatorPattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})/, // enforce password with at least 8 char with at least 1 lower case, 1 upper case and 1 digit
// 2. a callback function to be invoked to validate the password
validatorCallback: (password) => { return validatePassword(password) },
validationError: 'Password must contain at least 1 digit.' // optional error message to be sent instead of the default "Password does not meet the Password Policy requirements." message.
doNotAllowUsername: true, // optional setting to disallow username in passwords
maxPasswordAge: 90, // optional setting in days for password expiry. Login fails if user does not reset the password within this period after signup/last reset.
maxPasswordHistory: 5, // optional setting to prevent reuse of previous n passwords. Maximum value that can be specified is 20. Not specifying it or specifying 0 will not enforce history.
//optional setting to set a validity duration for password reset links (in seconds)
resetTokenValidityDuration: 24*60*60, // expire after 24 hours
}
});
You will need to replace some of the values with your own. See here for more details.

Flask-LDAP3-Login Filter issue - User cannot login

Using flask-ldap3-login to query AD for my web app logins. Works for everyone; but, for users who have "()" in their First name in AD. Here's the Debug log.
UN-SUCCESSFULL LOGIN
DEBUG:root:Validating LDAPLoginForm against LDAP
DEBUG:flask_ldap3_login:Opening connection with bind user 'mybinduser#mydomain.com'
DEBUG:flask_ldap3_login:Successfully bound to LDAP as 'mybinduser#mydomain.com' for search_bind method
DEBUG:flask_ldap3_login:Performing an LDAP Search using filter '(&(objectclass=person)(sAMAccountName=ebadu))', base 'DC=mydomain,DC=com', and scope 'SUBTREE'
DEBUG:flask_ldap3_login:Opening connection with bind user 'CN=Badu\, Ericka (EB),OU=HELPDESK,DC=mydomain,DC=com'
DEBUG:flask_ldap3_login:Directly binding a connection to a server with user:'CN=Badu\, ericka (EB),OU=HELPDESK,DC=mydomain,DC=com'
DEBUG:flask_ldap3_login:Authentication was successful for user 'ebadu'
DEBUG:flask_ldap3_login:Searching for groups for specific user with filter '(&(objectclass=group)(uniqueMember=CN=Badu\, Ericka (EB),OU=HELPDESK,DC=mydomain,DC=com))' , base 'DC=mydomain,DC=com' and scope 'LEVEL'
ERROR:flask_ldap3_login:malformed filter
DEBUG:flask_ldap3_login:Destroying connection at <0x7f8629604c50>
DEBUG:flask_ldap3_login:Destroying connection at <0x7f8628eabf98>
SUCCESFULL LOGIN
DEBUG:root:Validating LDAPLoginForm against LDAP
DEBUG:flask_ldap3_login:Opening connection with bind user 'mybinduser#mydomain.com'
DEBUG:flask_ldap3_login:Successfully bound to LDAP as 'mybinduser#mydomain.com' for search_bind method
DEBUG:flask_ldap3_login:Performing an LDAP Search using filter '(&(objectclass=person)(sAMAccountName=mpeters))', base 'DC=mydomain,DC=com', and scope 'SUBTREE'
DEBUG:flask_ldap3_login:Opening connection with bind user 'CN=Peters\, Mike,OU=HELPDESK,DC=mydomain,DC=com'
DEBUG:flask_ldap3_login:Directly binding a connection to a server with user:'CN=Peters\, Mike,OU=HELPDESK,DC=mydomain,DC=com'
DEBUG:flask_ldap3_login:Authentication was successful for user 'mpeters'
DEBUG:flask_ldap3_login:Searching for groups for specific user with filter '(&(objectclass=group)(uniqueMember=CN=Peters\, Mike,OU=HELPDESK,DC=mydomain,DC=com))' , base 'DC=mydomain,DC=com' and scope 'LEVEL'
DEBUG:flask_ldap3_login:Destroying connection at <0x7f8629683828>
DEBUG:flask_ldap3_login:Destroying connection at <0x7f8628e91048>
The AD logs says "An account was successfully logged on"; however, the user does not log in to the app. The user has no issues login in with the AD credentials anywhere else.
What might be the issue?
This is the flask-ldap3-login code:
LDAP_USER_RDN_ATTR = 'cn'
LDAP_USER_LOGIN_ATTR = 'sAMAccountName'
LDAP_BASE_DN = 'DC=mydomain,DC=com'
LDAP_REQUIRED_GROUP = 'ou=helpdesk,dc=mydomain,dc=com'
LDAP_USER_SEARCH_SCOPE = 'SUBTREE'
But "malformed filter" usually means that the LDAP query sent to AD isn't valid somehow. I asked about odd characters on the account, since if some special characters are not encoded properly, they can be misinterpreted as special characters used in LDAP queries.
It could be a bug in your code, or a bug in flask-ldap3-login. If you show your code, I might be able to give you some pointers.
Also, see if you can enable debug logging. It may tell you what the actual filter is that made it bomb. I'm not familiar with flask-ldap3-login, but, looking at the documentation, this might do it?:
app.config['DEBUG'] = True
SOLVED! Seems to be solved in the latest version of flask-ldap3-login. I did not upgrade but modified existing code:
Replaced this:
`search_filter = '(&{group_filter}({members_attr}={user_dn}))'.format('`
`group_filter=self.config.get('LDAP_GROUP_OBJECT_FILTER'),`
`members_attr=self.config.get('LDAP_GROUP_MEMBERS_ATTR'),`
`user_dn=dn`
with this:
`safe_dn = ldap3.utils.conv.escape_filter_chars(dn)`
`search_filter = '(&{group_filter}({members_attr}={user_dn}))'.format(`
`group_filter=self.config.get('LDAP_GROUP_OBJECT_FILTER'),`
`members_attr=self.config.get('LDAP_GROUP_MEMBERS_ATTR'),`
`user_dn=safe_dn`

Receipt_id is null in Paypal response, How can I get it?

I have integrated Paypal with my rails application by activemerchant gem, As of now I'm getting token and payer_id, but I need receipt_id which is null in response.
I have followed steps given in this link.
Response of Paypal is given below
"timestamp"=>"2016-04-12T19:23:46Z", "ack"=>"Success",
"correlation_id"=>"000a000f000r", "version"=>"124", "build"=>"000000",
"token"=>"AB-000000000000000", "transaction_id"=>"kjKJKHkj09809FED2",
"parent_transaction_id"=>NULL, "receipt_id"=>NULL,
"transaction_type"=>"express-checkout", "payment_type"=>"instant",
"payment_date"=>"2016-04-12T19:23:46Z", "gross_amount"=>"160.00",
"gross_amount_currency_id"=>"USD", "fee_amount"=>"6.54",
"fee_amount_currency_id"=>"USD", "tax_amount"=>"0.00",
"tax_amount_currency_id"=>"USD", "exchange_rate"=>NULL,
"payment_status"=>"Completed", "pending_reason"=>"none",
"reason_code"=>"none", "protection_eligibility"=>"Eligible",
"protection_eligibility_type"=>"ItemNotReceivedEligible,UnauthorizedPaymentEligible",
"secure_merchant_account_id"=>"JHBJKJKJBKJBKJH",
"success_page_redirect_requested"=>"false",
"coupled_payment_info"=>NULL, "Token"=>"AB-000000000000000",
"PaymentInfo"=>"{"TransactionID"=>"kjKJKHkj09809FED2",
"ParentTransactionID"=>nil, "ReceiptID"=>nil,
"TransactionType"=>"express-checkout", "PaymentType"=>"instant",
"PaymentDate"=>"2016-04-12T19:23:46Z", "GrossAmount"=>"160.00",
"FeeAmount"=>"6.54", "TaxAmount"=>"0.00", "ExchangeRate"=>nil,
"PaymentStatus"=>"Completed", "PendingReason"=>"none",
"ReasonCode"=>"none", "ProtectionEligibility"=>"Eligible",
"ProtectionEligibilityType"=>"ItemNotReceivedEligible,UnauthorizedPaymentEligible",
"SellerDetails"=>{"SecureMerchantAccountID"=>"JHBJKJKJBKJBKJH"}}",
"SuccessPageRedirectRequested"=>"false", "CoupledPaymentInfo"=>NULL
Is there any configuration in Paypal account to get receipt_id, or any request parameter I have to add/change?
Please suggest.
Thanks in advance.
I have discussed this with paypal developer support and it seems like the transaction sale ID is the appropriate ID to record and return to the user, it is also what gets recorded in the paypal account for a credit card transaction so if a user had a support question, it is the easiest number to give to accounts to look up the transaction details.
I am not 100% sure about how to access what is called the receipt_id, but I don't think it is intended to be populated in the response to the payment endpoint. If you are to get a receipt_id at all, it will likely come from hitting the endpoint GET /v1/payments/sale/<Transaction-Id>
As per the api, receipt_id is defined as
Receipt id is 16 digit number payment identification number returned for guest users to identify the payment.
I think "guest users" may have a specific meaning that is not relevant to just any transaction but I'm not positive on this.
I would recommend playing around with this endpoint after you get the transaction ID from the payments endpoint. The id located in the json returned from the payments endpoint at payment.transactions[0].related_resources[0].sale.id seemed to be the appropriate ID to record for a simple credit card transaction where I wanted to return a reference number to the client and to store for looking up the transaction at a later date.
I also was able to use that ID to interrogate the sale endpoint mentioned above for more information, but I never was able to get receipt_id to populate for a sandbox operation.
Hope this helps, I find some of the documentation to be lacking for the REST api.
"transactions": [
{
"amount": {
"total": "7.47",
"currency": "USD",
"details": {
"tax": "0.03",
"shipping": "0.03"
}
},
"description": "This is the payment transaction description.",
"related_resources": [
{
"sale": {
"id": "4RR959492F879224U",
"create_time": "2013-01-31T04:12:02Z",
"update_time": "2013-01-31T04:12:04Z",

WSO2 Identity Server - Error "Invalid Status" at entitlementServiceClient.getDecision

When using an access with userid & passsword based entitlement, and use of class "entitlementServiceClient", method "getDecision", the program always receives an error: "Invalid Status"
Is there anything missing in the usage of this class:
org.wso2.carbon.identity.entitlement.ui.client.EntitlementServiceClient;
my statements are:
//initialize authentication admin stub
UnitTest1 remoteEntitlementClient = new UnitTest1();
//login using authentication admin stub providing valid credentials
remoteEntitlementClient.login(userid, password);
//initialize entitlement service stub with obtained authentication cookie
remoteEntitlementClient.initUnitTest1();
String decision = entitlementServiceClient.getDecision(myRequest);
System.out.println("\nXACML Decision is received : " + decision);
The authorization process seems to works fine and it receives a valid login confirmation and cookie (see log below).
oc2615188332 entitlement]$ sh ./testit.sh
Jul 17, 2015 8:10:37 PM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
WARNING: Unable to determine dialect of the StAX implementation at jar:file:/home/claudef/tmp/wso2/entitlement/lib/axiom_1.2.11.wso2v4.jar!/
The user admin logged in successfully.
The IdP authorization cookie is: JSESSIONID=CDEEA143EB95A5AABEB07F5A401633B4; Path=/; Secure=null; HttpOnly=null
XACML Decision is received : Invalid Status
Elapsed seconds decimal: 6.937248979
Elapsed seconds rounded: 6.937
Entitlement flow finished successfully
Thanks in advance for support and advice.
Regards,
Claude