webhooks_requests.rb 2.29 KB
module WebHookPostRequest
  CARD_CHARGE_CREATED = { "data": { "object": { "id": '5511d4ce2412294cf6000081', "livemode": false, "created_at": 1_427_231_950, "status": 'pending_payment', "currency": 'MXN', "description": 'Stogies', "reference_id": '9839-wolf_pack', "failure_code": nil, "failure_message": nil, "monthly_installments": nil, "object": 'charge', "amount": 20_000, "paid_at": nil, "fee": 963, "customer_id": '', "refunds": [], "payment_method": { "name": 'Jorge Lopez', "exp_month": '12', "exp_year": '19', "auth_code": nil, "object": 'card_payment', "last4": '4242', "brand": 'visa' }, "details": { "name": nil, "phone": nil, "email": nil, "line_items": [] } }, "previous_attributes": {} }, "livemode": false, "webhook_status": 'pending', "id": '5511d4ce2412294cf6000084', "object": 'event', "type": 'charge.created', "created_at": 1_427_231_950, "webhook_logs": [{ "id": 'webhl_nPzGMBeQmMUu7aQ', "url": 'http://requestb.in/1em0jsx1', "failed_attempts": 0, "last_http_response_status": -1, "object": 'webhook_log', "last_attempted_at": 0 }] }
 OXXO_CHARGE_CREATED = {
   "data": {
     "object": {
       "id":"5514803f241229981e0022e6", "livemode":false,
       "created_at":1427406911, "status":"pending_payment", "currency":"MXN",
       "description":"Stogies", "reference_id":"9839-wolf_pack",
       "failure_code":nil, "failure_message":nil, "monthly_installments":nil,
       "object":"charge", "amount":20000, "paid_at":nil, "fee":812,
       "customer_id":"", "refunds":[], "payment_method": {
         "barcode":"38100000000042290121213001160013",
         "barcode_url":"http://s3.amazonaws.com/cash_payment_barcodes/" +
                       "38100000000042290121213001160013.png",
         "object":"cash_payment", "type":"oxxo", "expires_at":1430006400,
         "store_name":"OXXO"
       }, "details": {
         "name":"Wolverine", "phone":"403-342-0642", "email":"logan@x-men.org",
         "line_items":[]
       }
     }, "previous_attributes":{}}, "livemode":false, "webhook_status":"pending",
   "id":"5514803f241229981e0022e9", "object":"event", "type":"charge.created",
   "created_at":1427406911, "webhook_logs":[
     {"id":"webhl_PBmYvkfdNDYKezJ", "url":"http://requestb.in/u3n4ywu3",
      "failed_attempts":0, "last_http_response_status":-1,
      "object":"webhook_log", "last_attempted_at":0}]} 
end