Mehdi
Mehdi

Reputation: 792

Braintree PAyment create customer and save payment method

I am trying to save the card information and create customer at same time. The client app creates a nonce and sends it to my server (nodejs) and I call:

gateway.customer.create({paymentMethodNonce: request.params.nonce})

The customer gets created and I get a customer ID, I save that in the db. But calling

gateway.customer.find(customer_id):`

returns:

Customer {
id: '697983269',
merchantId: 'yzkvrqy9qsctn69d',
firstName: null,
lastName: null,
company: null,
email: null,
phone: null,
fax: null,
website: null,
createdAt: '2017-09-25T00:37:29Z',
updatedAt: '2017-09-25T00:37:29Z',
customFields: '',
creditCards: [],
addresses: [],
paymentMethods: [] }

Which has empty payment method array. I am using the drop in UI that only asks for card number and exp date. This is also a sandbox account.

Upvotes: 1

Views: 775

Answers (1)

drs6222
drs6222

Reputation: 616

Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.

Hi Mehdi. I took a closer look at your Braintree Sandbox, and while you are in fact creating customer records in your Vault, it appears that there is no nonce value being passed into the customer creation API call, resulting in a customer record containing only a customer ID.

Would you mind logging, and relaying here, the value you get on your server for your request.params.nonce and ensure it contains a valid nonce string from your client?

Don't hesitate to reach out to support if you need further clarity.

Upvotes: 1

Related Questions