/** * These are the required properties * @param{Object} data The payload. * @param{Object} data.attributes Payload attributes. * @param{string} data.attributes.type The type of payment method. The possible value is card for now. * @param{string} data.attributes.details.card_number Credit/Debit Card number of the PaymentMethod. * @param{number} data.attributes.details.exp_month Expiry month of the Credit/Debit Card. * @param{number} data.attributes.details.exp_year Expiry year of the Credit/Debit Card. * @param{string} data.attributes.details.cvc CVC of the Credit/Debit Card. */constresult=awaitpaymongo.paymentMethods.create(data);
Payload
{ data: { attributes: { type:'card',// The only available type for now is 'card'. details: { card_number:'4343434343434345', exp_month:02, exp_year:23, cvc:'123', } } }}
Retrieving a Payment Method
/** * @param{string} id The PaymentMethod id */constresult=awaitpaymongo.paymentMethods.retrieve(id);