# Make Payment Gateway a LOGIC choice

For example, if we want to make a funnel with forms, we could let them buy now, or pay later, if they choose pay later, we could set the logic to have NO Payment Gateway, but if they choose Buy NOW, then we would have the payment gateway.

So a simple logic, like we do with form fields.

That would be very powerful.

We can currently do this with a calculation and a custom pricing rule.

Our calculation might look something like

``````total = some_calculated_total;
payLater = {{ key }} == "Pay later";

if(payLater, total, 0);
``````

Then, in a custom pricing rule, we would set up a rule that looks like

``````When <myCalculation> <is answered> then <- answer>
``````

What this all does is check if the user has selected the literal option “Pay later” in a given question. If they have, we use the total we calculate in the calculation. There are multiple ways you might need to do that, but if you’re just using a product question, you could just use a simple `{{ key.total }}`. If they haven’t answered the question about how they’d like to pay or they have and they didn’t select “Pay later” then we return 0.

Then, we use a custom pricing rule that subtracts what the calculation returned. The calculation is technically always “answered” so the rule always fires. The logic for the amount we wanted to subtract was handled in our calculation; the custom pricing rule just subtracts that returned value from the form’s price.

More plainly, this means that if a user elects to pay later, the form will no longer have a price and they will not be required to pay now. If they don’t elect to pay later, the form has a price and the checkout of the connected payment account will engage.

One thing to note is that the form’s total will be 0 in submission data if you let them pay later. But, since our calculation provides the exact total used to negate the automatic pricing on the form, you can check the calculation’s value instead to determine what the user needs to pay later.

Let me know if any of this is still unclear!
{"ft_lang_label":"__label__en","ft_lang_prob":0.93770987,"math_prob":0.9557716,"size":1684,"snap":"2021-04-2021-17","text_gpt3_token_len":373,"char_repetition_ratio":0.14345238,"word_repetition_ratio":0.0066225166,"special_character_ratio":0.22446556,"punctuation_ratio":0.09171598,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98770416,"pos_list":[0,1,2],"im_url_duplicate_count":[null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-04-19T19:43:14Z\",\"WARC-Record-ID\":\"<urn:uuid:51c33653-1f4c-4fb4-9d09-a467f980501d>\",\"Content-Length\":\"15033\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:c3d151a8-41b2-41c1-bc69-0a41de391efc>\",\"WARC-Concurrent-To\":\"<urn:uuid:48a31811-7c6e-4cf6-a3ca-45decc3c3bc5>\",\"WARC-IP-Address\":\"204.48.18.232\",\"WARC-Target-URI\":\"https://community.paperform.co/t/make-payment-gateway-a-logic-choice/688\",\"WARC-Payload-Digest\":\"sha1:SSPF7UHFJN43ON4DO2T2DF7MO7Y7QBVE\",\"WARC-Block-Digest\":\"sha1:4L44X6P7WKR3WF5ZO3RV66UNE3RO5KVI\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-17/CC-MAIN-2021-17_segments_1618038916163.70_warc_CC-MAIN-20210419173508-20210419203508-00231.warc.gz\"}"}