module GpWebpay

Service object signs request which can be send to GP Webpay payment gateway.

  1. Use request value object to translate attributes to correct GP Webpay format and order.

  2. Append generated digest to attributes.

  3. prepare url to send for GP Webpay

@param [Hash] optional attributes for GP Webpay

@return [Hash] data needed to make request:

full url for GET request or
url_root and list of attributes for POST request.

Service object creates request data for GP Webpay CREATE_ORDER operation.

Examples:

> Create order which will remember credit card and send back TOKEN.

> GpWebpay::Http::CreateOrder.call(order_number: 146, amount: 456, currency: 978, deposit_flag: 1, user_param1: 'T')

> Use returned token to skip adding card again:

> GpWebpay::Http::CreateOrder.call(order_number: 147, amount: 456, currency: 978, deposit_flag: 1, user_param1: 'S', token: 'TOKEN')

Service object creates request data for GP Webpay CARD_VERIFICATION operation.

Service object validates result received from GP Webpay response redirect.

  1. Use public cert of GP Webpay to verify it comes from GP Webpay.

  2. Whitelist allowed attributes which are expected from GP Webpay.

  3. Calculate digest and make sure it corresponds to received DIGEST.

  4. Calculate digest1 and make sure it corresponds to received DIGEST1 (which includes our merchant number for extra security).

@param [Hash] Parameters hash received in response from GP Webpay.

@return [Boolean] true if signature is valid for both digests.

rubocop:disable Metrics/ParameterLists

Service object signs request which can be send to GP Webpay payment gateway.

  1. Use request value object to translate attributes to correct GP Webpay format and order.

  2. Append generated signature to attributes. We expect that XML types are prefixed with 'ins0:' by default.

  3. send XML WS SOAP API request.

  4. generate response object:

    • success containing response.

    • http error when client-side request fails.

    • fail error when external server returns fault.

@param [Hash] attributes for GP Webpay

@return [GpWebpay::Ws::WsResponse] response value object

Service object checks if GP Webpay WS service is available.

  1. Send request :echo operation to SOUP API.

  2. Receive answer, return true if response is present in desired format.

  3. Return false if

    • response is not in valid format.

    • request fails client-side.

    • request returns failure from server.

@return [Boolean] GP Webpay is available

Service object returns current status of credit card token. Should be used to keep credit card status up-to date, should be called before process_token_payment to ensure card is still VERIFIED.

@param [Hash] attributes for GP Webpay

@return [GpWebpay::Ws::WsResponse] response value object

Service object returns current status of payment.

@param [Hash] attributes for GP Webpay

@return [GpWebpay::Ws::WsResponse] response value object

Service object returns current status of credit card token. Should be used to keep credit card status up-to date, should be called before process_token_payment to ensure card is still VERIFIED.

@param [Hash] attributes for GP Webpay

@return [GpWebpay::Ws::WsResponse] response value object

Service object creates fast payment without need of leaving user from Wilio web / app. It uses VERIFIED credit card token to skip filling card again and 3D secure step.

@param [Hash] attributes for GP Webpay

@return [GpWebpay::Ws::WsResponse] response value object

Service object creates fast payment without need of leaving user from Wilio web / app. It uses VERIFIED credit card token to skip filling card again and 3D secure step.

@param [Hash] attributes for GP Webpay

@return [GpWebpay::Ws::WsResponse] response value object

Service object creates fast payment without need of leaving user from Wilio web / app. It uses VERIFIED credit card token to skip filling card again and 3D secure step.

@param [Hash] attributes for GP Webpay

@return [GpWebpay::Ws::WsResponse] response value object

Service object changes credit card token status to “REVOKED”. Should be used when user decides to remove card from system.

@param [Hash] attributes for GP Webpay

@return [GpWebpay::Ws::WsResponse] response value object

Service object creates fast payment without need of leaving user from Wilio web / app. It uses VERIFIED credit card token to skip filling card again and 3D secure step.

@param [Hash] attributes for GP Webpay

@return [GpWebpay::Ws::WsResponse] response value object

Service object creates fast payment without need of leaving user from Wilio web / app. It uses VERIFIED credit card token to skip filling card again and 3D secure step.

@param [Hash] attributes for GP Webpay

@return [GpWebpay::Ws::WsResponse] response value object

Service object creates fast payment without need of leaving user from Wilio web / app. It uses VERIFIED credit card token to skip filling card again and 3D secure step.

@param [Hash] attributes for GP Webpay

@return [GpWebpay::Ws::WsResponse] response value object

Service object changes credit card token status to “REVOKED”. Should be used when user decides to remove card from system.

@param [Hash] attributes for GP Webpay

@return [GpWebpay::Ws::WsResponse] response value object

Service object creates fast payment without need of leaving user from Wilio web / app. It uses VERIFIED credit card token to skip filling card again and 3D secure step.

@param [Hash] attributes for GP Webpay

@return [GpWebpay::Ws::WsResponse] response value object

Service object validates result received from GP Webpay response by WS in XML format.

  1. Use public cert of GP Webpay to verify it comes from GP Webpay.

  2. Whitelist allowed attributes which are expected from GP Webpay.

  3. Calculate signature and make sure it corresponds to received signature.

@param [Hash] Parameters hash received in XML response from GP Webpay.

@return [Boolean] true if signature is valid for both digests.

Constants

VERSION

Public Class Methods

config() click to toggle source
# File lib/rails-gp-webpay.rb, line 44
def self.config
  @configuration
end
configure() { |configuration| ... } click to toggle source
# File lib/rails-gp-webpay.rb, line 48
def self.configure
  yield(@configuration)
end
root() click to toggle source
# File lib/rails-gp-webpay.rb, line 52
def self.root
  File.dirname(__dir__)
end