I have to basically do the reverse of signing the request to verify that the notification comes from them. Lots of code just for that. I return the changed status from the PL/pgSQL function because i will need to email customers when a payment is completed, and i need to know when.
24 lines
436 B
PL/PgSQL
24 lines
436 B
PL/PgSQL
-- Deploy camper:redsys_response to pg
|
|
-- requires: schema_camper
|
|
-- requires: currency_code
|
|
|
|
begin;
|
|
|
|
set search_path to camper, public;
|
|
|
|
create type redsys_response as (
|
|
merchant_code text
|
|
, terminal_number integer
|
|
, response_code integer
|
|
, date_time timestamp
|
|
, secure_payment boolean
|
|
, transaction_type integer
|
|
, amount text
|
|
, currency_code currency_code
|
|
, order_number text
|
|
, authorization_code text
|
|
, error_code text
|
|
);
|
|
|
|
commit;
|