AuthorizeNet / sample-code-php

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

How Do I Add Metadata to Simple Checkout? #171

Open PostAlmostAnything opened 3 years ago

PostAlmostAnything commented 3 years ago

I have never used Authorize.net before and just got my sandbox account. I am migrating from Stripe. I would like to use simple checkout just like I used Stripe checkout, but I don't know where to find examples of how to dynamically generate products with metadata for use with Simple Checkout.

When using Stripe I could include metadata with requests so that they would have unique titles, descriptions, and other things that my webhooks needed. I have looked at the Simple Checkout page on the Authorize.net site but don't see how to do that. All I see is how to create buttons for static products.

jmd8045 commented 3 years ago

Check out SIM server integration method

Unfortunately they are talking about not supporting in the future

On Thu, May 20, 2021 at 18:39 PostAlmostAnything @.***> wrote:

I have never used Authorize.net before and just got my sandbox account. I am migrating from Stripe. I would like to use simple checkout just like I used Stripe checkout, but I don't know where to find examples of how to dynamically generate products with metadata for use with Simple Checkout.

When using Stripe I could include metadata with requests so that they would have unique titles, descriptions, and other things that my webhooks needed. I have looked at the Simple Checkout page on the Authorize.net site but don't see how to do that. All I see is how to create buttons for static products.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AuthorizeNet/sample-code-php/issues/171, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDKA6B7DDXOBXV4BUYZRZTTOWMTTANCNFSM45ICMUWQ .

-- James M Doherty President Revive Consulting LLC

PostAlmostAnything commented 3 years ago

Thanks, so are you saying they don't support what I am looking for now or they do and won't in the future?

jmd8045 commented 3 years ago

It’s been awhile since I’ve looked at it when I get in the office in the morning I will send you some info which is up to date.

Jim

On Thu, May 20, 2021 at 18:47 PostAlmostAnything @.***> wrote:

Thanks, so are you saying they don't support what I am looking for now or they do and won't in the future?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/AuthorizeNet/sample-code-php/issues/171#issuecomment-845554287, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDKA6BIA4EU4VWQEZ4VIKDTOWNSTANCNFSM45ICMUWQ .

-- James M Doherty President Revive Consulting LLC

PostAlmostAnything commented 3 years ago

Thanks

PostAlmostAnything commented 3 years ago

The first thing that comes up for SIM server on Google is a document calling it depreciated https://www.authorize.net/content/dam/anet-redesign/documents/SIM_guide.pdf

jmd8045 commented 3 years ago

https://developer.authorize.net/api/reference/index.html#accept-suite-get-an-accept-payment-page

This link will take you to the most current api with examples.

Jim

James M Doherty President REVIVE CONSULTING LLC EMAIL: @.** PHONE: 512-650-2997 Author: Bought With A Price http://bookstore.westbowpress.com/Products/SKU-000731960/Bought-with-a-Price.aspx "Things My Dad Taught Me" Patents (40):* Patents By Inventor: James M Doherty (40) https://www.google.com/search?tbo=p&tbm=pts&hl=en&q=ininventor:%22James+M.+Doherty%22#q=ininventor:%22James+M.+Doherty%22&hl=en&tbm=pts&start=0%22

On Thu, May 20, 2021 at 10:41 PM PostAlmostAnything < @.***> wrote:

The first thing that comes up for SIM server on Google is a document calling it depreciated https://www.authorize.net/content/dam/anet-redesign/documents/SIM_guide.pdf

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AuthorizeNet/sample-code-php/issues/171#issuecomment-845629832, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDKA6DLWFIC455WRBN6OZ3TOXI6VANCNFSM45ICMUWQ .

PostAlmostAnything commented 3 years ago

I am thinking of using Accept Hosted, but the instructions seem confusing. I created the .php file described in step 1, but step 2 describes loading something in an iframe, but the sample iframe code does not have a src attribute. How is it possible to load anything in an iframe without a src attribute?

https://github.com/AuthorizeNet/accept-sample-app/blob/master/README-AcceptHosted.md

jmd8045 commented 3 years ago

https://developer.authorize.net/api/upgrade_guide.html

Hope this helps a bit

James M Doherty President REVIVE CONSULTING LLC EMAIL: @.** PHONE: 512-650-2997 Author: Bought With A Price http://bookstore.westbowpress.com/Products/SKU-000731960/Bought-with-a-Price.aspx "Things My Dad Taught Me" Patents (40):* Patents By Inventor: James M Doherty (40) https://www.google.com/search?tbo=p&tbm=pts&hl=en&q=ininventor:%22James+M.+Doherty%22#q=ininventor:%22James+M.+Doherty%22&hl=en&tbm=pts&start=0%22

