How to use customer ID in the Stripe Connect Charge Java API (managed account)? - stripe-connect

I am new to Stripe connect. I am trying to use Stripe connect to charge money to a source account and send it a destination account. The source parameter in the below code should accept the source account id as per the infomation at https://stripe.com/docs/api/php#create_charge-source. But I am getting the error com.stripe.exception.InvalidRequestException: No such token: cus_xxxxxx where cus_xxxxxx is the customer id of one of the customer account in my main account.
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("amount", 1000);
chargeParams.put("currency", "usd");
chargeParams.put("source", ??);
chargeParams.put("destination", DestinationAccountID);
chargeParams.put("application_fee", 100);
Charge.create(chargeParams);
Please let me know how I can implement this as this is giving error all the time. I Want to use customer id only and not the Token.

Related

Create token with card after payment transaction

Hello I am new to flutter and Stripe and I have this issue about creating cards. To start, the user must have a stored CreditCard so I used StripePayment.createTokenWithCard and send the output tokenID to the server-side API to create the Credit Card, and it was successfully done. Then next is another feature where the user has to pay via Stripe. I have to use StripePayment.setStripeAccount(stripe_connect_account_id) so that processing the paymentIntents and all to be successful, it was also successful. Here comes the issue, after a successful transaction whenever the user wants to create new card and go back to the screen where I used StripePayment.createTokenWithCard and send the output to the server-side API, the API would give me an http status 400-{"error":"No such token: 'tok_1INxXpBd3AiaZE5efApj6I2D'"}, but if I restart the app manually it will be successful.
What will I do with this? Is there a way for me not to restart the app as it is not user friendly. How to unset Stripe Account and get back to normal before transaction begins?

How to Link Multiple Auth Providers to an Firebase Account?

I am unable to to sucessfully to do , I followed the following steps as instructed on Firebase Docs:
Signed in use using existing auth provider(my case:facebook).
Complete the sign-in flow for the new authentication provider up to, but not including, calling one of the Auth.signInWith methods.(my case: i want to link email & password and Google OAUth). So this is the step i'm unclear about, I created a new provider using var provider = new firebase.auth.GoogleAuthProvider(); and I did not do Firebase.auth().signInWithPopup(provider) .
Then to get authcredential for google I run var credential = firebase.auth.GoogleAuthProvider.credential(
googleUser.getAuthResponse().id_token); (I get an undefined googleUser error) this error seems appropriate since I have not signed in using Google Oauth but thats what the 2nd steps states(not to signin)
And then this command to link with the current user who is on a Facebook Provider auth.currentUser.link(credential)
My understanding is that currentUser needs to be linked to my existing Provider(Facebook). It seems that credential variable for google is never computed. Anyone with a functional code example would really help.
If you want to manually link a google and email/pass account to existing facebook only firebase user, you can do the following:
First, the user should be signed in to Facebook.
Link the google user:
var provider = new firebase.auth.GoogleAuthProvider();
auth.currentUser.linkWithPopup(provider);
Then link the email/pass account:
auth.currentUser.linkWithCredential(firebase.auth.EmailAuthProvider.credential(auth.currentUser.email, 'password'))
All these accounts to be linked must be new and not already linked.
#bojeil I have read your question and I found the way to log in both Google and Facebook logins having the same email account. First, in the Firebase, you need to allow
"Multiple accounts per email address"
Allow multiple accounts per email address
Now you can log in with both Facebook having "xyz#gmail.com" & Google having the same email name as "xyz#gmail.com".But you will encounter the email as "null" for the second login having the same email. You can get over the null problem by using the below snippet.
Just use this snippet in on success task from the firebase:
Map profile = task.getResult().getAdditionalUserInfo().getProfile();
Object email = profile.get("email"); /// Obtaining the email from the use though we use same email form facebook and Google log in accounts.
By this way, you can log in into both Facebook and Google logins using the same email.
I hope you got your doubt cleared with this info. Can you please get back to me if this suits your question?.
Thank you.

Access Customer Information in XTRF

I am using createCustomer API to create a customer in XTRF and we are able to create a Customer using "customer Name". Here the customer id and password auto generated by XTRF.
We are using signup functionality in our application, which will create a customer in xtrf. I have to send the login details to the customer email address. please provide us any information on this.
Is there any way to get the customer user name and password, when it is created?
Obtaining customer user name and password is not available in XTRF WebService API.
In the future we plan adding a method for setting customer password.

Insertion/Deletion of account at an institution - AggCat API

1: If some account is actually deleted at an institution but is not deleted in AggCat service. What happens when Intuit pulls data from institutions to update accounts' info? The deleted account is not updated?
2: If some account is added at an institution, how can we discover the newly added account? It seems the only feasible way is to remove all accounts of some client at that institution and have the client register accounts again. Is it correct?
Yes, The deleted account doesn't get updated. If the account doesn't exist in FI, then that account should be categorized as 'Other Account'.
You can call discoverAndAddAccounts for that FI, and call UpdateInstitution login with refresh flag set to true. This will add refreshed data to the user's profile.
Ref - https://developer.intuit.com/docs/0020_customeraccountdata/customer_account_data_api/0020_api_documentation/0020_discoverandaddaccounts

Missing shipping address and note to seller in the create payment response

I am using REST API to create a payment (in sandbox environment) with payment_method="paypal". For some reason I don't get shipping address in the payer_info object in the response. I am also not sure how to obtain "notes to seller" via REST API. Any pointers would be greatly appreciated.
Shipping address data is not currently returned for PayPal transactions in the REST API's we offer, unless a shipping address was initially submitted along with the request.
Our new REST API's are evolving as we speak however - I'm seeing all your requests for it though, so I'm definitely passing that information on.
In the interim you could perhaps consider making another call to our classic GetExpressCheckoutDetails API. This would only need the Express Checkout token (EC-xxxxx), classic API username, API password and API signature and return the shipping address data (amongst other things) to you in the response (docs).
Shipping address is now supported to the Paypal REST Api. Set the ShippingAddress object and then add it to the ItemList object
$shippingAddress = new ShippingAddress();
$shippingAddress->setLine1($_POST['shipstreet'])
->setCity($_POST['shipcity'])
->setState($_POST['shipstate'])
->setPostalCode($_POST['shipzip'])
->setCountryCode($_POST['shipcountry'])
->setRecipientName($_POST['shipname']);
$itemList = new ItemList();
$itemList->setItems($itemsarr); //my array of items
$itemList->setShippingAddress($shippingAddress);
You might want to sanitize your POST vars before you send them. Some other interesting notes, you can set the payer_info first name and last name as well as the email address.
$payerinfo = new PayerInfo();
$payerinfo->setEmail($_POST['email'])
->setFirstName($_POST['firstName'])
->setLastName($_POST['lastName']);
$payer = new Payer();
$payer->setPaymentMethod("credit_card")
->setPayerInfo($payerinfo)
->setFundingInstruments(array($fi));