{"id":23420890,"url":"https://github.com/nericode/nativescript-mercadopago-px","last_synced_at":"2025-08-07T02:15:57.691Z","repository":{"id":38742400,"uuid":"193290748","full_name":"nericode/nativescript-mercadopago-px","owner":"nericode","description":"Mercado Pago's Official Android | iOS checkout library","archived":false,"fork":false,"pushed_at":"2023-03-03T01:29:32.000Z","size":3700,"stargazers_count":3,"open_issues_count":16,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-26T18:40:06.980Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nericode.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-23T00:24:13.000Z","updated_at":"2023-01-31T17:22:10.000Z","dependencies_parsed_at":"2024-12-25T19:31:36.996Z","dependency_job_id":null,"html_url":"https://github.com/nericode/nativescript-mercadopago-px","commit_stats":null,"previous_names":["nericodec/nativescript-mercadopago-px"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nericode/nativescript-mercadopago-px","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nericode%2Fnativescript-mercadopago-px","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nericode%2Fnativescript-mercadopago-px/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nericode%2Fnativescript-mercadopago-px/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nericode%2Fnativescript-mercadopago-px/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nericode","download_url":"https://codeload.github.com/nericode/nativescript-mercadopago-px/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nericode%2Fnativescript-mercadopago-px/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269185729,"owners_count":24374635,"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","status":"online","status_checked_at":"2025-08-07T02:00:09.698Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-23T02:13:05.325Z","updated_at":"2025-08-07T02:15:57.660Z","avatar_url":"https://github.com/nericode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mercadopago-px ![apple](https://cdn3.iconfinder.com/data/icons/picons-social/57/16-apple-32.png) ![android](https://cdn4.iconfinder.com/data/icons/logos-3/228/android-32.png)\n\nIntegration with [Mercado Pago checkout](https://www.mercadopago.com.ar/developers/es/guides/payments/web-payment-checkout/introduction/)\n\n## Support\n\nSupport Android \u0026 iOS.\n\n## Installation\n\n```javascript\ntns plugin add nativescript-mercadopago-px\n```\n\n## Usage\n\n```javascript\nthis.mercadopagoPx\n    .start({\n        language: \"es\",\n        publicKey: \"PUBLIC_KEY\",\n        preferenceId: \"PREFERENCE_ID\" // Get custom preference_if of side server.\n    })\n    .then(result =\u003e {\n        // Success payment\n    })\n    .catch(error =\u003e {\n        // Cancel payment or Error payment\n    });\n```\n\n### Vue\n\n```vue\n\u003ctemplate\u003e\n  \u003cPage class=\"page\"\u003e\n    \u003cActionBar class=\"action-bar\"\u003e\n        \u003cLabel class=\"action-bar-title\" text=\"Mercado Pago\"\u003e\u003c/Label\u003e\n    \u003c/ActionBar\u003e\n    \u003cStackLayout class=\"page\"\u003e\n      \u003cButton text=\"Generate preference\" @tap=\"generatePreference\" /\u003e\n      \u003cButton text=\"Checkout\" @tap=\"checkout\" /\u003e\n    \u003c/StackLayout\u003e\n  \u003c/Page\u003e\n\u003c/template\u003e\n```\n\n```javascript\nimport { MercadopagoPx } from \"nativescript-mercadopago-px\";\nexport default {\n    data() {\n      return {\n        accessToken: \"TEST-8479223465824183-062120-902fb3cb694af3cff10eb7271dbea60f-588489468\",\n        preferenceId: \"\",\n      }\n    },\n    methods: {\n      generatePreference(){\n        fetch(\"https://api.mercadolibre.com/checkout/preferences?access_token=\"+this.accessToken, {\n          method: 'POST',\n          headers:{\n            'Content-Type': 'application/json',\n            'cache-control': 'no-cache'\n          },\n          body: JSON.stringify({\n            \"items\": [\n              {\n                \"id\": \"12345\",\n                \"title\": \"My product\",\n                \"currency_id\": \"ARS\", // Required field\n                \"picture_url\": \"https://www.mercadopago.com/org-img/MP3/home/logomp3.gif\",\n                \"description\": \"Description of my product\",\n                \"category_id\": \"art\",\n                \"quantity\": 1,\n                \"unit_price\": 100\n              }\n            ],\n            \"payer\": {\n              \"email\": \"test_user_6523408@testuser.com\", // Required field\n            },\n          })\n        })\n        .then(response =\u003e {\n          response.json()\n          .then(resp =\u003e this.preferenceId = resp.id) // Save the preference to use it at checkout\n        })\n        .catch(error =\u003e console.log(\"Failed to generate preference\",error))\n      },\n      checkout() {\n        var mercadopagoPx = new MercadopagoPx();\n        mercadopagoPx.checkout({\n          language: \"es\",\n          publicKey: \"TEST-ebe497d7-3b86-4728-8f87-e5010231c8a0\",\n          preferenceId: this.preferenceId\n        })\n        .then(paymentInfo =\u003e console.log(\"Success payment =\u003e\", paymentInfo))\n        .catch(error =\u003e console.log(\"Cancel payment or Error payment =\u003e\", error));\n      },\n    }\n}\n```\n\n#### iOS\nIf you want to use the plugin with Angular or Vue + Javascript in iOS, you must add the following in your `app.js` or `main.js`\n\n### Angular\n\n```javascript\nimport * as app from \"tns-core-modules/application\";\n\ndeclare var UIResponder,\n    UIApplicationDelegate;\n\nif (app.ios) {\n    var appDelegate = UIResponder.extend(\n        {\n            get window() {\n                return this._window;\n            },\n            set window(aWindow) {\n                this._window = aWindow;\n            },\n        },\n        {\n            protocols: [UIApplicationDelegate],\n        }\n    );\n\n    app.ios.delegate = appDelegate;\n}\n\n...\n\n\nplatformNativeScriptDynamic().bootstrapModule(AppModule);\n```\n\n### Vue\n\n```javascript\nconst application = require(\"tns-core-modules/application\");\nif (application.ios) {\n  const MyDelegate = (function (_super) {\n      __extends(MyDelegate, _super);\n      function MyDelegate() {\n          _super.apply(this, arguments);\n      }\n      MyDelegate = UIResponder.extend(\n        {\n            get window() {\n                return this._window;\n            },\n            set window(aWindow) {\n                this._window = aWindow;\n            },\n        },\n        {\n            protocols: [UIApplicationDelegate],\n        }\n      );\n\n      MyDelegate.ObjCProtocols = [UIApplicationDelegate];\n      return MyDelegate;\n  })(UIResponder);\n\n  application.ios.delegate = MyDelegate;\n}\n```\n\n## License\n\nApache License Version 2.0, January 2004\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnericode%2Fnativescript-mercadopago-px","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnericode%2Fnativescript-mercadopago-px","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnericode%2Fnativescript-mercadopago-px/lists"}