AuthorizeNet / sample-code-php

This repository contains working code samples which demonstrate php integration with the Authorize.Net API
MIT License
177 stars 197 forks source link

This code is confusing and probably doesnt work right #133

Closed RickKukiela closed 5 years ago

RickKukiela commented 5 years ago

https://github.com/AuthorizeNet/sample-code-php/blob/119c63fa5ab41cd5e5679e17e21df04bde112d74/CustomerProfiles/update-customer-payment-profile.php#L25

Why does this code do all this work to set up this $controller only to have it over written 20 or so lines later without having done anything with it. Its like that first block is just there to be confusing to someone trying to learn this.

Why would you reference using the "paymentProfile" details in the update request, for example, when only updating the billto address, but then do not show how you are getting the payment profile in the code. In this sample code you are creating a fresh payment card object with fresh details. In my scenario I do not have that information. I just want to update the billing address on the existing profile. Your example does nothing to show how to get the existing profile and use it in the paymentprofileupdate request.

gerardmclean commented 5 years ago

Concur... the entire sample code library is incomplete and confusing... this is terrible for a company like Authorize!

gnongsie commented 5 years ago

Hi all,

Thanks for bringing this to our attention.

We will investigate and have a proper working code for you soon. Please bear with us on this.

Also, as per the structure of the UpdateCustomerPaymentProfile API, payment information is required when creating/updating a subscription or payment profile. But if a masked value is submitted, the original value will not be updated.

We will soon update the code to show a proper use of the API in this regard.

Thank you for your patience.

gnongsie commented 5 years ago

Hi all,

We have addressed this issue. The sample code for UpdateCustomerPaymentProfile API has been updated to properly reflect the most common use case for this API.

Kindly review it and comment back if you have any questions.

ashtru commented 5 years ago

@RickKukiela, are you satisfied with the fix? Please respond if you have further queries.

RickKukiela commented 5 years ago

Well i havent really went through it but looks good at a glance. I was able to figure it out for my implementation a while back so I ceased needing this example code at that time. I hope you have it right for the next guy :)