Package paypal_util_pkg

Variables, constants

const g_state_created

g_state_created constant varchar2(255):='created'

payment states

const g_state_approved

g_state_approved constant varchar2(255):='approved'

const g_state_failed

g_state_failed constant varchar2(255):='failed'

const g_state_canceled

g_state_canceled constant varchar2(255):='canceled'

const g_state_expired

g_state_expired constant varchar2(255):='expired'

Functions, procedures

procedure set_api_base_url

procedure set_api_base_url(
    p_sandbox_url in varchar2,
    p_live_url in varchar2
)

set API base URL

procedure switch_to_sandbox

procedure switch_to_sandbox

switch to sandbox (test) environment

procedure set_wallet

procedure set_wallet(
    p_wallet_path in varchar2,
    p_wallet_password in varchar2
)

set SSL wallet properties

function get_access_token

function get_access_token(
    p_client_id in varchar2,
    p_secret in varchar2
) return t_access_token

get access token for other API requests

function create_payment

function create_payment(
    p_access_token in t_access_token,
    p_amount in number,
    p_currency in varchar2,
    p_description in varchar2,
    p_return_url in varchar2,
    p_cancel_url in varchar2,
    p_payment_experience_id in varchar2:=null
) return t_payment

create payment

function execute_payment

function execute_payment(
    p_access_token in t_access_token,
    p_payment_id in varchar2,
    p_payer_id in varchar2
) return t_payment

execute payment

function get_payment

function get_payment(
    p_access_token in t_access_token,
    p_payment_id in varchar2
) return t_payment

get payment

function create_payment_experience

function create_payment_experience(
    p_access_token in t_access_token,
    p_payment_experience in t_payment_experience
) return varchar2

create payment experience

procedure delete_payment_experience

procedure delete_payment_experience(
    p_access_token in t_access_token,
    p_payment_experience_id in varchar2
)

delete payment experience

Types

record t_access_token

type t_access_token is record(
    access_token varchar2(4000),
    token_type varchar2(255),
    duration_seconds number,
    created_date date,
    expires_date date
)

access token

record t_payment

type t_payment is record(
    payment_id varchar2(255),
    intent varchar2(255),
    state varchar2(255),
    approval_url varchar2(4000)
)

payment

record t_pe_flow_config

type t_pe_flow_config is record(
    landing_page_type varchar2(255)
)

payment experience flow config

record t_pe_input_fields

type t_pe_input_fields is record(
    allow_note boolean,
    no_shipping pls_integer,
    address_override pls_integer
)

payment experience input fields

record t_pe_presentation

type t_pe_presentation is record(
    brand_name varchar2(255),
    logo_image varchar2(255),
    locale_code varchar2(255)
)

payment experience presentation

record t_payment_experience

type t_payment_experience is record(
    payment_experience_id varchar2(255),
    payment_experience_name varchar2(255),
    flow_config t_pe_flow_config,
    input_fields t_pe_input_fields,
    presentation t_pe_presentation
)

payment web experience profile