Skip to content

Logo

Pay4fun

Supports in this guide: Payments, Payouts

Provider website: p4f.com


What you need to do for start processing transactions (brief summary)

  1. Get your credentials (from Pay4fun)
  2. Connect in Dashboard
  3. Send an API request

Prerequisites: get from Pay4fun

Contact your Pay4fun account manager to get your account verified and receive the following credentials.

  • Merchant ID -> Corefy field merchant_id.
  • Merchant Key -> Corefy field merchant_key.
  • Merchant Secret -> Corefy field merchant_secret.

BRL only.


Payments processing (connect Provider account, create payment-invoice)

Connect Provider account in Corefy Dashboard

Step 1 - Open connection form

Open Pay4fun in the provider directory and press Connect at Pay4fun Provider Overview page in the New connection section.

Step 2 - Fill in fields and select settings

  • Merchant ID
  • Merchant Key
  • Merchant Secret
  • Test Mode -> (enable if you are using sandbox credentials)

Success

You have connected Pay4fun Provider account!


First request to Corefy API (MIN)

What it does: creates a payment-invoice and redirects the customer to Pay4fun's hosted wallet payment page. customer data is not part of this connector's request format at all.

Payment - MIN

POST /api/payment-invoices

{
  "data": {
    "type": "payment-invoice",
    "attributes": {
      "reference_id": "d0ed0d7f-d983-4901-a843-aad52374ba81",
      "service": "pay4fun_brl_hpp",
      "currency": "BRL",
      "amount": 100
    }
  }
}

Payment - MAX

POST /api/payment-invoices

{
  "data": {
    "type": "payment-invoice",
    "attributes": {
      "reference_id": "d0ed0d7f-d983-4901-a843-aad52374ba81",
      "service": "pay4fun_brl_hpp",
      "currency": "BRL",
      "amount": 100,
      "service_fields": {
        "account_id": "56443853024",
        "account_email": "customer@example.com"
      }
    }
  }
}

Important

service_fields.account_id and service_fields.account_email identify the customer's Pay4fun wallet - if omitted, Pay4fun itself prompts the customer for this on its hosted page.


Extended request (MAX)

Why add extra fields (typical reasons): - Positively influence conversion rate - Include optional fields required by your specific flow


Constants (fallback fields)

Constants are static values that Corefy can send to Pay4fun instead of dynamic data from your API request, when those fields are missing in the request.

Priority (predictable rule): 1. If a value is present in the request -> Corefy uses the request value 2. Else if the constant is set -> Corefy uses the constant 3. Else -> provider may reject the request or apply its defaults (depends on provider)

Currently available constants (constant -> Corefy API field)

  • LANGUAGE -> language of Pay4fun's hosted payment page; defaults to en-US if not set
  • MERCHANT_LOGO -> your own logo shown on Pay4fun's hosted payment page
  • LAYOUT_COLOR -> accent color shown on Pay4fun's hosted payment page

Refunds

Pay4fun does not support refunds.


Payouts processing (connect Provider account, create payout-invoice)

Connect Provider account in Corefy Dashboard

Uses the same Provider account connected above - no separate connection step.

First request to Corefy API (MIN)

What it does: creates a payout-invoice, sending funds to the customer's Pay4fun wallet. customer data is not part of this connector's request format at all.

Payout - MIN

POST /api/payout-invoices

{
  "data": {
    "type": "payout-invoice",
    "attributes": {
      "reference_id": "fcabc311-32c1-4fec-ac46-130d253d94bb",
      "service": "pay4fun_brl",
      "currency": "BRL",
      "amount": 100,
      "fields": {
        "account_id": "56443853024",
        "account_email": "customer@example.com"
      }
    }
  }
}

Important

fields.account_id and fields.account_email identify the recipient's Pay4fun wallet.


Extended request (MAX)

Why add extra fields (typical reasons): - Include optional fields required by your specific flow


Refunds

Pay4fun does not support refunds.


Additional info

  1. Active reconciliation is available on both Payments and Payouts - Corefy can poll Pay4fun's status endpoints in addition to receiving its callbacks.
  2. Callback routing is handled automatically - Corefy generates the callback/return URLs and sends them to Pay4fun with every request, so nothing has to be set up on Pay4fun's side.
  3. No recurring - this connector does not support saving/charging a token through Corefy.
  4. No hardcoded fallback values - customer fields simply aren't part of this connector's request format on either flow, so there's nothing for Corefy to default when customer data is missing.

FAQ / Troubleshooting

  • Invalid credentials / auth error -> verify Merchant ID, Merchant Key and Merchant Secret for the selected environment (test_mode)
  • Currency or service is not supported -> only BRL is available for this connector
  • Customer prompted for wallet details on Pay4fun's page -> send account_id/account_email yourself if you want to skip that step
  • Refund fails -> Pay4fun does not support refunds through Corefy

Question

Still looking for help connecting your Pay4fun account? Please contact our support team!