Get Payment Action

Getting Payment Action

The getPaymentAction method retrieves payment action information. It takes a single parameter:

  • pubkey: String representation of the public key

Example usage

import { PartPayClient } from '@partpay/sdk';
import { Keypair } from '@solana/web3.js';

async function getPaymentActionInfo() {
  const endpoint = 'https://api.mainnet-beta.solana.com';
  const secretKey = Keypair.generate().secretKey;
  const client = PartPayClient.createWithUmi(endpoint, secretKey);

  const pubkey = Keypair.generate().publicKey.toBase58();
  
  try {
    const paymentAction = await client.getPaymentAction(pubkey);
    console.log('Payment action:', paymentAction);
  } catch (error) {
    console.error('Error getting payment action:', error);
  }
}

getPaymentActionInfo();

This method returns an ActionGetResponse object containing payment action information.