Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
Step 1.
curl "https://apigateway.payfirma.com/customer-service/customer" 
--request POST  
--header "Content-Type: application/json"       
--header "Authorization: Bearer {BEARER_TOKEN}"      
--data "{  
         "email": "brandon@stark.com",  
         "first_name": "Brandon",  
         "last_name": "Stark",  
         "company": "Payfirma",  
         "bcc_emails": "john.snow@stark.com",  
         "telephone": "1234567891",  
         "address1": "No. 1 Road",  
         "address2": "Street 2",  
         "city": "Vancouver",  
         "province": "BC",  
         "country": "Canada",  
         "postal_code": "V6E 1B2", 
         "custom_id": "Internal456"}"
Step 2. 
curl "https://apigateway.payfirma.com/customer-service/customer/{CUSTOMER_LOOKUP_ID/card/"
--request POST  
--header "Content-Type: application/json"  
--header "Authorization: Bearer {BEARER_TOKEN}"
 
--data '{
   
   "card_expiry_month": 11,
  
    "card_expiry_year": 16,
   
   "card_number": "4111111111111111",
 
     "cvv2": "595",
   
   "is_default": true,

      "card_description": 
       "test card"
}'

Making a payment on a stored card

...

Code Block
Step 1.
curl " https://apigateway.payfirma.com/plan-service/plan/"
--request POST      
--header "Content-Type: application/json"     
--header "Authorization: Bearer {BEARER_TOKEN}"      
--data "'{
 {   "name": "Sample Daily Plan",
    "amount": 10.99,
    "currency": "CAD",
    "frequency": "DAILY",
    "number_of_payments": 10,
    "send_receipt": false
}'
}"

Step 3. 
curl " https://apigateway.payfirma.com/customer-service/customer/{CUSTOMER_LOOKUP_ID}/subscription "
--request POST      
--header "Content-Type: application/json"   
--data '{
 { "plan_lookup_id": "{PLAN_LOOKUP_ID}",
  "card_lookup_id": "{CARD_LOOKUP_ID}",
  "amount": 10.99,
  "start_date": 1467760023000,
  "email": "brandon@stark.com",
  "description": "My test subscription"
}'

Reporting

Transaction reporting can be accessed through the PayHQ web application or through the PayHQ API.

...

https://github.com/Payfirma/New_Payfirma_Woo_Gateway/blob/master/download/Payfirma_Woo_Gateway.zip

EFT

Shopify

Configuration

Install the app

  • Shopify Settings

  • Select Payments

  • Select Search by Provider

  • Search for “Merrco Payments”

  • Select Merrco Payments Activate and Connect

Connect to PayHQ

...

Select settings within the Merrco Payments app

...

Enter your PayHQ login credentials

...

Enable both capture billing and shipping address

...

Base URL

The base URL for all API requests is:

https://apigateway.payfirma.com

Balance

Code Block
GET /transaction-service-vt/eft/balance

Returns wallet balance for EFT to do instant transactions else would be a few days for settlement.

Response

Returns a JSON object with the following properties:

  • available_balance: fund available balance currently for transaction

  • actual_balance: total balance - Funds are in the wallet

Example:

Request

Code Block
GET /transaction-service-vt/eft/balance

Response:

Code Block
{
    "available_balance": 13.36,
       "actual_balance": 13.36
}

Incoming Request - EFT Debit

Code Block
GET /transaction-service-vt/eft/incoming-requests

Returns list of incoming requests asking you for funds - EFT Debit

Response

Returns a JSON object with the following properties:

  • incoming_requests: Array of objects of incoming request

    • amount: amount asking for processor_transaction_id: unique identifier

    • email: email of the user asking for

    • status: status of the request

    • redirect_url: redirect URL to start EFT transaction date: date of the EFT request

    • description: description of the EFT request

Example:

Request:

Code Block
GET /transaction-service-vt/eft/incoming-requests

Response:

Code Block
incoming_requests: [
    {
        "amount": 1,
        "processor_transaction_id": "PAY24204476",
        "email": "sample@gmail.com",
        "status": "PENDING",
        "redirect_url": "https://sample.com?redirect",
        "date": "1/17/2024 11:26:40 PM",
        "description": "API Test Doc"
    }
]

Requesting Funds - EFT Credit

Code Block
POST /transaction-service-vt/eft/request/{customer_lookup_id}

Requesting funds to PayHQ customer via EFT - EFT Credit

Request Body

Code Block
{
    "amount": 1,
    "description": "API Test Doc"
}

Response

Returns a JSON object with the following properties:

  • amount: amount requested

  • email: email of the customer request sent to

  • card_type: Type of Card Transaction(Internal Use)

  • description: description of the EFT request sent

  • id: unique identifier for PayHQ

  • transaction_id: unique identifier for PayHQ hashed

  • transaction_success: Is request sent successfully

  • transaction_result: result of the EFT request sent - at first would be “PENDING” until other user do some action on it. Status would be updated on your side too

  • transaction_time: time of request epoch time format transaction_type: Type of the transaction(Internal Use)

