Zen Cart Logo
Forums / General Questions / Gift Certificate gets credited even vefore the payment is received

Gift Certificate gets credited even vefore the payment is received

Views: 1,051

Results 1 to 14 of 14
22 Jul 2015, 4:53 PM
#1
prabhatm avatar

prabhatm

New Zenner

Join Date:
Jun 2015
Location:
Delhi, India
Posts:
32
Plugin Contributions:
0

Gift Certificate gets credited even vefore the payment is received

Zen cart has an option for MONEY ORDER. The admin changes the status to PROCESSING after receiving the payment and then the Digital download is initiated.

But in case of GIFT CERTIFICATES, the moment the user checks out, the GIFT CERTIFICATE value is added to his account even if the payment status is PENDING ( Queue Process is False).

Actually, the RELEASE QUE button should not appear till the time the Payment status is PENDING.

Please check the bug.

22 Jul 2015, 5:03 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Gift Certificate gets credited even vefore the payment is received

What is your setting on the Modules ... Order Total ... for the Gift Certificate ot_gv on the setting:

Queue Purchases
true

If a Gift Certificate is Queued, then it has to be approved before it is released to the Customer ...

22 Jul 2015, 5:24 PM
#3
prabhatm avatar

prabhatm

New Zenner

Join Date:
Jun 2015
Location:
Delhi, India
Posts:
32
Plugin Contributions:
0

Re: Gift Certificate gets credited even vefore the payment is received

Purchases Queued : False

22 Jul 2015, 5:38 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Gift Certificate gets credited even vefore the payment is received

When set to False, then the GV is purchased and the balance is immediately added to the Customer Balance ...

If you want to approve the GV, before the balance is added to the Customer Balance, you need to set this to True for the Queue ...

22 Jul 2015, 5:45 PM
#5
prabhatm avatar

prabhatm

New Zenner

Join Date:
Jun 2015
Location:
Delhi, India
Posts:
32
Plugin Contributions:
0

Re: Gift Certificate gets credited even vefore the payment is received

I don't want to approve the RELEASE OF GIFT CERIFICATE.
It should release automatically when I UPDATE THE PAYMENT STATUS from PENDING TO PROCESSING.
Unfortunately, it gets released automatically even if the payment status is "PENDING".

22 Jul 2015, 5:47 PM
#6
prabhatm avatar

prabhatm

New Zenner

Join Date:
Jun 2015
Location:
Delhi, India
Posts:
32
Plugin Contributions:
0

Re: Gift Certificate gets credited even vefore the payment is received

I don't want to approve the RELEASE OF GIFT CERIFICATE.
It should release automatically when I UPDATE THE PAYMENT STATUS from PENDING TO PROCESSING.
Unfortunately, it gets released automatically even if the payment status is "PENDING".

22 Jul 2015, 5:51 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Gift Certificate gets credited even vefore the payment is received

The Order Status has nothing to do with the release of the Gift Certificate that is purchased as to when it is added to the customer balance ...

The addition of the Gift Certificate when it is purchased to the Customer Balance is done in one of two ways ...

1 Automatic Release as soon as the Order is complete, based on the QUEUE set to FALSE

2 The delayed release when the Order is complete, based on the QUEUE set to TRUE, where you review the Order and click on GIFT QUEUE and confirm the release of the purchased Gift Certificate to the Customer's Balance

22 Jul 2015, 6:25 PM
#8
prabhatm avatar

prabhatm

New Zenner

Join Date:
Jun 2015
Location:
Delhi, India
Posts:
32
Plugin Contributions:
0

Re: Gift Certificate gets credited even vefore the payment is received

I am sorry. I guess I am not able to communicate properly.

There are two modes of payment i.e. Online Payment through Cards and Money order.

In the case of Online payment through cards if the Queue is set to FALSE, then it's released automatically immediately after the payment because the payment status changes to PROCESSING from PENDING after the online payment.

But this does not work properly when it comes to the OFFline payment. In that case, when the user selects MONEY ORDER as the Payment option and submits the purchase details, the Gift Certificate values also gets added to his account automatically even if the payment status is PENDING before it is received by us.

22 Jul 2015, 9:41 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Gift Certificate gets credited even vefore the payment is received

Let me try to explain this again ...

