# Dragonpay

> Accept one-time Dragonpay payments through the Direct API or Checkout with customer details supplied in advance and confirm the result on your server.

## Basic information

The customer pays by following the instructions for the payment channel offered through Dragonpay.

- Integration paths: [Direct API](/payments/online-payments/api), [Checkout](/payments/online-payments/checkout)
- Transaction type: One-time payment
- `lpmsInfo.lpmsType`: `Dragonpay`

| Customer country/region | Order currency |
| --- | --- |
| 🇵🇭 PH | PHP |

The customer country/region is the `billingInformation.country` value in the payment request.

This guide applies to enabled merchants that collect the customer's billing and contact details before creating the payment, as described in [Before you start](#before-you-start). Before using another market or order currency, confirm the scope enabled for your merchant and application with Onerway, and use [List Available Payment Methods](/payments/api-reference/endpoints/list-available-payment-methods) to check the current order.

<note>

Before you apply to enable Dragonpay, contact Onerway to confirm that it can be enabled for your merchant account and application.

</note>

## Before you start

Complete [Integration Setup](/payments/get-started/setup) and confirm that Dragonpay is enabled, along with the applicable transaction limits, payment expiry, settlement arrangements, and test procedure. See [Currency and Amount Validation](/payments/get-started/currency-and-amount) for amount formatting.

For the flow described here, collect the customer's billing first and last name, email address, actual country, phone number, and address before creating the payment. Confirm any additional customer information required by your enabled configuration with Onerway, including whether an identity identifier is needed and its accepted format. Supply shipping details according to the API conditions. Configure notification and return URLs, and retain a mapping between your order and the Onerway payment identifiers.

Supply the collected `firstName`, `lastName`, `email`, `country`, `phoneCountryCode`, `phone`, `address`, `city`, `province`, `street`, `number`, and `postalCode` in `billingInformation`. Supply the full billing address in `address`; the separate address fields do not replace it in this flow. If your configuration requires an identity identifier, supply it as a string in `identityNumber` using the confirmed format. Follow the public API format: `phoneCountryCode` contains digits without `+`, and `phone` contains the local number without its country code. Use `street` for the street name, `number` for the house or building number, and `province` for the ISO 3166-2 subdivision code. This guide supplies these details in advance; it does not rely on the payment page collecting missing information. The billing and shipping objects must still satisfy the API field conditions.

## Start the payment

### Direct API

