Skip to content

Releases: bottenderjs/messaging-apis

0.7.12 / 2018-10-23

23 Oct 03:03
Compare
Choose a tag to compare

messaging-api-line

  • [new] Add Line Pay APIs:

Initialize

const { LinePay } = require('messaging-api-line');

const linePay = LinePay.connect({
  channelId: CHANNEL_ID,
  channelSecret: CHANNEL_SECRET,
  sandbox: true, // default false
});
  • getPayments(options):
linePay
  .getPayments({
    transactionId: '20140101123123123',
    orderId: '1002045572',
  })
  .then(result => {
    console.log(result);
    // [
    //   {
    //     transactionId: 1020140728100001997,
    //     transactionDate: '2014-07-28T09:48:43Z',
    //     transactionType: 'PARTIAL_REFUND',
    //     amount: -5,
    //     productName: '',
    //     currency: 'USD',
    //     orderId: '20140101123123123',
    //     originalTransactionId: 1020140728100001999,
    //   },
    // ]
  });
  • getAuthorizations(options):
linePay
  .getAuthorizations({
    transactionId: '20140101123123123',
    orderId: '1002045572',
  })
  .then(result => {
    console.log(result);
    // [
    //   {
    //     transactionId: 201612312312333401,
    //     transactionDate: '2014-07-28T09:48:43Z',
    //     transactionType: 'PAYMENT',
    //     payInfo: [
    //       {
    //         method: 'BALANCE',
    //         amount: 10,
    //       },
    //       {
    //         method: 'DISCOUNT',
    //         amount: 10,
    //       },
    //     ],

    //     productName: 'tes production',
    //     currency: 'USD',
    //     orderId: '20140101123123123',
    //     payStatus: 'AUTHORIZATION',
    //     authorizationExpireDate: '2014-07-28T09:48:43Z',
    //   },
    // ]
  });
  • reserve(payment):
linePay
  .reserve({
    productName: 'test product',
    amount: 10,
    currency: 'USD',
    orderId: '20140101123456789',
    confirmUrl:
      'naversearchapp://inappbrowser?url=http%3A%2F%2FtestMall.com%2FcheckResult.nhn%3ForderId%3D20140101123456789',
  })
  .then(result => {
    console.log(result);
    // {
    //   transactionId: 123123123123,
    //   paymentUrl: {
    //     web: 'http://web-pay.line.me/web/wait?transactionReserveId=blahblah',
    //     app: 'line://pay/payment/blahblah',
    //   },
    //   paymentAccessToken: '187568751124',
    // }
  });
  • confirm(transactionId, payment):
linePay
  .confirm(TRANSACTION_ID, {
    amount: 1000,
    currency: 'TWD',
  })
  .then(result => {
    console.log(result);
    // {
    //   orderId: 'order_210124213',
    //   transactionId: 20140101123123123,
    //   payInfo: [
    //     {
    //       method: 'BALANCE',
    //       amount: 10,
    //     },
    //     {
    //       method: 'DISCOUNT',
    //       amount: 10,
    //     },
    //   ],
    // }
  });
  • capture(transactionId, payment):
linePay
  .capture(TRANSACTION_ID, {
    amount: 1000,
    currency: 'TWD',
  })
  .then(result => {
    console.log(result);
    // {
    //   transactionId: 20140101123123123,
    //   orderId: 'order_210124213',
    //   payInfo: [
    //     {
    //       method: 'BALANCE',
    //       amount: 10,
    //     },
    //     {
    //       method: 'DISCOUNT',
    //       amount: 10,
    //     },
    //   ],
    // }
  });
  • void(transactionId):
linePay.void(TRANSACTION_ID);
  • refund(transactionId, options):
linePay.refund(TRANSACTION_ID).then(result => {
  console.log(result);
  // {
  //   refundTransactionId: 123123123123,
  //   refundTransactionDate: '2014-01-01T06:17:41Z',
  // }
});

0.7.11 / 2018-10-17

17 Oct 14:52
Compare
Choose a tag to compare

messaging-api-line

  • [fix] fix LINE buttonsTemplate defaultAction support

axios-error

  • [new] add .status property

0.7.10 / 2018-10-09

09 Oct 07:41
Compare
Choose a tag to compare

messaging-api-messenger

  • [new] Implement persona apis:

  • createPersona():