The Order Status of Pending, Processing, Delivered or Updated or anything else has NOTHING to do with whether or the Gift Certificate is added to the Customer Balance when the Order is complete ...

The ONLY thing that affects when the Gift Certificate is added to the Customer Balance is the setting of whether or not the GV is Queued or not based on that setting for TRUE or FALSE ...

You would have to re-write the code to customize this to work in any other way ...

23 Jul 2015, 2:26 AM
#10
prabhatm avatar

prabhatm

New Zenner

Join Date:
Jun 2015
Location:
Delhi, India
Posts:
32
Plugin Contributions:
0

Re: Gift Certificate gets credited even vefore the payment is received

Allow me to put the case again...

  1. The Gift Certificates are like any other product on the list.
  2. I want the GIFT Certificates to be AUTO RELEASED. [ So GV QUEUE is FALSE ]
  3. Both of us understand, this must be released only when the PAYMENT PROCESS is COMPLETE.
  4. It gets AUTO RELEASED, when the PAYMENT IS PROCESSED through the ONLINE PAYMENT SYSTEM ( CREDIT/DEBIT CARD). So no issues.
  5. The problem comes when we have to deal with the OFFLINE PAYMENT like Money Order. There is a time gap of few days, before we receive the actual payment. But in this case, the moment the user selects MONEY ORDER PAYMENT option, the GV is released instantly, even if the PAYMENT STATUS is PENDING.

My point is no product must be released if the PAYMENT STATUS is PENDING. GV must not be an exception.

I hope it helps.

23 Jul 2015, 2:32 AM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Gift Certificate gets credited even vefore the payment is received

prabhatM:

  1. The problem comes when we have to deal with the OFFLINE PAYMENT like Money Order. There is a time gap of few days, before we receive the actual payment. But in this case, the moment the user selects MONEY ORDER PAYMENT option, the GV is released instantly, even if the PAYMENT STATUS is PENDING.

My point is no product must be released if the PAYMENT STATUS is PENDING. GV must not be an exception.
You and Ajeh are both correct: The feature wasn't designed to work as you wish it to.

Of course you are welcome to customize the code to suit your desired functionality. And we encourage you to submit a pull-request on github with your completed code so that functionality can be integrated into core code once it passes the review process.

23 Jul 2015, 2:34 AM
#12
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Gift Certificate gets credited even vefore the payment is received

I think we all understand how you want this aspect of Zencart to work. It isn't currently written to work that way. As Ajeh said, you would have to rewrite portions of the Zencart code to achieve that functionality.

23 Jul 2015, 3:41 AM
#13
prabhatm avatar

prabhatm

New Zenner

Join Date:
Jun 2015
Location:
Delhi, India
Posts:
32
Plugin Contributions:
0

Re: Gift Certificate gets credited even vefore the payment is received

Thank you guys.

May I expect a little help from somebody to resolve this issue ?

23 Jul 2015, 1:29 PM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Gift Certificate gets credited even vefore the payment is received

To customize the code so that:

1 when a Gift Certificate is purchased and the Order is set to Pending that the GV is NOT auto-released to the Customer Balance

2 when a Gift Certificate is purchased and the Order is set to Processing that the GV IS auto-released to the Customer Balance
You could try this custom code, but you will need to test it very carefully ...

Edit the file:
/includes/modules/order_total/ot_gv.php

and around line 161 you can add the code in RED:

      $gv_order_amount = $gv_order_amount * 100 / 100;

[B]// bof: Auto-Release GV to Customer Balance when order_status not set to Pending 1
      if (MODULE_ORDER_TOTAL_GV_QUEUE == 'false' && $order->info['order_status'] > 1) {
//[/B]      if (MODULE_ORDER_TOTAL_GV_QUEUE == 'false') {
[B]// eof: Auto-Release GV to Customer Balance when order_status not set to Pending 1
[/B]        // GV_QUEUE is false so release amount to account immediately
        $gv_result = $this->user_has_gv_account($_SESSION['customer_id']);
        $customer_gv = false;

What this will do is check the orders_status and change the way the QUEUE works on the Gift QUEUE ...

If an Order is set to an order_status higher than Pending ( 1 ), then the Gift Certificate that is purchased is auto-added to the Customer Balance, but if the Order is set to an order_status of Pending ( 1 ), then you will need to MANUALLY release the GV to the Customer Balance ...