Braintree accepting wrong value for account Number - node.js

I am using Braintree's Node.js SDK we got an issue regarding account number it accept garbage vale like that 11235***sdfsf**81321 which is wrong. Can anyone help? Braintree validation how to wrok?
merchantAccountParams = {
individual: {
firstName: "Jane",
lastName: "Doe",
email: "jane#14ladders.com",
phone: "5553334444",
dateOfBirth: "1981-11-19",
ssn: "456-45-4567",
address: {
streetAddress: "111 Main St",
locality: "Chicago",
region: "IL",
postalCode: "60622"
}
},
business: {
legalName: "Jane's Ladders",
dbaName: "Jane's Ladders",
taxId: "98-7654321",
address: {
streetAddress: "111 Main St",
locality: "Chicago",
region: "IL",
postalCode: "60622"
}
},
funding: {
descriptor: "Blue Ladders",
destination: braintree.MerchantAccount.FundingDestination.Bank,
email: "funding#blueladders.com",
mobilePhone: "5555555555",
accountNumber: "11235***sdfsf**81321",
routingNumber: "071101307"
},
tosAccepted: true,
masterMerchantAccountId: "14ladders_marketplace",
id: "blue_ladders_store"
};
gateway.merchantAccount.create(merchantAccountParams, function (err, result) {
});

We can validate the user input from our client side, then we can send a valid value to BrainTree. Account number validation result, we will get only after sending values to BrainTree, they will provide the result in their objects(using BrainTree dll) as a response value.
Please refer this article for more details.

Related

Can't communicate with graphql backend via axios

I'm working on a courier company API integration, but their API is in GraphQl, I need to send request via axios (I'm using nodejs - express), I have found some tutorials which explain how to do it but nothing seems to work
That is the documentation of a request
mutation {
order_create(
data: {
order_number: "11223344"
shop_name: "ExampleShop"
fulfillment_status: "pending"
order_date: "2019-07-29"
total_tax: "29.00"
subtotal: "150.00"
total_discounts: "20.00"
total_price: "159.00"
shipping_lines: {
title: "UPS"
price: "0.00"
carrier: "UPS"
method: "Ground"
}
shipping_address: {
first_name: "John"
last_name: "Johnson"
company: "The Johnson Co"
address1: "2543 Duck St."
address2: "Apt. 2"
city: "Oklahoma"
state: "Oklahoma"
state_code: "OK"
zip: "73008"
country: "US"
country_code: "US"
email: "johnjohnsonco#johnsonco.com"
phone: "5555555555"
}
billing_address: {
first_name: "John"
last_name: "Johnson"
company: "The Johnson Co"
address1: "2543 Duck St."
address2: "Apt. 2"
city: "Oklahoma"
state: "OK"
state_code: "OK"
zip: "73008"
country: "US"
country_code: "US"
email: "johnjohnsonco#johnsonco.com"
phone: "5555555555"
}
line_items: {
sku: "testSKU12345"
partner_line_item_id: "282960815"
quantity: 2
price: "150.00"
product_name: "Example Product"
fulfillment_status: "pending"
quantity_pending_fulfillment: 2
warehouse_id: "V2FyZWhvdYNlOjgwNzU="
}
required_ship_date: "2019-08-29"
}
) {
request_id
complexity
order {
id
order_number
shop_name
fulfillment_status
order_date
total_tax
subtotal
total_discounts
total_price
custom_invoice_url
account_id
email
profile
packing_note
required_ship_date
shipping_address {
first_name
last_name
company
address1
address2
city
state
state_code
zip
country
country_code
email
phone
}
line_items(first: 1) {
edges {
node {
id
sku
product_id
quantity
product_name
fulfillment_status
quantity_pending_fulfillment
quantity_allocated
backorder_quantity
eligible_for_return
customs_value
warehouse_id
locked_to_warehouse_id
}
}
}
}
}
}
I looked it up but nothing is working so far. How can I send this via axios ?

How can I set up a test, Stripe connect account on the backend and skip onboarding?

