Advertisement
thongthongthong

payment error

Mar 31st, 2023
790
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. select  p.payment_id
  2.             ,p.channel_status
  3.            
  4.         -- CYBS ERROR --
  5.         ,json_extract_scalar(p.extra_data, '$.charge_response.errorInformation.reason') as error_reason1
  6.         ,json_extract_scalar(p.extra_data, '$.charge_response.reason') as error_reason2
  7.         ,json_extract_scalar(p.extra_data, '$.update_response.reason_code') as error_reason3
  8.         ,json_extract_scalar(p.extra_data, '$.fail_reason') as error_reason4
  9.         ,json_extract_scalar(p.extra_data, '$.pay_result.fail_reason') as error_reason5
  10.         ,json_extract_scalar(p.extra_data, '$.otp_result.fail_reason') as error_reason6
  11.         ,json_extract_scalar(p.extra_data, '$.pay_result.error') as error_reason7
  12.         ,json_extract_scalar(p.extra_data, '$.otp_required_pay_result.error') as error_reason8
  13.         ,json_extract_scalar(p.extra_data, '$.otp_require_redirect_pay_result.error') as error_reason9
  14.         ,json_extract_scalar(p.extra_data, '$.commit_log.reason_code_text') as payment_responsetext1
  15.         ,json_extract_scalar(p.extra_data, '$.notify_log.reason_code_text') as payment_responsetext2
  16.         ,json_extract_scalar(p.extra_data, '$.expire_errmsg') as payment_expire_responsetext
  17.         ,json_extract_scalar(p.extra_data, '$.cancel_errmsg') as payment_cancel_msg
  18.         ,json_extract_scalar(extra_data, '$.cybs_response.message') as cybs_message
  19.         ,json_extract_scalar(extra_data, '$.params.checkout.mcc') as mcc
  20.         ,json_extract_scalar(extra_data, '$.use_3ds.is_enabled') AS sent_for_3ds
  21.          ,case  when json_extract_scalar(extra_data, '$.cybs_response.payer_authentication_specification_version') is not null then json_extract_scalar(extra_data, '$.cybs_response.payer_authentication_specification_version')
  22.                 when regexp_like(json_extract_scalar(extra_data, '$.cybs_response.payer_authentication_proof_xml'), 'version>1.0.2&lt') = true then '1.0.2'
  23.                 else NULL
  24.         end as specification_version
  25.  
  26.         -- AIRPAY ERROR & MESSAGE --
  27.         ,json_extract_scalar(p.extra_data, '$.pay_result.result') as airpay_error1
  28.         ,json_extract_scalar(p.extra_data, '$.otp_required_pay_result.result') as airpay_error2
  29.         ,json_extract_scalar(p.extra_data, '$.otp_require_redirect_pay_result.result') as airpay_error3
  30.         ,json_extract_scalar(p.extra_data, '$.charge_response.errorInformation.message') as error_message1
  31.         ,json_extract_scalar(p.extra_data, '$.charge_response.message') as error_message2
  32.         ,json_extract_scalar(p.extra_data, '$.update_response.reason_code_text') as error_message3
  33.  
  34.         -- VN Airpay iBanking ERROR --
  35.         ,json_extract_scalar(p.extra_data, '$.notify_request_params.message') as ibank_error_message1
  36.         ,json_extract_scalar(p.extra_data, '$.check_txn_response.message') as ibank_error_message2
  37.         -- 3DS check --
  38.         ,json_extract_scalar(p.extra_data, '$.commit_log.eci') eci1
  39.         ,json_extract_scalar(p.extra_data, '$.notify_log.eci') eci2
  40.         ,json_extract_scalar(p.extra_data, '$.commit_log.enroll_check') enrolcheck1
  41.         ,json_extract_scalar(p.extra_data, '$.notify_log.enroll_check') enrolcheck2
  42.         ,json_extract_scalar(p.extra_data, '$.cybs_response.payer_authentication_pares_status') pares
  43.         -- ORDER_ID --
  44.         ,json_extract_scalar(p.extra_data, '$.pay_result.order.airpay_order_id') as oid1
  45.         ,json_extract_scalar(p.extra_data, '$.update_result.order.airpay_order_id') as oid2
  46.         ,json_extract_scalar(p.extra_data, '$.commit_result.order.airpay_order_id') as oid3
  47.         ,json_extract_scalar(p.extra_data, '$.otp_required_pay_result.order.airpay_order_id') as oid4
  48. from    shopeepay.shopee_payment_module_payment_vn_db__payment_v2_tab__vn_daily_s2_live p
  49. where   1 = 1
  50.   and   p.ctime >= cast(to_unixtime(date_trunc('month', current_date - interval '90' day)) as int) + 3600
  51.   and   p.payment_type = 4  -- PAYMENT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement