In Spring '23, our global method doPayment now supports passing of profile ID on payment.

In the sample code below, you can pass the profile ID instead of the Credit Card Number for payment. If you pass both profile ID and Credit Card Number, it will update the profile ID with the Credit Card Number value.

    private static fw1__Payment__c formulatePaymentRequest() {
        
        fw1__Payment__c payment = new fw1__Payment__c();
        
        payment.fw1__Payment_Processor__c = getDefaultPaymentProcessor();
        payment.fw1__API_Payment__c = true;
        payment.fw1__Payment_Method__c = 'Credit Card';
        payment.fw1__Type__c = 'Charge'; // possible values: Charge/Authorization
        payment.fw1__Payment_Date__c = System.Now();
        
        // THE FOLLOWING DATA WOULD NORMALLY COME FROM YOUR INTERFACE
        
        payment.Name = 'Sample payment'; // any name to identify the payment
        payment.fw1__Amount__c = 10.00; // amount to charge
        payment.fw1__Email_Currency_Symbol__c = '$';
        payment.fw1__Credit_Card_Type__c = 'Visa';
        payment.fw1__First_Name__c = 'Joe';
        payment.fw1__Last_Name__c = 'Smith';
        payment.fw1__Credit_Card_Number__c = '4111111111111111';
        payment.fw1__Expiry_Month__c = '01';
        payment.fw1__Expiry_Year__c = '2018';
        payment.fw1__Billing_Street__c = '12345 sepulveda st';
        payment.fw1__Billing_City__c = 'Torrance';
        payment.fw1__Billing_State__c = 'CA';
        payment.fw1__Billing_Zip__c = '90505';
        payment.fw1__Billing_Country__c = 'US';
        payment.fw1__Email__c = 'test@yourcompany.com'; // optional, if populated a receipt will be sent to this email
        
        // You can optionally attach the payment to an account, contact or opportunity by populating the fields below
        
        // payment.fw1__Account__c = 
        // payment.fw1__Contact__c = 
        // payment.fw1__Opportunity__c = 
        
        return payment;
    }

 

You can check the full sample code utilizing our global class to submit payment here: https://help.kulturra.com/help/sample-code-submit-payment

 

Availability: Spring '23 Release