cancel
Showing results for 
Search instead for 
Did you mean: 

Accept Hosted - Display Line Items in Payment Form?

I'm migrating from the SIM Method to Accept Hosted.

 

With the hosted form via the SIM Method, it displayed the line items on the payment form.  While I'm able to produce a payment form using Accept Hosted, I haven't found a way to have the Line Items displayed on it.  I'm sending them in via XML, so I know it has access to that information.  However, none of the sample Payment Forms I have come across seem to show line items included. 

 

Is this simply not available like it used to be with the SIM Method?

10 REPLIES 10

You're not the only one. I can't get Order Line Items to work for Accept Hosted as well. Using their own Java SDK too.

lightwave365
Regular Contributor

Hello @lightwave365

 

That's not good.  Could you share your code for 'getHostedPaymentPageRequest'  with line items for our team to review?

 

Richard

I obviously cannot post our company's code, only your API code that I am using. This was me just testing it:

 

            ApiOperationBase.setEnvironment(Environment.SANDBOX);

            MerchantAuthenticationType merchantAuthenticationType  = new MerchantAuthenticationType() ;
            merchantAuthenticationType.setName( authorizeNetLoginID );
            merchantAuthenticationType.setTransactionKey( authorizeNetTransactionKey );
            ApiOperationBase.setMerchantAuthentication(merchantAuthenticationType);

            OrderType orderRequest = new OrderType();
            orderRequest.setInvoiceNumber( orderID );

            // Create the payment transaction request
            TransactionRequestType txnRequest = new TransactionRequestType();

            ArrayOfLineItem lineItemsArray = new ArrayOfLineItem();
            List<LineItemType> lineItems = lineItemsArray.getLineItem();
            LineItemType line1 = new LineItemType();
            line1.setName("Name With Spaces");
            line1.setDescription("Description With Spaces");
            line1.setItemId("37894");
            line1.setQuantity( BigDecimal.valueOf( 1 ) );
            line1.setTaxable( true );
            line1.setUnitPrice( BigDecimal.valueOf( 36456.00) );
            lineItems.add( line1 );

//            LineItemType line2 = new LineItemType();
//            line2.setName("Name");
//            line2.setDescription("Description");
//            line2.setItemId("ItemID");
//            line2.setQuantity( BigDecimal.valueOf( 5 ) );
//            line2.setTaxable( true );
//            line2.setUnitPrice( BigDecimal.valueOf( 900.00 ) );
//            lineItems.add( line2 );
//
//            LineItemType line3 = new LineItemType();
//            line3.setName("Name");
//            line3.setDescription("Description");
//            line3.setItemId("ItemID");
//            line3.setQuantity( BigDecimal.valueOf( 5 ) );
//            line3.setTaxable( true );
//            line3.setUnitPrice( BigDecimal.valueOf( 900.00 ) );
//            lineItems.add( line3 );
//
//            LineItemType line4 = new LineItemType();
//            line4.setName("Name");
//            line4.setDescription("Description");
//            line4.setItemId("ItemID");
//            line4.setQuantity( BigDecimal.valueOf( 5 ) );
//            line4.setTaxable( true );
//            line4.setUnitPrice( BigDecimal.valueOf( 900.00 ) );
//            lineItems.add( line4 );

            txnRequest.setOrder( orderRequest );
            txnRequest.setLineItems( lineItemsArray );

I am using the redirect of Accept Hosted. When I confirm the payment and I'm redirected to your receipt page there are no line items. I assume they would be in the collapsable section?

 

There's also no line items in the Payment Form too. But I'm not worried about that.

The line items won’t display on the payment form or the receipt page. They are still getting passed most likely, else you would get an error message instead of a token and form. Given that they are passed, I am 99.9% sure they are sent to the customer in an invoice if you set email to required on the payment form.
Here’s how to test:
-to test if they’re getting passed, use the sandbox to make an order and then do a gettransactiondetails call to see if they are in the response. Or even easier, just look at the invoice in your merchant interface. They show up there.

-to test if they are sent to the customer, I think you have to use a production account, so would be trickier. One way would be to make a payment form that charges for $0.01 no matter the items and run your own card. Another would be to do an auth only for your own card and then cancel. Put in your own email when you place the order and see if they come back to you. You would have to have the email set up in your merchant interface in addition to having it as a required field on the form.

As I said, I am 99.9% sure they are sent to the customer via email. The reason is I was recently copied on an email that was forwarded to my client. The customer was asking about the status of the order, and forwarded us the email from authorize. The order details in that email looked identical to the invoice in the merchant interface. Unfortunately, this was before I started passing the line items in the API call, so I have no way to 100% verify that they are in there with everything else.

Alright, you are correct. I do see them in the transaction search in the merchant account.

 

That doesn't exactly help me though. I wanted them on the receipt page so that I could have the ability to add our custom text to their receipt page because AuthNet doesn't offer the ability to customize it - except for a silly color of a button.

 

I need to communicate to the customer that they must click the return button or their order might not be submitted on our end. Since AuthNet removed the synchronous POST of data back to our end.

 

So many things changed that just make my life more difficult.

 

Thanks anyway. I do appreciate the response. Unlike poor OP from a year ago.

Glad to help. This is my new time killer while waiting at restaurants, etc. For your needs, passing the order description will do what you want. It is up there right where the continue button is.

I do the same thing for my clients. For us the return only clears the cart. What we do is place the order at the exact same time the form is called. That way we don’t lose it. Then we catch a Webhook with the transaction success. The Webhook clears the cart (if not already cleared by continue button, I know that at some point someone’s not going to read and will X out) and then inserts the transaction number in our dB tied to the relevant order.

I’m new to this and thus far only have 2 clients. The first is up and running and has a unique business with no need for inventory control. My newest one will typically have items with an available quantity of one, with multiple stock of the same item being more the exception. This will add a wrinkle when I get to that part on his store but I’ll figure it out.

For the benefit of anyone reading- I have confirmed that the line items display in the email sent to the customer if email is set to required. You do not have to have a production account to test email receipt functionality. I just ran it on my sandbox. 

It does make me wonder what that 'Hide Details' section is for on the receipt page if it's not to collapse a possible 30 line items. Collapsing a single-line total just seems silly. Definitely feels like there is a bug here somewhere.