Closed lucianboboc closed 10 years ago
In the sample code i found this:
// You need a customer id in order to save a card to the Braintree vault. // Here, for the sake of example, we set customer_id to device id. // In practice, this is probably whatever user_id your app has assigned to this user. NSString *customerId = [[UIDevice currentDevice] identifierForVendor].UUIDString; [paymentInfo setValue:customerId forKey:@"customer_id"];
I've understood how to associate a customer_id with a specific credit card, but how can i associate that customer_id when the BTPaymentViewController is presented again? Where is set a specific user before the BTPaymentViewController is presented?
Hi @lucianboboc,
VTClient only takes a customer ID as information for saving cards, not for displaying them. VT in its current form only displays cards shared on the device, so if you want something to display cards in your Braintree vault for a specific customer you won't be able to use Venmo Touch.
If you have any more questions, please feel free to reach out to our support team at support@braintreepayments.com or 877.434.2894.
David and Katelyn Braintree Developers
I have an iOS app with multiple users, if user A saves a credit card after a payment is made then he logout, if user B logs in the credit card user A entered earlier is available to user B and this is not accepted. How can i keep the cards separated for each user? I have created the VTClient in app delegate using merchant id and client encryption key (and nil email). Then i presented the BTPaymentViewController and used the 2 delegate method: didSubmitCardWithInfo and didAuthorizeCardWithPaymentMethodCode to received new and already used credit card. In both methods the dictionary is sent to the server and a customerId created using [[UIDevice currentDevice] identifierForVendor].UUIDString is added to the card dictionary (added using customer_id key). Are the credit cards made available based on this UUID customer_id? should i compose a static string + unique usernames here instead UUID?
Please help.