From cfad5bc280ef5d0dd92513ebca220ab37ca7dc0d Mon Sep 17 00:00:00 2001 From: phyusin Date: Tue, 18 Dec 2018 17:17:40 +0630 Subject: [PATCH] change redeem formula --- app/models/sale_payment.rb | 2 +- app/views/origami/redeem_payments/index.html.erb | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/models/sale_payment.rb b/app/models/sale_payment.rb index a5f9d4fc..9d418f7b 100755 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -184,7 +184,7 @@ class SalePayment < ApplicationRecord url = paypar_url.to_s + membership_actions_data.gateway_url.to_s merchant_uid = membership_actions_data.merchant_account_id auth_token = membership_actions_data.auth_token - campaign_type_id = membership_actions_data.additional_parameters["campaign_type_id"] + campaign_type_id = JSON.parse(membership_actions_data.additional_parameters)["campaign_type_id"] sale_data = Sale.find_by_sale_id(sale_id) if sale_data diff --git a/app/views/origami/redeem_payments/index.html.erb b/app/views/origami/redeem_payments/index.html.erb index 42ca124f..92361edb 100755 --- a/app/views/origami/redeem_payments/index.html.erb +++ b/app/views/origami/redeem_payments/index.html.erb @@ -189,7 +189,17 @@ }); }else{ - swal ( "Information" , result.message); + swal({ + title: 'Oops', + text: result.message.toString(), + type: 'error', + html: true, + closeOnConfirm: false, + closeOnCancel: false, + allowOutsideClick: false + }, function () { + window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type + "/payment/others_payment/Redeem"; + }); } } })