# MD for: https://www.mercadopago.com.ar/developers/pt/docs/checkout-api-payments/integration-configuration/other-payment-methods.md \# Other payment methods With Mercado Pago's Checkout API, it is also possible to offer payments with \*\*Rapipago\*\* and/or \*\*Pago Fácil\*\*. > NOTE > > Important > > In addition to the options available in this documentation, it is also possible to integrate \*\*other payment methods\*\* using the \*\*Payment Brick\*\*. Check \[Default rendering\](https://www.mercadopago.com.ar/developers/en/docs/checkout-bricks/payment-brick/default-rendering#editor\_2) documentation of Payment for more details. To get a detailed list of all payment methods available for integration, send a \*\*GET\*\* with your \*\*Access token\*\* to the endpoint \[/v1/payment\_methods\](https://www.mercadopago.com.ar/developers/en/reference/online-payments/checkout-api-payments/payment-methods/get) and run the request or, if you prefer, make the request using the SDKs below. * [csharp ](#editor%5F5) * [curl ](#editor%5F7) * [java ](#editor%5F3) * [node ](#editor%5F2) * [php ](#editor%5F1) * [python ](#editor%5F6) * [ruby ](#editor%5F4) php node java ruby csharp python curl ``` get(); ?> ``` Copiar ``` import { MercadoPagoConfig, PaymentMethods } from 'mercadopago'; const client = new MercadoPagoConfig({ accessToken: 'access_token' }); const paymentMethods = new PaymentMethods(client); paymentMethods.get().then((result) => console.log(result)) .catch((error) => console.log(error)); ``` Copiar ``` MercadoPagoConfig.setAccessToken("ENV_ACCESS_TOKEN"); PaymentMethodClient client = new PaymentMethodClient(); client.list(); ``` Copiar ``` require 'mercadopago' sdk = Mercadopago::SDK.new('ENV_ACCESS_TOKEN') payment_methods_response = sdk.payment_methods.get() payment_methods = payment_methods_response[:response] ``` Copiar ``` using MercadoPago.Client.PaymentMethod; using MercadoPago.Config; using MercadoPago.Resource; using MercadoPago.Resource.PaymentMethod; MercadoPagoConfig.AccessToken = "ENV_ACCESS_TOKEN"; var client = new PaymentMethodClient(); ResourcesList paymentMethods = await client.ListAsync(); ``` Copiar ``` import mercadopago sdk = mercadopago.SDK("ACCESS_TOKEN") payment_methods_response = sdk.payment_methods().list_all() payment_methods = payment_methods_response["response"] ``` Copiar ``` curl -X GET \ -H 'accept: application/json' \ -H 'content-type: application/json' \ -H 'Authorization: Bearer ENV_ACCESS_TOKEN' \ 'https://api.mercadopago.com/v1/payment_methods' \ ``` Copiar To offer \*\*Rapipago\*\* and/or \*\*Pago Fácil\*\* payments, follow the steps below. ## Import MercadoPago.js To perform the Checkout API integration, you need to capture the necessary data to process the payment. This capture is made by including the MercadoPago.js library in your project, followed by the payment form. Use the code below to import the library before adding the payment form. * [bash ](#editor%5F9) * [html ](#editor%5F8) html bash ``` ``` Copiar ``` npm install @mercadopago/sdk-js ``` Copiar \## Configure credentials Credentials are unique passwords with which we identify an integration in your account. They are made to capture payments in virtual stores and other applications securely. This is the first step of a complete code structure that must be followed for the correct integration of the payment flow. Pay attention to the blocks below to add to the codes as indicated. * [html ](#editor%5F10) * [javascript ](#editor%5F11) html javascript ``` ``` Copiar ``` import { loadMercadoPago } from "@mercadopago/sdk-js"; await loadMercadoPago(); const mp = new window.MercadoPago("YOUR_PUBLIC_KEY"); ``` Copiar \## Add payment form With the MercadoPago.js library included, add the payment form below to your project to ensure the secure capture of buyer data. In this step, it is important to use the list you consulted to obtain the available payment methods to create the payment options you want to offer. * [html ](#editor%5F12) html ```

