Create field in account settings with hidden display( for points )
--------------------------------------------------
Name:Credits
machine name: field_credits
Create 2 Rules
-----------------------
For Crediting points
------------------------------
Event:
* After updating an existing commerce order
Conditions :
* Data comparison ( Parameter: Data to compare: [commerce-order:status], Data value: Completed )
* AND
* NOT Data comparison ( Parameter: Data to compare: [commerce-order-unchanged..., Data value: [commerce-order:status] )
Action:
* Calculate a value ( Parameter: Input value 1: [commerce-order:owner:field_credits, Input value 2: 5, operator: (+), Provides variables: Calculation result (result))
* Set a data value ( Parameter: Data: [commerce-order:owner:field_credits, Value: [result] )
For Debiting points
------------------------------
Event:
* After updating an existing commerce order
Conditions :
* Data comparison ( Parameter: Data to compare: [commerce-order-unchanged:status, Data value: Completed )
* AND
* NOT Data comparison ( Parameter: Data to compare: [commerce-order-unchanged:status, Data value: [commerce-order:status] )
Action:
* Calculate a value ( Parameter: Input value 1: [commerce-order:owner:field_credits, Input value 2: 5, operator: (-), Provides variables: Calculation result (result))
* Set a data value ( Parameter: Data: [commerce-order:owner:field_credis, Value: [result] )
points 5 to be added with credit & subtracted with debit while changing status of commerce order