Closed hostelix closed 4 years ago
Add new changes
1) Using factory
``` var mp = MP.fromAccessToken('MYACCESSTOKEN'); var preference = { "items": [ { "title": "Test", "quantity": 1, "currency_id": "USD", "unit_price": 10.4 } ] }; var result = await mp.createPreference(preference);```
2) Using method
``` var mp = MP("CLIENT_ID", "CLIENT_SECRET"); var preference = { "items": [ { "title": "Test", "quantity": 1, "currency_id": "USD", "unit_price": 10.4 } ] }; // Change access token
mp.setAccessToken('MYACCESSTOKEN'); var result = await mp.createPreference(preference);```
Add new changes
1) Using factory
2) Using method
mp.setAccessToken('MYACCESSTOKEN'); var result = await mp.createPreference(preference);```