Example:

Request:

Code Block
POST /transaction-service-vt/eft/request/{customer_lookup_id}

Response:

Code Block
{
    "amount": 1,
    "email": "sample@gmail.com",
    "card_type": "EFT",
    "description": "API Test Doc",
    "id": 9587492,
    "transaction_id": "8Xj5QZyE499o9dGv6pA2",
    "transaction_success": true,
    "transaction_result": "PENDING",
    "transaction_time": 1705534494112,
    "transaction_type": "EFT_CREDIT"
}

Bank Deposit:

Code Block
POST /transaction-service-vt/eft/bank-deposit

Deposit to your linked bank account from your wallet available balance

Request Body

Code Block
{
"amount": 1
}

Response:

Only status 200 - If successful else 400 with error message

Example:

Request:

Code Block
POST /transaction-service-vt/eft/bank-deposit

Send Funds - EFT Debit

Code Block
POST /transaction-service-vt/eft/send/{customer_lookup_id}

Send funds to the customer’s Bank account directly - EFT Debit

Request Body

Code Block
{
    "amount": 1,
    "description": "API Test Doc",
    "transit_number": "12345",
    "institution_number": "123",
    "account_number": "123467"
}

Response

Returns a JSON object with the following properties:

  • amount: amount to send

  • email: email of the customer

  • first_name: first name of the customer

  • last_name: last name of the customer

  • province: province(in code) - BC

  • country: country(in code) - CA

  • card_type: Type of Card Transaction(Internal Use) description: description of the EFT request sent

  • id: unique identifier for PayHQ

  • transaction_id: unique identifier for PayHQ hashed transaction_success: Is request sent successfully

  • transaction_result: result of the EFT request sent - at first would be “PENDING” until other user do some action on it. Status would be updated on your side too

  • transaction_time: time of request epoch time format

  • transaction_type: Type of the transaction(Internal Use)

Example:

Request:

Code Block
POST /transaction-service-vt/eft/send/{customer_lookup_id}

Response:

Code Block
{
    "amount": 1,
    "email": "sample@payfirma.com",
    "first_name": "Sample",
    "last_name": "Test",
    "province": "BC",
    "country": "CA",
    "card_type": "EFT",
    "description": "API Test Doc - Account Number: ***1234",
    "id": 9587494,
    "transaction_id": "EmJVqxBX1ZZKogz6NeGn",
    "transaction_success": false,
    "transaction_result": "PENDING",
    "transaction_time": 1705535538104,
    "transaction_type": "EFT_DEBIT"
}

Shopify

Configuration

Install the app

  • Shopify Settings

  • Select Payments

  • Select Search by Provider

  • Search for “Merrco Payments”

  • Select Merrco Payments Activate and Connect

Connect to PayHQ

  • Select settings within the Merrco Payments app

  • Enter your PayHQ login credentials

  • Enable both capture billing and shipping address

  • Select Activate

Partner Integration

Partner Code:

Please note that each partner will be assigned a three-letter word by Merrco Payfirma (please ask us if you require one).

To tag all transactions originating from your application, please send your assigned three-letter word

in the custom_id field in the sales request packet. This identifying word will help us to reconcile all data for

merchants using your application.

Sandbox Environment:

Create a Sandbox Account:

To create a sandbox account for testing, kindly proceed by completing the form accessible through the following link: Sandbox PayHQ Select "Request one today!" during the process.

Endpoints:

Please note that all URLs mentioned in the API documentation point to our live environment. To point them

to our sandbox environment, all URLs in the format https://xxxx.payfirma.com need to be replaced with

https://sandbox-xxxx.payfirma.com, which will start pointing to the sandbox environment.

Test Processor:

The Test Processor is a simulated processor designed for testing purposes, featuring placeholder processing logic. Specific outcomes are triggered based on the following conditions:

  1. All transactions with an odd amount (digits before decimals) will be approved.

  2. All transactions with an even amount (digits before decimals) will be declined.

  3. Refunds exceeding the actual sale amount will be declined.

  4. Captures with an even amount will also be declined.

Special Cases:

  • $2.10 will result in a decline with the reason "Failed to tokenize card information."

  • $2.20 will result in a decline with the reason "Email is required."

  • $2.30 will result in a decline with the reason "Missing mandatory card information field(s) in the request."

  • $2.40 will result in a decline with the reason "Transaction Not Supported."

  • $2.50 will result in a decline with the reason "Failed to de-tokenize card information."

  • $2.60 will result in a decline with the reason "Failed to authorize."

Important info: