add auth_token

This commit is contained in:
Moe Su
2017-06-13 19:02:06 +06:30
3 changed files with 39 additions and 29 deletions

View File

@@ -27,7 +27,7 @@ class Origami::PaymentsController < BaseOrigamiController
membership = MembershipSetting.find_by_membership_type("paypar_url")
memberaction = MembershipAction.find_by_membership_type("get_all_member_account")
merchant_uid = memberaction.merchant_account_id.to_s
merchant_uid = memberaction.merchant_account_id.to_s
auth_token = memberaction.auth_token.to_s
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
@@ -39,11 +39,16 @@ class Origami::PaymentsController < BaseOrigamiController
)
@balance = 0.00
response["data"].each do |res|
if res["accountable_type"] == "RebateAccount"
@balance = res["balance"]
end
@accountable_type = ''
if response["data"]==true
response["data"].each do |res|
if res["accountable_type"] == "RebateAccount"
@balance = res["balance"]
@accountable_type = res["accountable_type"]
end
end
end
#end customer amount
@sale_data.sale_payments.each do |spay|

View File

@@ -15,7 +15,6 @@
</tr>
<tr>
<td><strong>Customer :</strong> <%= @sale_data.customer.name%></td>
<td><strong>Points :</strong> <%= @balance %> </td>
</tr>
</table>
</div>
@@ -70,6 +69,12 @@
<td style="width:80%; text-align:left; border-top:none"><strong>Grand Total</strong></td>
<td style="width:20%; text-align:right; border-top:none"><strong><span><%=@sale_data.grand_total rescue 0%></span></strong></td>
</tr>
<%if @balance > 0%>
</tr>
<td style="width:80%; text-align:left; border-top:none"><strong><%= @accountable_type %></strong></td>
<td style="width:20%; text-align:right; border-top:none"><strong><span><%=@balance%></span></strong></td>
</tr>
<% end %>
</tfooter>
</table>
</div>