How to test module payment links

When using HubSpot Payment links in a custom module (using the built-in payment field type), is there a method of being able to test a payment??

Hi @NathanAtGrowth! Thanks for this question. I want to invite some subject matter experts to see if they have any suggestions.

Hey @Brenner, @Edouardbrunetot, @Anton do you have any thoughts on how we might test a built-in payment in a custom module?

Thanks!

Kennedy

Hi, @NathanAtGrowth ,

Do you mean, like, a practical test?

If yes, I like to use a sandbox account and try a “fake” payment with USD 0,10 or USD 0,01.

If you trying test in the backend, I’m not the right person, but, I know who are haha

And thank you @kennedyp for tagging me

No, not a backend test… a test of the frontend process. It seems there is nothing available for this, which is unfortunate and a definite oversight.

Also, when “testing” and having to use a real payment on the frontend, you can’t enter anything less than $0.50. That is understandable… but it wouldn’t be an issue if there was a test option in place.

Hmm, I got it.

@NickMendes or @danmoyle can help you better than me

Hey @NathanAtGrowth (and thanks for the tag @Brenner :blush:).

I think the only way to test a Payment link is:

  1. Navigate to Commerce > Payment Links in your HubSpot account
  2. Hover over the link you want to test and click Actions, then select Open link in test mode
  3. The link will open in test mode, indicated by a banner at the top of the checkout page
  4. Use the provided sample credit card or bank debit information to complete a test purchase

As for testing it in a custom module, I’m not sure how that afects the link itself, so I’m not understanding that layer and why you’d need to test in that module. If it’s a link, it operates the same whether it’s in a custom module, in an email, or behind a QR code - at least to my underatanding.

But that’s how I’d test the link before putting it into a module or location.

Hope that helps!

Thanks Dan! I know how you can generate a test link. That allows you to test the payment itself, but how many people use the payment link all on it’s own like that?? Here’s the problem…

When you have a custom module and you add a Payment field to it, it allows you to insert a payment link into the module. Unfortunately, that field type loads the payment link into your module via an iframe. Of course, iframes suck and it’s near impossible to manipulate it much.
Within the module container, this iframe loads with a fixed height of like 500px so in my instance, it needed more height so I had to add code to force more of a height to get rid of the internal vertical scrolling. That works BUT when you submit payment and it then loads your confirmation message, all of that height remains and it’s not needed.
While trying to fix the display after a payment, I have to make a real payment each time to test what happens after the payment since there is no real test mode solution for the payment method as a whole.
I ended up having to redirect to a new confirmation page and add a script that forced it to load that new page in the window and break out of the iframe.
There shouldn’t be this many hurdles to simply implement a payment field in a module using a built-in field type.