1. Check [List available payment methods](/payments/api-reference/endpoints/list-available-payment-methods) for the current order. After the customer selects this method, call [Create direct transaction](/payments/api-reference/endpoints/direct-create-transaction) from your server with `productType=LPMS`, `subProductType=DIRECT`, `txnType=SALE`, and `paymentMode=WEB`. Set `lpmsType=Dragonpay` in [`lpmsInfo`](/payments/api-reference/endpoints/direct-create-transaction#request-lpmsInfo), encoded as a JSON string.
2. Supply the customer details prepared above in `billingInformation`, and follow the API requirements for `shippingInformation`. Encode both as JSON strings. Include products, notification and return URLs, and merchant-collected end-user IP, browser, and device information in [`txnOrderMsg`](/payments/api-reference/endpoints/direct-create-transaction#request-txnOrderMsg). Keep product and order currencies consistent, with product amounts, discounts, and shipping fees adding up to `orderAmount`.<br />Select the request example “Redirect local payment request (illustrative)”. It uses Bancontact / BE / EUR to show the shared structure. Replace the method with `Dragonpay`, use PHP for this flow, and supply the actual order and all billing details prepared above. The example amount does not establish a transaction limit.
3. Store the returned `paymentId` and `transactionId`. When `status=R` and `actionType=RedirectURL`, redirect the customer’s browser to `redirectUrl`. The response example “Redirect local payment response (illustrative)” shows this shape. For other actions or states, follow [Local payment integration](/payments/online-payments/payment-methods/local-payment-methods#handle-the-customer-action). Do not repeatedly create the same order while waiting.
4. The provider’s page guides the customer through payment. When the customer returns to your site, display the result retrieved from your server. See [Request signing](/payments/get-started/request-signing) for authentication.

### Checkout

If you offer only this method, first call [List Available Payment Methods](/payments/api-reference/endpoints/list-available-payment-methods) and check that it is returned for the current order. When Checkout displays all available methods, Onerway performs this filtering.

1. On your server, call [Create Checkout Payment](/payments/api-reference/endpoints/create-checkout-payment) with `productType=ALL`, `subProductType=DIRECT`, and `txnType=SALE`. To show only Dragonpay, set [`lpmsInfo.lpmsType`](/payments/api-reference/endpoints/create-checkout-payment#request-lpmsInfo) to `Dragonpay`, sending `lpmsInfo` as a JSON string. If you omit `lpmsInfo`, the customer chooses from the methods available for the order.
2. Supply billing, shipping, goods, return URL, and notification URL fields as required by the API. Both `billingInformation` and `shippingInformation` are JSON strings. Goods and order currencies must match, and goods amounts, discounts, and shipping charges must total `orderAmount`.<br />Select the request example **Unified Checkout with all available payment methods**. Replace its order and customer data, use PHP for this flow, and include the billing details listed above. Add this method's `lpmsInfo` if you want to show only Dragonpay. For this flow, remove the example’s `cardInfo` object and supply the customer’s actual billing first and last name. This prevents the example’s cardholder name from taking precedence over the billing name. The example demonstrates the shared Checkout request structure.
3. Select the response example **Unified Checkout session created**. Save the returned `paymentId` and `transactionId` against your order, then redirect the customer's browser to `redirectUrl`. The initial `status=U` means the payment is unpaid.
4. Checkout presents the payment page and guides the customer through the next steps. When the customer returns to `returnUrl`, display the order result obtained from your server. See [Checkout Integration](/payments/online-payments/checkout) for signing, redirects, and return handling.

## Customer steps and final result

The customer follows the instructions for the payment channel offered through Dragonpay, checks the payment details, and completes the required payment steps. These steps depend on the channel; do not assume that every Dragonpay payment is a cash payment or uses the same payment reference.

The customer may leave before completing payment. Receiving payment instructions or returning to your website does not establish that payment succeeded. Keep the order pending until your server obtains the result.

Process the verified [Payment Result notification](/payments/api-reference/webhooks/payment-result) on your server. If a notification is missing or the result needs checking, use the saved `paymentId` with [Query Payments](/payments/api-reference/endpoints/query-payments). Fulfil the order only after server-side confirmation of success. See [Webhooks](/payments/get-started/webhooks) for signature verification, acknowledgement, idempotency, and query fallback.

## Refunds and disputes

Confirm the refund capabilities, restrictions, and dispute process applicable to your merchant with Onerway. If refunds are enabled, follow [Refunds](/payments/online-payments/scenarios/refunds).

## Testing and go-live

Confirm the test environment and available Dragonpay test procedure with Onerway, then use [Sandbox Testing](/payments/get-started/testing) to verify:

1. Test each path you use with PHP and the customer details prepared above. For the Direct API, confirm that the returned redirect opens the provider’s payment page. For Checkout, confirm that the first `redirectUrl` opens Checkout and that Dragonpay is available before proceeding to the provider’s page.
2. Check that the customer name and payment details are correct and that the instructions match the payment channel offered through Dragonpay. Complete the agreed payment test, then confirm the result on your server. Receiving payment instructions alone does not pass payment acceptance.
3. Test leaving before payment, payment failure, and returning before the final result is known. Also test query fallback for a missing notification and idempotent handling of duplicate notifications.
4. During go-live acceptance, retain the notification and acknowledgement for the same order and query it once to check that the results agree. Verify production enablement, notification and return URLs, limits, and expiry. Test refunds separately if enabled.
