cancel
Showing results for 
Search instead for 
Did you mean: 

Create a Customer Profile from a Transaction with customerProfileId

Hello there, 

 

I am having trouble updating the payment profile for exsisting users using 'create_customer_profile_from_transaction' API method. I am using ruby. Based on the documentation on authorize.net it can be accomplished by passing 'customerProfileId'. On the documentation page, it is said it needs to be a numeric string the same as transaction id. If I keep it as a numeric string:

 

```

#<AuthorizeNet::API::CreateCustomerProfileFromTransactionRequest:0x00007f1b3c495620 @merchantAuthentication=nil, @refId=nil, @transId="40046569632", @customer=nil, @customerProfileId="1511207096", @defaultPaymentProfile=nil, @defaultShippingAddress=nil, @profileType=nil>

 

```

it throws the error:

 

```

------------------------

#<NoMethodError: undefined method `to_xml' for "1511207096":String>

------------------------

```

 

Then I look into the ruby documentation for this method and found out that it needs to be of type `NumericStringsType`. I have updated my call using this type:

```

#<AuthorizeNet::API::CreateCustomerProfileFromTransactionRequest:0x00007f1b3e799bd0 @merchantAuthentication=nil, @refId=nil, @transId="40046568628", @customer=nil, @customerProfileId=#<AuthorizeNet::API::NumericStringsType:0x00007f1b3e799b80 @numericString=["1511207096"]>, @defaultPaymentProfile=nil, @defaultShippingAddress=nil, @profileType=nil>

```

 

The method got executed but I got another error:

 

```

The element 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:customerProfileId' cannot contain child element 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:numericString' because the parent element's content model is text only.

``` 

 

Is there anything that I am missing?

 

Thank you in advance

 

Best,

Dmitry

 

0 REPLIES 0