cancel
Showing results for 
Search instead for 
Did you mean: 

CIM - OpenEditPaymentPopup gives me "Missing Payment Profile ID"

I miswrote this question earlier (pasted in the Edit Shipping code instead of Edit Payment), so here it is again with the problem I am having shown more clearly in case someone can help me figure it out:

 

Having trouble integrating the Edit Payment popup from the CIM module with my test account.

 

I am properly getting a hosted token with a saved customer ID, and I know it works because when I attach openManagePopup() to the button on my page, the info for the customer in question shows up fine in the pop up window.  The payment and shipping info from that customer is all shown in the pop up.  So, the token is good and the popup is retreiving the saved CIM data for that customer.

 

However, when I replace the manage popup with openEditPaymentPopup() to edit a particular payment profile for that customer, I get the message "Missing Payment Profile ID" in the popup window.  I even hard coded a legit payment ID in the call, as shown here:

 

<button onclick="AuthorizeNetPopup.openEditPaymentPopup('5032582')">Edit Payment Info</button>

 

The ID shown is an actual payment profile ID from the customer referenced (not the customer ID, but the customer's payment profile ID), the same customer I used to get the hosted token, which was successful.  I hard coded a legitimate payment profile ID to be sure real data was getting passed to the popup, but I always get the Missing ID message.

 

Any ideas on what I am doing wrong?  It makes no sense to me that calling Addpaymentpopup or openManagePopup works fine for the customer in question but the Edit does not work.  Is the documentation accurate?  Do I need to pass the customer ID as well as the payment profile ID?  I am following the sample code as well as the docs, so there does not seem to be any reason why it would not work.

 

The sample code from the CIM documentation is shown here:

 

<button onclick="AuthorizeNetPopup.openEditPaymentPopup('123456')">Edit
Payment Method</button>
Replace ‘123456’ with the payment profile ID.

 

Sure looks like exactly what I am doing.

Talentville
Contributor
1 ACCEPTED SOLUTION

Accepted Solutions

In the hostedProfilePaymentsShipping.zip html file.

<form method="post" action="" id="formAuthorizeNetPopup" name="formAuthorizeNetPopup" target="iframeAuthorizeNet" style="display:none;">
  <input type="hidden" name="Token" value="LongTokenText" />
  <input type="hidden" name="PaymentProfileId" value="" />
  <input type="hidden" name="ShippingAddressId" value="" />
</form>

 The hidden PaymentProfileID input is use with the javascript to pass the ID with the form submit.

View solution in original post

4 REPLIES 4

Did you removed the

<input type="hidden" name="PaymentProfileId" value="" />

 from the form post that have the hidden token?

 

RaynorC1emen7
Expert

The way I have the Edit Payment Implemented is the following:

 

The button...

 

  <p class="editpayment"><a onclick="AuthorizeNetPopup.openEditPaymentPopup('5630496')"> Edit Payment Information</a></p>

 

The Form:

 

<form method="post" action="https://test.authorize.net/profile/manage" id="formAuthorizeNetPopup" name="formAuthorizeNetPopup" target="iframeAuthorizeNet" style="display:none;">
<input type="hidden" name="Token" value="<?php echo $token; ?>" />
</form>

 

The only hidden field that is shown in the sample code that I took this from is the hidden token, there is no hidden profile ID.  The payment profile ID is passed in via the onclick action, so I do not know where there would be a hidden field for the paymentprifileID.  

 

Obviously I want the form to be flexible so that I can call the edit, update or manage for the customer's information depending on what I need to do.

 

Do I need a hidden field for each of the values I am passing in?  Is there anywhere in the CIM documentation that spells out how the form has to change for each of the types of calls?  I thought the forst only needed the token and having the vlaue in the button onClick action passed in the actual payment ID to the function.

In the hostedProfilePaymentsShipping.zip html file.

<form method="post" action="" id="formAuthorizeNetPopup" name="formAuthorizeNetPopup" target="iframeAuthorizeNet" style="display:none;">
  <input type="hidden" name="Token" value="LongTokenText" />
  <input type="hidden" name="PaymentProfileId" value="" />
  <input type="hidden" name="ShippingAddressId" value="" />
</form>

 The hidden PaymentProfileID input is use with the javascript to pass the ID with the form submit.

Well, that did the trick.  The code that I took from whatever sample code I found only had the token field, I never saw the other hidden fields.  Obviously the value I pass in is put into the hidden field when passed, so that solved the problem.  Obviously the other methods worked because there was no extra data being passed in.

 

Thanks.