On Sat, May 22, 2021 at 6:42 PM PostAlmostAnything @.***> wrote:

I am thinking of using Accept Hosted, but the instructions seem confusing. I created the .php file described in step 1, but step 2 describes loading something in an iframe, but the sample iframe code does not have a src attribute. How is it possible to load anything in an iframe without a src attribute?

https://github.com/AuthorizeNet/accept-sample-app/blob/master/README-AcceptHosted.md

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AuthorizeNet/sample-code-php/issues/171#issuecomment-846476964, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDKA6DKJ5ZYOVTK4NDXXHDTPA6O7ANCNFSM45ICMUWQ .

PostAlmostAnything commented 3 years ago

The sample code for the Accept Suite references a file named constants/SampleCodeConstants.php but does not contain any links to it. Where can I find that file?

PostAlmostAnything commented 3 years ago

Alright, I found that but it just led to more questions. I coped the code from https://developer.authorize.net/api/reference/index.html#accept-suite-get-an-accept-payment-page but instead of getting me a payment page all it got me was a giant string of characters. Then I looked at it again and all it does is get you a token which can be used to request the Authorize.net Accept hosted payment page", but how do I request the Accept hosted payment page? The tutorial stops at the token and never bothers to explain how to use it.

jmd8045 commented 3 years ago

https://github.com/AuthorizeNet/sample-code-php/tree/9ce85f72801b96adcf882a63ed3bfcdb1d14c5f0

James M Doherty President REVIVE CONSULTING LLC EMAIL: @.** PHONE: 512-650-2997 Author: Bought With A Price http://bookstore.westbowpress.com/Products/SKU-000731960/Bought-with-a-Price.aspx "Things My Dad Taught Me" Patents (40):* Patents By Inventor: James M Doherty (40) https://www.google.com/search?tbo=p&tbm=pts&hl=en&q=ininventor:%22James+M.+Doherty%22#q=ininventor:%22James+M.+Doherty%22&hl=en&tbm=pts&start=0%22

On Wed, May 26, 2021 at 12:43 AM PostAlmostAnything < @.***> wrote:

Alright, I found that but it just led to more questions. I coped the code from https://developer.authorize.net/api/reference/index.html#accept-suite-get-an-accept-payment-page but instead of getting me a payment page all it got me was a giant string of characters. Then I looked at it again and all it does is get you a token which can be used to request the Authorize.net Accept hosted payment page", but how do I request the Accept hosted payment page? The tutorial stops at the token and never bothers to explain how to use it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AuthorizeNet/sample-code-php/issues/171#issuecomment-848475948, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDKA6G644F5GMF6XQFLJWDTPSDBFANCNFSM45ICMUWQ .

PostAlmostAnything commented 3 years ago

I have the basic redirect to the Authorize.net hosted payment form working fine based on the example at https://developer.authorize.net/api/reference/features/accept_hosted.html#Integrating_the_Form_using_a_Redirect but I need to include more information about the order than what appears available. Information such as a product ID, description, inventory number, etc. so that when I register for a webhook it can send back information as to exactly what item was purchased. Right now I only see options for including basic stuff like merchant name.

How do I add meta data?

PostAlmostAnything commented 3 years ago

Is it possible to retrieve the transaction ID after the token is created and before the user is sent to the Authorize.net site?

jmd8045 commented 3 years ago

add a input element inside the form with type hidden and set the value to your product id etc. James M Doherty President REVIVE CONSULTING LLC EMAIL: @.** PHONE: 512-650-2997 Author: Bought With A Price http://bookstore.westbowpress.com/Products/SKU-000731960/Bought-with-a-Price.aspx "Things My Dad Taught Me" Patents (40):* Patents By Inventor: James M Doherty (40) https://www.google.com/search?tbo=p&tbm=pts&hl=en&q=ininventor:%22James+M.+Doherty%22#q=ininventor:%22James+M.+Doherty%22&hl=en&tbm=pts&start=0%22

On Fri, May 28, 2021 at 12:54 AM PostAlmostAnything < @.***> wrote:

Is it possible to retrieve the transaction ID after the token is created and before the user is sent to the Authorize.net site?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AuthorizeNet/sample-code-php/issues/171#issuecomment-850155554, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDKA6HLRQ2CCJ3MQ77ZT23TP4VYLANCNFSM45ICMUWQ .

PostAlmostAnything commented 3 years ago

Now, how do I process webhooks with PHP? The sample app is node