Deciding on customer id and saving payment method after transaction in Braintree -
i have following workflow on our website braintree payment gateway: customer or isn't logged in pays credit card (using braintree hosted fields). if payment successful , customer not logged in, offer him login or register in order save payment method.
unfortunately, means in transaction.sale cannot use existing customer id, since customer not yet logged in our system. , after transaction complete, cannot reuse payment nonce create payment method , assign our customer.
one possibility considering vault payment method during transaction (with new braintree customer id) , assign customer id our user's account if logs in. however, can result in 1 user having multiple braintree customer ids complicate later payments saved cards. (plus have vault lot of fake customers , payment methods never used again since majority of our customers never create user accounts.) there better way?
full disclosure: work @ braintree. if have further questions, feel free contact support.
you correct. achieve flow need create new customer , payment method each time. news transaction.sale not require customer id, payment method token, can associate payment method token app's customer id , won't need maintain relation customers in braintree control panel.
for clean up, following:
1) if user declines option save payment method, delete customer , payment method token immediately.
2) if user closes application without making decision 1 way or other, have periodic process clean unclaimed customers , payment method tokens.
Comments
Post a Comment