createPersona({
  name: 'John Mathew',
  profile_picture_url: 'https://facebook.com/john_image.jpg',
}).then(persona => {
  console.log(persona);
  // {
  //  "id": "<PERSONA_ID>"
  // }
});
  • getPersona(personaId):
getPersona(personaId).then(persona => {
  console.log(persona);
  // {
  //   "name": "John Mathew",
  //   "profile_picture_url": "https://facebook.com/john_image.jpg",
  //   "id": "<PERSONA_ID>"
  // }
});
  • getPersonas(cursor?: string):
getPersonas(cursor).then(personas => {
  console.log(personas);
  // {
  //   "data": [
  //     {
  //       "name": "John Mathew",
  //       "profile_picture_url": "https://facebook.com/john_image.jpg",
  //       "id": "<PERSONA_ID>"
  //     },
  //     {
  //       "name": "David Mark",
  //       "profile_picture_url": "https://facebook.com/david_image.jpg",
  //       "id": "<PERSONA_ID>"
  //     }
  //   ],
  //   "paging": {
  //     "cursors": {
  //       "before": "QVFIUlMtR2ZATQlRtVUZALUlloV1",
  //       "after": "QVFIUkpnMGx0aTNvUjJNVmJUT0Yw"
  //     }
  //   }
  // }
});
  • getAllPersonas():
getAllPersonas().then(personas => {
  console.log(personas);
  //   [
  //     {
  //       "name": "John Mathew",
  //       "profile_picture_url": "https://facebook.com/john_image.jpg",
  //       "id": "<PERSONA_ID>"
  //     },
  //     {
  //       "name": "David Mark",
  //       "profile_picture_url": "https://facebook.com/david_image.jpg",
  //       "id": "<PERSONA_ID>"
  //     }
  //   ]
});
  • deletePersona(personaId):
deletePersona(personaId);
  • [fix] getAssociatedLabels: get name field by default and add options for fields.

0.7.9 / 2018-09-30

30 Sep 12:07
Compare
Choose a tag to compare

messaging-api-line

  • [new] add apis for default rich menu:

  • getDefaultRichMenu():

client.getDefaultRichMenu().then(richMenu => {
  console.log(richMenu);
  // {
  //   "richMenuId": "{richMenuId}"
  // }
});
  • setDefaultRichMenu(richMenuId):
client.setDefaultRichMenu('{richMenuId}');
  • deleteDefaultRichMenu():
client.deleteDefaultRichMenu();

0.7.8 / 2018-09-19

19 Sep 06:00
Compare
Choose a tag to compare
  • [new] add request deubg hook, so now we can use DEBUG env variable to enable request debugger:
DEBUG=messaging-api*
  • [deps] upgrade all of dependencies and migrate to lerna v3

0.7.7 / 2018-09-16

16 Sep 09:15
Compare
Choose a tag to compare

axios-error

  • [new] use util.inspect.custom instead of Object.inspect

messaging-api-messenger

  • [fix] add custom token support to appsecret_proof #392

0.7.6 / 2018-08-23

28 Aug 09:55
Compare
Choose a tag to compare

messaging-api-slack

  • [new] add custom token support to all SlackOAuthClient methods

axios-error

  • [new] support creating AxiosError with Error instance only

0.7.5 / 2018-08-04

04 Aug 12:21
Compare
Choose a tag to compare

messaging-api-line

  • [new] add quickReply support:
client.replyText(REPLY_TOKEN, 'Hello!', {
  quickReply: {
    items: [
      {
        type: 'action',
        action: {
          type: 'cameraRoll',
          label: 'Send photo',
        },
      },
      {
        type: 'action',
        action: {
          type: 'camera',
          label: 'Open camera',
        },
      },
    ],
  },
});

0.7.4 / 2018-07-12

12 Jul 04:16
Compare
Choose a tag to compare

messaging-api-messenger

  • [fix] set maxContentLength for Messenger uploadAttachment

0.7.3 / 2018-06-19

19 Jun 04:01
Compare
Choose a tag to compare

messaging-api-messenger

  • [new] export Messenger, MessengerBatch, MessengerBroadcast from browser entry

messaging-api-line

  • [new] support LINE Front-end Framework (LIFF):
  • [new] support Flex message:

  • [new] export Line from browser entry, so it can be used in the browser with module bundler:
const { Line } = require('messaging-api-line');

liff.sendMessages([
  Line.createText('hello~~~~~~'),
  Line.createText('world~~~~~~'),
]);