When I try to set up a test, Stripe connect account on the backend and skip onboarding, I run into address and identity verification issues. How can I resolve these?
Background: for testing backend features other than Stripe onboarding, it would be helpful to set up a test Stripe connect account that has completed onboarding. There are other answers here indicating that there is no one-call process to complete that, but it's not clear exactly what the steps are.
Below I try to complete this in 3 steps; but I am running into an issue: the address is unverified even though I'm using the address 'token' that the documentation says will automatically verify.
My steps:
Create an account token
Create a bank_account token
Create an account, using those tokens
Result: when I check the account after a few seconds (I wait 10 seconds for verification) I get:
account.payouts_enabled: true
account.charges_enabled: true
account.currently_due: [
"individual.address.line1"
]
account.past_due: []
account.eventually_due: []
account.disabled_reason: requirements.pending_verification
account.pending_verification: [
'individual.address.city',
'individual.address.line1',
'individual.address.postal_code',
'individual.address.state',
'individual.id_number'
]
The problem: why is the address line marked "currently_due" (when I'm using the documented token "address_full_match​") and address verification incomplete? Additionally, why is the individual.id_number pending verification (when I'm using the documented token "222222222")?
Code below, using the Stripe Node API:
const accountToken = await stripe.tokens.create({
account: {
business_type: 'individual',
individual: {
first_name: 'Jenny',
last_name: 'Rosen',
// https://stripe.com/docs/connect/testing
// Use these addresses for line1 to trigger certain verification conditions. You must pass in legitimate values for the city, state, and postal_code arguments.
// address_full_match​ Successful verification.
// address_no_match Unsuccessful verification.
address: {
line1: 'address_full_match​',
city: 'Columbus',
state: 'OH',
postal_code: '43214',
// country: 'US'
},
// https://stripe.com/docs/connect/testing#test-dobs
// 1901-01-01 Successful verification. Any other DOB results in unsuccessful verification.
// 1902-01-01 Successful, immediate verification. The verification result is returned directly in the response, not as part of a webhook event.
// 1900-01-01 This DOB will trigger an Office of Foreign Assets Control (OFAC) alert.
dob: {
day: 1,
month: 1,
year: 1902
},
// https://stripe.com/docs/connect/testing
// Use these personal ID numbers for individual[id_number] or the id_number attribute on the Person object to trigger certain verification conditions.
// 000000000 Successful verification. 0000 also works for SSN last 4 verification.
// 111111111 Unsuccessful verification (identity mismatch).
// 222222222 Successful, immediate verification. The verification result is returned directly in the response, not as part of a webhook event.
id_number: '222222222',
// ssn_last_4: '0000',
email: 'jenny.rosen#example.com',
phone: '000 000 0000'
},
tos_shown_and_accepted: true,
},
});
const bankAccountToken = await stripe.tokens.create({
bank_account: {
country: 'US',
currency: 'usd',
account_holder_name: 'Jenny Rosen',
account_holder_type: 'individual',
routing_number: '110000000',
account_number: '000123456789',
},
});
const account = await stripe.accounts.create({
type: 'custom',
country: 'US',
business_profile: {
mcc: '5734', // Merchant Category Code. 5734 = Computer Software Stores
product_description: 'Cool Beans, Inc',
},
external_account: bankAccountToken.id,
capabilities: {
card_payments: {
requested: true,
},
transfers: {
requested: true,
},
},
account_token: accountToken.id,
});
Here's the config that works for me:
async function createTestStripeAccount() {
return await stripe.accounts.create({
type: 'custom',
country: 'US',
capabilities: {
card_payments: { requested: true },
transfers: { requested: true }
},
business_type: 'individual',
external_account: {
object: 'bank_account',
country: 'US',
currency: 'usd',
routing_number: '110000000',
account_number: '000123456789'
},
tos_acceptance: { date: 1609798905, ip: '8.8.8.8' },
business_profile: { mcc: 5045, url: 'https://bestcookieco.com' },
individual: {
first_name: 'Test',
last_name: 'User',
phone: '+16505551234',
email: 'test#example.com',
id_number: '222222222',
address: {
line1: '123 State St',
city: 'Schenectady',
postal_code: '12345',
state: 'NY'
},
dob: {
day: 10,
month: 11,
year: 1980
}
}
})
}
I've managed to set it up today for my client in sandbox and production.
PHP version with using the official library SDK from stripe.
composer require stripe/stripe-php
At the time of this writing the above version of stripe/stripe-php is exactly v9.6.0
<?php
\Stripe\Stripe::setApiKey('yourSandbox-STRIPE_SECRET_KEY-Here');
\Stripe\Account::create([
"type" => "custom",
"country" => "GB",
"capabilities" => [
"card_payments" => [
"requested" => true,
],
"transfers" => [
"requested" => true,
],
],
"business_type" => "individual",
"external_account" => [
"object" => "bank_account",
"country" => "GB",
"currency" => "gbp",
"account_number" => "00012345",
],
'tos_acceptance' => ['date' => 1609798905, 'ip' => '8.8.8.8'],
"business_profile" => [
"mcc" => 5045,
"url" => "https://exmple.com",
],
"individual" => [
"first_name" => "Test",
"last_name" => "User",
"phone" => "+16505551234",
"email" => "test#example.com",
"id_number" => "222222222",
"address" => [
"line1" => "123 State St",
"city" => "London",
"postal_code" => "TF5 0DL",
],
"dob" => [
"day" => 01,
"month" => 01,
"year" => 1901,
],
],
]);
I hope it will help somebody to save some time. Cheers and good luck.
References:
https://stripe.com/docs/connect/custom-accounts#create
https://stripe.com/docs/connect/testing#identity-and-address-verification
https://stripe.com/docs/connect/updating-accounts
You have to add document field as well for upload document to make the account active for testing purpose.
const account = await stripe.accounts.create({
type: "custom",
country: "US",
capabilities: {
card_payments: { requested: true },
transfers: { requested: true },
},
business_type: "individual",
external_account: {
object: "bank_account",
country: "US",
currency: "usd",
routing_number: "110000000",
account_number: "000123456789",
},
tos_acceptance: { date: new Date(), ip: "8.8.8.8" },
business_profile: { mcc: 5045, url: "https://bestcookieco.com" },
individual: {
first_name: "custom_user",
last_name: "one",
phone: "+16505551234",
email: "custom_user1#yopmail.com",
id_number: "222222222",
address: {
line1: "address_full_match",
city: "Schenectady",
postal_code: "12345",
state: "NY",
},
dob: {
day: 01,
month: 01,
year: 1901,
},
verification: {
document: {
front: "file_identity_document_success",
},
},
},
});

"You cannot specify a different service agreement in FI" returned from Stripe

I am triying to create stripe connected account in testing mode referencing
service_agreement: 'recipient'
here with the full code I wrote:
account = Stripe::Account.create(
type: 'custom',
business_type: 'company',
email: account_params[:email],
external_account: "btok_us_verified",
capabilities: {
transfers: {requested: true}
},
company: {
name: "Test Company name 6",
tax_id: "000000000",
},
tos_acceptance: {
service_agreement: 'recipient',
date: Time.now.to_i,
ip: request.remote_ip,
}
)
After I made the call stripe returned this error.
You cannot specify a different service agreement in FI.
But stripe docs says recipient service agreement is available.
Can anyone help me to figure out this issue.
This should be possible, or at least it worked when I tested using my test US-based platform. You may need to explicitly specify the account country=FI:
account = Stripe::Account.create(
type: 'custom',
**country: 'FI',**
business_type: 'company',
email: account_params[:email],
external_account: "btok_us_verified",
capabilities: {
transfers: {requested: true}
},
company: {
name: "Test Company name 6",
tax_id: "000000000",
},
tos_acceptance: {
service_agreement: 'recipient',
date: Time.now.to_i,
ip: request.remote_ip,
}
)
If this does not resolve it for you I can create a test FI platform to try myself.

stripe.createToken('account') react-native

i'm using stripe in my web application , now i have to use this method (stripe.createToken('account', { business_type: 'individual',) in my react-native applicaiton, i want to know if there is any alternative for this method in react-native , using stripe tips doesnt have this method . please help .
const accountResult = await stripe.createToken('account', {
business_type: 'individual',
individual : {
first_name: values.firstname,
last_name: values.lastname,
email:this.props.data.email,
phone:this.state.phoneNumber,
address: {
line1: values.address.split(",")[0],
city: values.city,
state: 'France',
postal_code: values.postalcode.toString(),
},
dob:{
day:Day,
month:Month,
year:Year,
},
verification:{
additional_document:{
front:fileDatathree.id
},
document:{
front:fileData.id,
back:fileDatatwo.id
}
}
},
tos_shown_and_accepted: true,
});
thanks :

Not able to get authorization on 2checkout

I am trying to authorize orders on the 2checkout sandbox, it was working fine but suddenly it stopped. Now I am always getting:
Payment Authorization Failed: Please verify your information and try
again, or try another payment method.
var tco = new Twocheckout({
sellerId: "1234456688", //on my code I am sending my true seller id
privateKey: "XXXXXXX-XXXXXX-XXXXXX", //on my code I am sending my key
sandbox: true
});
var plan = SubscriptionService.getPlan(req.body.plan);
if(plan) {
var params = {
"merchantOrderId": new Date().valueOf()+"",
"token": req.body.token,
"currency": "USD",
"tangible": "N",
"lineItems": [
{
"name": plan.name,
"price": plan.price,
"type": "product",
"quantity": "1",
"productId": plan.id,
"recurrence": "1 Month",
"duration": "Forever",
"description": ""
}],
"billingAddr": {
"name": req.body.ccName,
"addrLine1": req.body.streetAddress,
"city": req.body.city,
"state": req.body.state,
"zipCode": req.body.zip,
"country": req.body.country,
"email": req.user.email,
"phoneNumber": "5555555555"
}
};
tco.checkout.authorize(params, function (error, data) {
if (error) {
res.send(error);
} else {
res.send(data.response);
}
});
}
}
this is the example of a json I am sending
{ merchantOrderId: '1494967223074',
token: 'ZTFiNmFkMjktZWNmMi00NjlhLWE0MDAtZmJkMGJlYjU5M2Q1',
currency: 'USD',
tangible: 'N',
lineItems:
[ { name: 'pro plan',
price: '149.00',
type: 'product',
quantity: '1',
productId: '002',
recurrence: '1 Month',
duration: 'Forever',
description: '' } ],
billingAddr:
{ name: 'Testing Tester',
addrLine1: '123 Main Street',
city: 'Townsville',
state: 'ohio',
zipCode: '43206',
country: 'USA',
email: 'victor.eloy#landmarkwebteam.com',
phoneNumber: '55555555' } }
If I go to my account >> site management and set demo to true I manage to get authorizations from the sandbox but the orders do not get logged to the sandbox. Previously even when the demo mode was off I managed to get the orders authorized but now I don't know what is happening.
here comes a log from one order:
I have the exact same problem. Just 4 days ago the code was working fine. I'm assuming it's something from 2checkout not from our code..
Only thing I can see is you are attempting to parse
"zipCode": req.body.zip
but you are sending
zipCode: '43206'
I assume this should be parsed as req.body.zipCode

Resources