{"id":3457,"date":"2021-03-09T21:22:20","date_gmt":"2021-03-09T21:22:20","guid":{"rendered":"https:\/\/documents.openpay.mx\/?p=3457"},"modified":"2024-03-20T15:44:32","modified_gmt":"2024-03-20T15:44:32","slug":"bank-charge","status":"publish","type":"post","link":"https:\/\/documents-mx-dev.opdevhm.com\/en\/docs\/bank-charge.html","title":{"rendered":"Banks payments"},"content":{"rendered":"
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

The purpouse of this guide is to explain how to generate references for bank payments step by step. With them, your customers will be able to pay transactions through a CIE Bancomer agreement number, or sending a payment through SPEI for other banks.<\/p>\n

How a bank payment is accepted<\/h3>\n

<\/p>

\"How<\/center>Steps:

<\/p>\n

    \n
  1. The customer confirms the sale in your website, selecting Bank transfer as a payment method<\/li>\n
  2. Send a bank charge request to Openpay<\/li>\n
  3. Create a payment order for your customer with the returned information<\/li>\n
  4. The customer makes the payment through their bank website.<\/li>\n
  5. Openpay receives and validates the payment<\/li>\n
  6. Openpay notifies the payment to your server<\/li>\n<\/ol>\n

    This tutorial you can see steps 2 and 3, for step 6 details please check notifications section<\/a><\/p>\n

    Create a charge (Step 2)<\/h2>\n

    In order to receive a payment through a bank you need to create a charge indicating the type of method<\/code> el tipo bank_account<\/code> as follows:<\/p>\n

    \n
    \n
    <? <\/span>\n$openpay<\/span> =<\/span> Openpay<\/span>::<\/span>getInstance<\/span>(<\/span>'mzdtln0bmtms6o3kck8f'<\/span>,<\/span>\n  'sk_e568c42a6c384b7ab02cd47d2e407cab'<\/span>);<\/span>\n\n$chargeData<\/span> =<\/span> array<\/span><\/strong>(<\/span>\n    'method'<\/span> =><\/span> 'bank_account'<\/span>,<\/span>\n    'amount'<\/span> =><\/span> 200.00<\/span>,<\/span>\n    'description'<\/span> =><\/span> 'Cargo con banco'<\/span>,<\/span>\n    'order_id'<\/span> =><\/span> 'oid-00051'<\/span>);<\/span>\n\n$charge<\/span> =<\/span> $openpay<\/span>-><\/span>charges<\/span>-><\/span>create<\/span>(<\/span>$chargeData<\/span>);<\/span>\n?><\/span><\/code><\/pre>\n<\/figure>\n<\/div>\n

    When the charge is created, a transaction object will be returned.<\/p>\n

    Response:<\/strong><\/p>\n

    \n
    {<\/span>\n  \"id\"<\/span> :<\/span> \"t6utz9dywve6zipnppys\"<\/span>,<\/span>\n  \"description\"<\/span> :<\/span> \"Cargo con banco\"<\/span>,<\/span>\n  \"error_message\"<\/span> :<\/span> null<\/span><\/strong>,<\/span>\n  \"authorization\"<\/span> :<\/span> null<\/span><\/strong>,<\/span>\n  \"amount\"<\/span> :<\/span> 100<\/span>,<\/span>\n  \"operation_type\"<\/span> :<\/span> \"in\"<\/span>,<\/span>\n  \"payment_method\"<\/span> :<\/span> {<\/span>\n    \"type\"<\/span> :<\/span> \"bank_transfer\"<\/span>,<\/span>\n    \"bank\"<\/span> :<\/span> \"BBVA Bancomer\"<\/span>,<\/span>\n    \"agreement\"<\/span> :<\/span> \"1411217\"<\/span>,<\/span>\n    \"clabe\"<\/span> :<\/span> \"00000000000000000000\"<\/span>,<\/span>\n    \"name\"<\/span> :<\/span> \"11094690394055678934\"<\/span>\n  },<\/span>\n  \"order_id\"<\/span> :<\/span> \"oid-00051\"<\/span>,<\/span>\n  \"transaction_type\"<\/span> :<\/span> \"charge\"<\/span>,<\/span>\n  \"creation_date\"<\/span> :<\/span> \"2013-12-05T17:50:09-06:00\"<\/span>,<\/span>\n  \"currency\"<\/span> :<\/span> \"MXN\"<\/span>,<\/span>\n  \"status\"<\/span> :<\/span> \"in_progress\"<\/span>,<\/span>\n  \"method\"<\/span> :<\/span> \"bank_account\"<\/span>\n}<\/span><\/code><\/pre>\n<\/figure>\n

    For more information see the charges reference<\/a><\/p>\n

    Creating a deposit slip (Step 3)<\/h2>\n

    It\u2019s very important that you generate a payment receipt with the following information, so that your customer can make the transfer successfully:<\/p>\n

      \n
    1. Company name<\/strong><\/li>\n<\/ol>\n

    Con est\u00e1 informaci\u00f3n puedes generar una ficha de dep\u00f3sito a tu cliente para que realice un pago a un servicio CIE Bancomer o mediante una transferencia interbancaria v\u00eda SPEI<\/a>.<\/p>\n