``` Copiar \## Get document types After configuring the credential, it is necessary to obtain the types of documents that will be part of filling out the payment form. By including the element of type \`select\` with the id: \`id = docType\` that is on the form, it will be possible to automatically fill in the available options when calling the following function: * [javascript ](#editor%5F13) javascript ``` (async function getIdentificationTypes() { try { const identificationTypes = await mp.getIdentificationTypes(); const identificationTypeElement = document.getElementById('form-checkout__identificationType'); createSelectOptions(identificationTypeElement, identificationTypes); } catch (e) { return console.error('Error getting identificationTypes: ', e); } })(); function createSelectOptions(elem, options, labelsAndKeys = { label: "name", value: "id" }) { const { label, value } = labelsAndKeys; elem.options.length = 0; const tempOptions = document.createDocumentFragment(); options.forEach(option => { const optValue = option[value]; const optLabel = option[label]; const opt = document.createElement('option'); opt.value = optValue; opt.textContent = optLabel; tempOptions.appendChild(opt); }); elem.appendChild(tempOptions); } ``` Copiar \## Send payment When finalizing the inclusion of the payment form and obtaining the types of documents, it is necessary to forward the buyer's email, type and document number, the payment method used and the details of the amount to be paid using our Payments API or one of our SDKs. To configure payments with \*\*Rapipago\*\* and/or \*\*Pago Fácil\*\*, send a \*\*POST\*\* with the required parameters to the endpoint \[/v1/payments\](https://www.mercadopago.com.ar/developers/en/reference/online-payments/checkout-api-payments/create-payment/post) and execute the request or, if you prefer, use one of our SDKs below. > WARNING > > Attention > > For this step, when making the request via API or SDKs, it is necessary to send your Private Key - Access token. For more information, go to \[Credentials\](https://www.mercadopago.com.ar/developers/en/docs/checkout-api-payments/additional-content/your-integrations/credentials). In addition, sending the header \`X-Idempotency-Key\` with your idempotency key will be requested to ensure the execution and reexecution of requests without undesirable situations, such as duplicate payments, for example. * [csharp ](#editor%5F17) * [curl ](#editor%5F20) * [go ](#editor%5F19) * [java ](#editor%5F16) * [node ](#editor%5F15) * [php ](#editor%5F14) * [python ](#editor%5F18) php node java csharp python go curl ``` setCustomHeaders(["X-Idempotency-Key: "]); $payment = $client->create([ "transaction_amount" => (float) $_POST[''], "payment_method_id" => $_POST[''], "payer" => [ "email" => $_POST[''] ] ], $request_options); echo implode($payment); ?> ``` Copiar ``` import { MercadoPagoConfig, Payments } from 'mercadopago'; const client = new MercadoPagoConfig({ accessToken: '' }); const payments = new Payments(client); payments.create({ body: { transaction_amount: '', payment_method_id: '', payer: { email: '' } }, requestOptions: { idempotencyKey: '' } }) .then((result) => console.log(result)) .catch((error) => console.log(error)); ``` Copiar ``` PaymentCreateRequest paymentCreateRequest = PaymentCreateRequest.builder() .transactionAmount(new BigDecimal("")) .paymentMethodId("") .payer( PaymentPayerRequest.builder() .email("").build() ).build(); Map customHeaders = new HashMap<>(); customHeaders.put("x-idempotency-key", ""); MPRequestOptions requestOptions = MPRequestOptions.builder() .customHeaders(customHeaders).build(); PaymentClient client = new PaymentClient(); client.create(paymentCreateRequest, requestOptions); ``` Copiar ``` using MercadoPago.Config; using MercadoPago.Client.Payment; using MercadoPago.Resource.Payment; MercadoPagoConfig.AccessToken = "ENV_ACCESS_TOKEN"; var request = new PaymentCreateRequest { TransactionAmount = 100, Description = "Product Title", PaymentMethodId = "rapipago", Payer = new PaymentPayerRequest { Email = "test@testuser.com", }, }; var client = new PaymentClient(); Payment payment = await client.CreateAsync(request); ``` Copiar ``` import market sdk = Mercadopago.SDK("ENV_ACCESS_TOKEN") payment_data = { "transaction_amount": 100, "description": "Product title", "payment_method_id": "rapipago", "payer": { "email": "test@testuser.com" } } payment_response = sdk.payment().create(payment_data) payment = payment_response["response"] ``` Copiar ``` accessToken := "{{ACCESS_TOKEN}}" cfg, err := config.New(accessToken) if err != nil { fmt.Println(err) return } client := paymentmethod.NewClient(cfg) resources, err := client.List(context.Background()) if err != nil { fmt.Println(err) return } for _, v := range resources { fmt.Println(v) } ``` Copiar ``` curl --location 'https://api.mercadopago.com/v1/payments' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ENV_ACCESS_TOKEN' \ --header 'X-Idempotency-Key: ' \ --data-raw '{ "transaction_amount": 100, "description": "Titulo del producto", "payment_method_id": "rapipago", "payer": { "email": "test@testuser.com" } }' ``` Copiar The response will show the \*\*pending status\*\* until the buyer completes the payment. Also, in the response to the request, the \`external\_resource\_url\` parameter will return a URL that contains instructions for the buyer to make the payment. You can redirect to this same link to complete the payment flow. \`\`\`json \[ { ..., "id": 5466310457, "status": "pending", "status\_detail": "pending\_waiting\_payment", ..., "transaction\_details": { "net\_received\_amount": 0, "total\_paid\_amount": 100, "overpaid\_amount": 0, "external\_resource\_url": "https://www.mercadopago.com/mla/payments/ticket/helper?payment\_id=123456789&payment\_method\_reference\_id= 123456789&caller\_id=123456", "installment\_amount": 0, "financial\_institution": null, "payment\_method\_reference\_id": "1234567890" } } \] \`\`\` ## Expiration date It is possible to change the expiration date for cash payments by submitting the \`date\_of\_expiration\` field in the payment creation request. The configured date must be between 1 and 30 days from the date the payment is issued. To change the expiration date, use one of the codes available below. * [csharp ](#editor%5F25) * [curl ](#editor%5F27) * [java ](#editor%5F23) * [node ](#editor%5F22) * [php ](#editor%5F21) * [python ](#editor%5F26) * [ruby ](#editor%5F24) php node java ruby csharp python curl The date uses the ISO 8601 format: yyyy-MM-dd'T'HH:mm:ssz ``` $payment->date_of_expiration = "2020-05-30T23:59:59.000-04:00"; ``` Copiar The date uses the ISO 8601 format: yyyy-MM-dd'T'HH:mm:ssz ``` date_of_expiration: "2020-05-30T23:59:59.000-04:00", ``` Copiar The date uses the ISO 8601 format: yyyy-MM-dd'T'HH:mm:ssz ``` payment.setDateOfExpiration("2020-05-30T23:59:59.000-04:00") ``` Copiar The date uses the ISO 8601 format: yyyy-MM-dd'T'HH:mm:ssz ``` date_of_expiration: '2020-05-30T23:59:59.000-04:00', ``` Copiar The date uses the ISO 8601 format: yyyy-MM-dd'T'HH:mm:ssz ``` paymentCreateRequest.DateOfExpiration = DateTime.Parse("2020-05-30T23:59:59.000-04:00"); ``` Copiar The date uses the ISO 8601 format: yyyy-MM-dd'T'HH:mm:ssz ``` "date_of_expiration": "2020-05-30T23:59:59.000-04:00" ``` Copiar The date uses the ISO 8601 format: yyyy-MM-dd'T'HH:mm:ssz ``` "date_of_expiration": "2020-05-30T23:59:59.000-04:00", ``` Copiar The crediting period is up to 2 business hours according to the payment method. That's why we recommend that you set the expiration date to a minimum of 3 days to ensure the payment to be made. > WARNING > > Important > > If the payment is made after the expiration date, the amount will be refunded to the payer's Mercado Pago account. ## Cancel payment To avoid billing issues, it is important to cancel overdue payments. Also, keep in mind that \*\*it is possible to cancel only payments that are pending or in process\*\*. If a payment expires within 30 days, the cancellation is automatic and the final status of the payment will be \`cancelled\` or \`expired\`. For more information, see the \[Refunds and Cancellations\](https://www.mercadopago.com.ar/developers/en/docs/checkout-api-payments/payment-management/cancellations-and-refunds) section.