Skip to content

Instantly share code, notes, and snippets.

@rvacoder
Last active August 29, 2015 13:56
Show Gist options
  • Save rvacoder/9139534 to your computer and use it in GitHub Desktop.
Save rvacoder/9139534 to your computer and use it in GitHub Desktop.
Servicio de Account para PubNub y AngularJS
Se requiere hacer un login para activar pubnub (cualquier usuario y contraseña)
Para enviar un mensaje al SPA
http://www.pubnub.com/console/
channel: my_channel_anzen666_common
subscribe_key: sub-c-74d472c2-894a-11e3-a56b-02ee2ddab7fe
publish_key: pub-c-d49c709c-8d0c-40ed-aaa6-66cbc20683d0
enviar el json (se actualizaron varios campos para que concuerden con el api de heroku)
{
"messageType": "transaction",
"user": {
"bankID": "1",
"login": "testlogin"
},
"transaction": {
"_transaction_id": "511",
"origin": null,
"target": null,
"created_at": 1388880000000,
"amount": 500,
"exchange_currency": null,
"exchange_rate": null,
"location": {
"coordinates": {
"lat": "19.440832138061523",
"lng": "-99.18499755859375"
},
"zip": null,
"state": null,
"city": null,
"address": null,
"name": null
},
"folio": 12345,
"type": "ATM",
"description": "Retiro de efectivo",
"reference": 12345,
"rfc": null
},
"account": {
"_account_id": 50001,
"account_type": "SAVINGS",
"name": "Cuenta de ahorro",
"alias": "Mi Cuenta de Ahorro",
"currency": "MXN",
"balance": {
"current": 666,
"created_at": 1394038895737,
"deposits": 30000,
"payments": 2500,
"withdrawals": 2500,
"from": 1394038895737
},
"image": {
"large": "http: //abanking.s3.amazon.com/9872348.jpg",
"retina": "http: //abanking.s3.amazon.com/9872348.jpg",
"thumbnail": "http: //abanking.s3.amazon.com/9872348.jpg",
"icon": "http: //abanking.s3.amazon.com/9872348.jpg"
},
"last_digits": "348"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment