POST Invoice Payment With Secure VPos

Merchants can make invoice collections with virtual pos by sending a POST request containing the following parameters to the "InvoicePaymentVpos" method. With this service, it is ensured that the customer enters the card information on the Mypayz Secure Payment page without the need for the card information to be received by the merchant.

Service Address: /invoices/InvoicePaymentSecureVPos

Request

Header
Parameter Name Parameter Type Description
ApiKey

Required

string Provided by the service provider.

For example; 3f0126be-*-*-**-06025352594a

SecretKey

Required

string Provided by the service provider.

For example ; 3f0126be-*-*-**-06025352594a

Body Parameter
Parameter Name Parameter Type Description
InvoiceQueryList

Required

List The “InvoiceQueryId” value returned in the invoice query operations. The list of invoice Ids to be paid should be provided.
CallbackUrl

Required

string The URL where the payment result will be sent after 3D verification.
CustomerInfo

Required

Class The parameter class where customer information will be provided.

InvoiceQueryList Details
Parameter Name Parameter Type Description
InvoiceQueryId

Required

integer The invoice query number for which the payment request is sent.
PartialAmount

Optional

int Partial Payment Amount. The value must be an integer (int) and should not exceed the invoice amount.
CustomerInfo Details
Parameter Name Parameter Type Description
Name string Customer name.
Email string Customer email address.
Phone string Customer phone number.
CitizenNo string Customer National Identification Number.
Request Sample
{
    "InvoiceQueryList": [
        {
            "InvoiceQueryId": 111111
        }
    ],
    "CallbackUrl": "https://example.com/TestPaymentReturnPage",
    "CustomerInfo": {
        "Name": "John Doe",
        "Email": "john.doe@example.com",
        "Phone": "5525525252",
        "CitizenNo": "22222221220"
    }
}  
                    

Response

Response Parameter
Parameter Name Parameter Type Description
Result boolean The result of the query, indicating whether it was successful or not.
ResultCode integer The code returned as the result of the query.
ResultMessage string The message returned as the result of the query, providing details about the result.
VPosPaymentData class The data class containing the virtual POS payment details.

VPosPaymentData Details
Parameter Name Parameter Type Description
PaymentUrl string The URL for redirecting to the 3D payment page.
InvoiceAmount decimal The total invoice amount, including commissions.
PayofinCommission decimal The commission amount taken by Payofin.
MerchantCommission decimal The commission amount taken by the Merchant.
SubTotalAmount decimal The total amount including invoice, Merchant commission, and Payofin commission.
CardCommission decimal The card commission amount.
AmountToBePaid decimal The total amount to be paid by card.
Response Sample
{
    "vPosPaymentData": {
        "paymentUrl": "https://localhost:44305/tr/payment-methods-a1ZtR3E3OWR1bUVSSjJjOFFURXlLUT09",
        "invoiceAmount": 79.00,
        "payofinCommission": 1.00,
        "merchantCommission": 1.00,
        "subTotalAmount": 81.00,
        "cardCommission": 1.01,
        "amountToBePaid": 82.01
    },
    "result": true,
    "resultCode": 1,
    "resultMessage": "İşlem Başarılı"
}
                    

Callback Parameters

After 3D verification is completed, the following parameters will be sent via form post to the address specified in the "CallbackUrl" parameter.

Callback Parameters
Parameter Name Parameter Type Description
Result boolean Indicates whether the payment transaction was successful. true for success, false for failure.
ResultCode integer The code returned as a result of the transaction. This code is used to determine the status of the transaction.
ResultMessage string The message returned as a result of the transaction, providing details about the transaction.
PaymentDetails string (JSON) A JSON string containing the details of the invoices and transaction collected. Includes details for each invoice.
Token string The token information created for the transaction, used to ensure security.
PosTransactionId string The virtual POS transaction ID used for the payment.
Balance decimal The remaining available balance after the collection process is completed.

PaymentDetails JSON Array
Parameter Name Parameter Type Description
InvoiceQueryId integer The invoice query number for which the payment request is sent.
InvoicePaymentId integer The collection ID created as a result of the invoice payment transaction.
PaymentDate string The date and time the payment transaction was completed. Format: dd.MM.yyyy HH:mm:ss
AmountPaid decimal The total amount paid, including the invoice amount, commissions, and any additional fees.
CardCommission decimal The card commission amount.
InvoiceAmount decimal The original invoice amount, excluding commissions.
MerchantCommission decimal The commission amount taken by the Merchant.
PayofinCommission decimal The commission amount taken by Payofin.
Form Post Example
    <form name="PostForm" method="POST" action="https://callback-url.com">
        <input type="hidden" name="Result" value="true">
        <input type="hidden" name="ResultCode" value="1">
        <input type="hidden" name="ResultMessage" value="Transaction Successful ">
        <input type="hidden" name="PaymentDetails" value='[
            {
                "InvoiceQueryId": 111111,
                "InvoicePaymentId": 123456,
                "PaymentDate": "04.01.2023 15:13:43",
                "AmountPaid": 82.01,
                "CardCommission": 1.01,
                "InvoiceAmount": 79.00,
                "MerchantCommission": 1.00,
                "PayofinCommission": 1.00
            },
            {
                "InvoiceQueryId": 111111,
                "InvoicePaymentId": 123456,
                "PaymentDate": "04.01.2023 15:13:43",
                "AmountPaid": 82.01,
                "CardCommission": 1.01,
                "InvoiceAmount": 79.00,
                "MerchantCommission": 1.00,
                "PayofinCommission": 1.00
            }
        ]'>
        <input type="hidden" name="Token" value="93cb6bfe737331a6de86c17cf4218a9adee12397d9d24f1b451bc6b17f301d71">
        <input type="hidden" name="PosTransactionId" value="TX123456789">
        <input type="hidden" name="Balance" value="18.99">
    </form>