Developer Center

Third Party Method

The "Third Party" method is when a customer leaves the site to make a payment and returns when the payment is complete.

Define a function named "area" inside the class in the module. With this function, you can present an "HTML" content to the customer.

If you need a credit card form, take a look at the "Merchant" method document.

If your payment service provider supports the REFUND feature, see the "Refunds" document.

Variables

The system variables, user variables and invoice variables you need are described below.

You can use the variables specified in the example in the "config_fields, area, capture" functions.

You must call the "set_checkout" function beforehand to use it within the "callback" function. Otherwise, customer variables and invoice variables cannot be obtained. The "set_checkout" function is explained in detail in the "callback" document.

System Variables

 $this->config["settings"]["...your_field..."] # Custom configuration field
 __("website/index/meta/title")# Company Name
 $this->l_payNow               # “Pay Now” button text
 $this->name                   # Module Name
 $this->lang["invoice-name"]   # Module Display Name
 $this->url                    # Module Directory URL Address
 $this->dir                    # Module Directory Path (eg. /coremio/modules/Payment/SamplePay/)
 $this->lang["example"]        # Calling a field from a language file
 APP_URI                       # Website URL Address
 $this->links["successful"]    # Payment successful page link
 $this->links["failed"]        # Payment failed page link
 $this->links["return"]        # Return link
 $this->links["callback"]      # Callback link

User Variables

 $this->clientInfo->id              # WISECP Client ID
 $this->clientInfo->name            # First Name
 $this->clientInfo->surname         # Last Name
 $this->clientInfo->full_name       # Full Name
 $this->clientInfo->email           # Email Address
 $this->clientInfo->gsm_cc          # GSM phone country code (eg. 1,44,90, etc.)
 $this->clientInfo->gsm             # GSM phone number (without country code)
 $this->clientInfo->phone           # GSM phone number (including country code)
 $this->clientInfo->lang            # Language Used (eg. en,fr,de, etc.)
 $this->clientInfo->kind            # Account Type (eg. individual, corporate)
 $this->clientInfo->company_name    # Company Name
 $this->clientInfo->company_tax_number # Company TAX Number
 $this->clientInfo->company_tax_office # Company TAX Office
 $this->clientInfo->address->country_code # Country code of the selected address (eg. US,UK,DE, etc.)
 $this->clientInfo->address->country_name # Country name of the selected address
 $this->clientInfo->address->city        # City name of the selected address
 $this->clientInfo->address->counti      # State of the selected address
 $this->clientInfo->address->zipcode    # Postal code of the selected address
 $this->clientInfo->address->address     # Address

Invoice Variables

 $this->checkout["id"]; // Checkout ID, unique identification number for payment (eg. 1234567)
 $params['amount']; // Total amount payable (eg. 199.99)
 $this->currency($params['currency']); // Currency code (eg. USD, EUR , GBP, etc.)

Response

In the "area" function, you need to present an "HTML" content to the customer in order to make a payment transaction. Usually a payment form or "IFRAME" is shown.

Example Source Code:

public function area($params=[])
{
    $merchant_id = $this->config["settings"]["example1"] ?? 0;
    
    return
        '<form action="https://www.sample.com/checkout" method="POST">
            <input type="hidden" name="merchant_id" value="'.$merchant_id.'">
            <input type="hidden" name="amount" value="'.$params["amount"].'">
            <input type="hidden" name="currency" value="'.$this->currency($params["currency"]).'">
            <input type="hidden" name="custom_id" value="'.$this->checkout_id.'">
            <input type="hidden" name="description" value="Invoice Payment">
            <input type="submit" value="'.$this->lang["pay-button"].'">
        </form>';
}
Settings/Configuration Page Merchant Method

Do you have any questions?

Feel free to contact us
Contact Us
Copyright © 2022. All Rights Reserved.
Join Our Discord Channel
Top