{"id":22432158,"url":"https://github.com/normalhuman01/flow-webpay","last_synced_at":"2025-03-27T07:41:36.378Z","repository":{"id":213181433,"uuid":"733250222","full_name":"normalhuman01/flow-webpay","owner":"normalhuman01","description":"Flow Chile payments (webpay) for meteor","archived":false,"fork":false,"pushed_at":"2023-12-18T23:30:28.000Z","size":410,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T12:45:27.929Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/normalhuman01.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-18T22:46:49.000Z","updated_at":"2023-12-18T22:47:29.000Z","dependencies_parsed_at":"2023-12-19T05:30:54.858Z","dependency_job_id":"9be8b6ab-2827-4166-a0b6-052d00b626bd","html_url":"https://github.com/normalhuman01/flow-webpay","commit_stats":null,"previous_names":["normalhuman01/flow-webpay"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/normalhuman01%2Fflow-webpay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/normalhuman01%2Fflow-webpay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/normalhuman01%2Fflow-webpay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/normalhuman01%2Fflow-webpay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/normalhuman01","download_url":"https://codeload.github.com/normalhuman01/flow-webpay/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245805999,"owners_count":20675291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-05T22:10:47.162Z","updated_at":"2025-03-27T07:41:36.356Z","avatar_url":"https://github.com/normalhuman01.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flow Meteor\n\nFlow es una plataforma de pagos que te permite realizar pagos vía webpay.\n\n## Instrucciones\n\n```sh\nmeteor add nicolaslopezj:flow\n```\n\n### Obtener key\n\nPara obtener la key debes entrar a https://www.flow.cl/app/web/misDatos.php y\nhacer click en el boton descargar certificado.\n\nPara el ambiente de pruebas debes entrar a http://flow.tuxpan.com/app/web/misDatos.php y\nhacer click en el boton descargar certificado.\n\n### Configurar\n\n```js\nimport {setConfig} from 'meteor/nicolaslopezj:flow';\n\nsetConfig({\n  baseUrl: 'http://myapp.com/',\n  successUrl: 'http://myapp.com/success',\n  failureUrl: 'http://myapp.com/failure',\n  key: Assets.getText('comercio.pem'),\n  publicKey: Assets.getText('flow.pubkey'),\n  email: 'myemail@mail.com',\n  confirm: myConfirmFunction,\n  paymentTypes: 1,\n});\n```\n\n- **baseUrl**: La url del sitio web. Se necesita para que flow confirme el pago.\nEn caso de estar en ambiente local, hay abrir los puertos desde el router y poner\nla ip publica. Ej: ```http://190.161.223.246:3000```.\n\n- **successUrl**: Url donde va a llegar el usuario cuando el pago se realice\ncorrectamente.\n\n- **failureUrl**: Url donde va a llegar el usuario cuando el pago tenga algun error.\n\n- **key**: La privada llave que entrega flow a cada comercio. Si la guardas en la\ncarpeta ```private``` de la app puedes usar ```Assets.getText('comercio.pem')```\npara obtenerla.\n\n- **publicKey**: La privada publica de Flow.\n\n```\n-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAx0BVTE0HmmtEDfKydMLF\nYrfRsQPY6B8fYeNtl76GHLZyhSl3+MzYKdic9oJbvDm2Co9x6zNgUEzEA1RmjZ9H\nyVS5mJEj0VRM2Ydx2kfG33bjmwsWSoasPNnCeIvApYZWRVsKICIVrH5wUqky3Jku\n4grLynflGO0rYYC+mOcqbr+9/tJ/bDX0fFcNFHNz1xRcca32A/jZXd2N4W80vPrD\nuUqy5uqaQEIX65EP1y/wmNaM6nK8WprgkX1Qi5xeN7ikaDEROiYLbZedz+FxqBOL\nnvETvFAmDWFjQeb0+ppDoA3dZPW7oebnyLALGSJVmia+Ig3OsKFmf6F67ygN+4R/\ngJESLyS92kvGpbJGSc130FKt2wmLhO0YmFNzNF4s01hHgigVuVG6OqNdYCtvNbQH\ntIcBnUOUyma3Z0zKAH3lPW4nOljM9uNihG32UNlGeV9d/UmjqvVvLy5MbeEEsEw2\nLqXH9cGZVjDxt+Qq5y2Mw2/v0E9v+7CyTkUxhU6iY0xXSpajFnoIAQpCY/NhPGQu\nN9cFJxGY1EB7cVp8nZzZIWo7u9lsoEDqG93ugmqA/mFSsevn0qUTJinSbbxjiXyo\n1hU4TLtGY9myYeljO5uoLn1Kps5950U/tilNh8LJALwVniJuO+E+CeQgLuD/lNAv\nvlOeisrct5CChy8/+tfL5fcCAwEAAQ==\n-----END PUBLIC KEY-----\n```\n\n- **email**: El email de la cuenta de flow.\n\n- **confirm**: Una función que se llamará para que la aplicación verifique que el\npago esta correcto. Debe retornar ```true``` para que el pago se apruebe, si retorna\nun string, este sera el mensaje de error.\n\n- **paymentTypes**: Ingrese aquí el medio de pago, Solo Webpay = 1, Solo\nServipag = 2, Todos los medios de pago = 9;\n\n### Crear nuevos pagos\n\nhttps://github.com/nicolaslopezj/flow/tree/master/client/home\n\n```js\nimport {newOrder} from 'meteor/nicolaslopezj:flow';\n\nMeteor.methods({\n  createOrder: function ({ amount, description, buyerEmail }) {\n    const order = newOrder({\n      amount,\n      description,\n      buyerEmail,\n      paymentType: 1,\n      successUrl: 'success',\n      failureUrl: 'failure',\n      meta: {\n        productId: 'myProductId',\n      },\n    });\n\n    console.log('New payment generated', order.paymentId);\n    return order.pack;\n  },\n});\n```\n\n### Confirmar pagos\n\n```js\n/**\n * El monto ya fue verificado al llamar esta funcion\n */\nexport default confirm = function (payment) {\n  console.log('confirming payment', payment);\n\n  // payment.meta.paymentId\n\n  //return 'No products lefts';\n  return true;\n};\n```\n\n### Ejemplo\n\nEste proyecto esta dentro de una aplicacion meteor que puedes usar para probar.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnormalhuman01%2Fflow-webpay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnormalhuman01%2Fflow-webpay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnormalhuman01%2Fflow-webpay/lists"}