# Verifying Voucher

**URL:** <https://forum.sambapos.com/t/verifying-voucher/11232>\
**Category:** V5 Question\
**Created:** [June 12, 2016, 9:54am UTC](https://forum.sambapos.com/t/verifying-voucher/11232 "2016-06-12T09:54:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johan\_yo](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@Johan\_yo](https://forum.sambapos.com/u/Johan_yo)\
**Post date:** [June 12, 2016, 9:54am UTC](https://forum.sambapos.com/t/verifying-voucher/11232/1 "2016-06-12T09:54:39Z")

</div>

Any Idea to make validation voucher,  
i make voucher with special numbers.  
Ex. i make vocher BG1110111, BG1110112, etc  
amout of voucher is 50.000 and 100.000  
How record to sambapos this voucher number?  
How to validation this voucher when customer pay with voucher?  
How to limit payment with voucher just 50% from total payment, scenario customer can pay using more than 1 voucher.

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [June 12, 2016, 10:11am UTC](https://forum.sambapos.com/t/verifying-voucher/11232/2 "2016-06-12T10:11:02Z")

</div>

Typically voucher would be an entity type with an account associated with it.  
There is a couple of gift voucher tutorials, please search the forum, they are easy to find.

---

<div class="post-metadata">

**Author:** ![Johan\_yo](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@Johan\_yo](https://forum.sambapos.com/u/Johan_yo)\
**Post date:** [June 12, 2016, 10:49am UTC](https://forum.sambapos.com/t/verifying-voucher/11232/3 "2016-06-12T10:49:21Z")

</div>

I had search it. But no voucher validation

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [June 12, 2016, 10:56am UTC](https://forum.sambapos.com/t/verifying-voucher/11232/4 "2016-06-12T10:56:43Z")

</div>

The validation would be on the payment type.  
If you use accounts for the voucher credit which is best way, you make the transaction types to top up and charge to voucher account.  
The charge to voucher is payment type based on the voucher entity being selected and charging to voucher account and the validation is set on the payment type for charging to voucher account.

---

<div class="post-metadata">

**Author:** ![Johan\_yo](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@Johan\_yo](https://forum.sambapos.com/u/Johan_yo)\
**Post date:** [June 12, 2016, 11:20am UTC](https://forum.sambapos.com/t/verifying-voucher/11232/5 "2016-06-12T11:20:33Z")

</div>

Sorry, i still not understand. Could you help me show me how to make it

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [June 12, 2016, 11:39am UTC](https://forum.sambapos.com/t/verifying-voucher/11232/6 "2016-06-12T11:39:09Z")

</div>

Not the whole thing, gift voucher itself is already documented.  
You might not find tutorial for gift voucher with payment processor conditions as is more specific but voucher itself is;  
Her for example

> [@Gift Certificate Sales & Redemption](https://forum.sambapos.com/t/gift-certificate-sales-redemption/1539):
>
> Gift Certificate Sales & Redemption This is a working implementation for Selling & Redeeming variable-value Gift Certificates (GCs) that are tracked under their own individual GC Account and 2 “GC Balance” Accounts called “GC Purchases” and “GC Redemptions”. GC Sale: Customer comes in to purchase a Gift Certificate (GC). Enter the value of the GC that the customer wants to purchase into the NUMBERPAD ($10, $20, etc). Select GC Product (open price). Settle the ticket - customer pays for the G…

Impliment your voucher system first then we can work out the value/amount validation.

---

<div class="post-metadata">

**Author:** ![morshed1](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@morshed1](https://forum.sambapos.com/u/morshed1)\
**Post date:** [June 12, 2016, 11:39am UTC](https://forum.sambapos.com/t/verifying-voucher/11232/7 "2016-06-12T11:39:38Z")

</div>

You can refer to below implementation:

> [@Gift Certificate Sales & Redemption](https://forum.sambapos.com/t/gift-certificate-sales-redemption/1539):
>
> Gift Certificate Sales & Redemption This is a working implementation for Selling & Redeeming variable-value Gift Certificates (GCs) that are tracked under their own individual GC Account and 2 “GC Balance” Accounts called “GC Purchases” and “GC Redemptions”. GC Sale: Customer comes in to purchase a Gift Certificate (GC). Enter the value of the GC that the customer wants to purchase into the NUMBERPAD ($10, $20, etc). Select GC Product (open price). Settle the ticket - customer pays for the G…

---

<div class="post-metadata">

**Author:** ![Johan\_yo](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@Johan\_yo](https://forum.sambapos.com/u/Johan_yo)\
**Post date:** [June 17, 2016, 2:47pm UTC](https://forum.sambapos.com/t/verifying-voucher/11232/8 "2016-06-17T14:47:21Z")

</div>

How to make limit payment with voucher just \<= 50 % from ticket total (total amount)?

i use execute script for voucher payment processors

```
 function UpdateDescription() {
    var paymenttype = Data.Get("paymentTypeName");

    if (paymenttype=='Credit Card') {
       var cctype = dlg.AskQuestion("Choose Credit Card type","BCA=BCA Card,BNI=BNI Card,MANDIRI=MANDIRI Card,MASTER=MASTER Card,VISA=VISA,CANCEL=CANCEL");
   if (cctype=="CANCEL") {
      Data.Set("canContinue",false);
      dlg.ShowMessage("Payment Cancelled");
      return 1;
   }
    var paymentinfo = cctype;
   } 

   if (paymenttype=='Debit Card') {
      var dctype = dlg.AskQuestion("Choose Debit Card type","BCA=BCA,BNI=BNI,MANDIRI=MANDIRI,CANCEL=CANCEL");
   if (dctype=="CANCEL") {
      Data.Set("canContinue",false);
      dlg.ShowMessage("Payment Cancelled");
      return 1;
   }
     var paymentinfo = dctype ;
   }

   if (paymenttype=='Voucher') {
     var tendered = Data.Get("tenderedAmount");
    if (tendered == 50000 || tendered == 100000) {      
    var vnum = dlg.EditValue("Voucher Number;.{8};;OCS","");
            }
    else {
    Data.Set("canContinue",false);
    dlg.ShowMessage("Payment Cancelled");
    return 1;
    }
    paymentinfo = vnum;
   }

   Data.Set("description", paymentinfo);
   dlg.ShowMessage("Payment Processed\r"+paymentinfo);

   return 0;
   }
```
