Skip to content

Commit

Permalink
Actually attach the selected card when sending on-chain payment
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyej committed Jul 10, 2020
1 parent f3873fe commit 52f4c3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/actions/messages/sendPayment.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const sendPayment = (rawTransaction, metadata, contact) => {
dispatch(sendPaymentRequest());

// Send payment as a message to the contact's Pine server.
return dispatch(sendPaymentToServer(rawTransaction, contact))
return dispatch(sendPaymentToServer(rawTransaction, contact, metadata.card))
.then((sentMessage) => {
const message = {
id: sentMessage.id,
Expand Down
6 changes: 4 additions & 2 deletions src/actions/paymentServer/messages/sendPayment.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ const sendPaymentFailure = (error) => {
* @param {string} contact.address - The contact's Pine address.
* @param {string} contact.userId - The contact's user ID.
* @param {string} contact.publicKey - The contact's public key.
* @param {string} [card] - A Pine greeting card to attach to the payment (optional).
*/
export const sendPayment = (transaction, contact) => {
export const sendPayment = (transaction, contact, card) => {
return (dispatch, getState) => {
const state = getState();
const { credentials } = state.pine;
Expand All @@ -49,7 +50,8 @@ export const sendPayment = (transaction, contact) => {
type: MESSAGE_TYPE_PAYMENT,
data: {
transaction,
network
network,
card
}
};

Expand Down

0 comments on commit 52f4c3a

Please sign in to comment.