Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

payfast javascript

<input type="hidden" name="subscription_type" value="2"> 
Comment

payfast javascript integration

const params = new URLSearchParams({
  merchant_id: "....",
  merchant_key: "....",
  return_url: "https://yourApplication/paymentscreen",
  cancel_url: "https://yourApplication/paymentscreen",
  notify_url: "https://yourApplication/paymentscreen",
  name_first: name,
  email_address: email,
  m_payment_id: unique_id_for_user,
  amount: amount,
  item_name: payment_name,
  item_description: description_if_any,
  custom_int1: custome_integer_value_if_any,
  custom_str1: custome_string_value_if_any,
  custom_str2: custome_string_value_if_any,
  passphrase: passphrase_set_in_payfast_account.
});

// Create an MD5 signature of it.
const MD5Signature = md5(params.toString())
Comment

payfast javascript integration

<form action="https://www.payfast.co.za/eng/process" method="POST">
          <input type="hidden" name="merchant_id" value="...." />
          <input type="hidden" name="merchant_key" value="....." />
          <input type="hidden" name="return_url" value="https://yourApplication/paymentscreen" />
          <input type="hidden" name="cancel_url" value="https://yourApplication/paymentscreen" />
          <input type="hidden" name="notify_url" value="https://yourApplication/paymentscreen" />
          <input type="hidden" name="name_first" value={name} />
          <input type="hidden" name="email_address" value={email} />
          <input type="hidden" name="m_payment_id" value={unique_id_for_user} />
          <input type="hidden" name="amount" value={amount} />
          <input type="hidden" name="item_name" value={payment_name} />
          <input type="hidden" name="item_description" value={description_if_any} />
          <input type="hidden" name="custom_int1" value={custome_integer_value_if_any} />
          <input type="hidden" name="custom_str1" value={custome_string_value_if_any} />
          <input type="hidden" name="custom_str2" value={custome_string_value_if_any} />
          <input type="hidden" name="passphrase" value="passphrase" />
          <input type="hidden" name="signature" value={MD5Signature} />
          <div className="row" style={{display: 'flex', justifyContent: 'center', alignItems: 'center'}}>
            <div className="col-lg-6">
              <img alt="payfast" src="../public/upload/payfastpaynow.png" vspace="3" width="100%" height="100%" />
            </div>
            <div className="col-lg-6">
                <input style={{marginRight: 20, float: 'right'}} name="disable" type="submit" disabled={isEnablePayment} width="100%" height="100%" alt="Submit" align="bottom" value="Purchase" />
            </div>
          </div>
        </form>
Comment

PREVIOUS NEXT
Code Example
Javascript :: vendor bundle base js and bootstrap min js conflict 
Javascript :: react createElement interactive button 
Javascript :: kendo jquery listview 
Javascript :: onclick display array value javascript 
Javascript :: menu open onload problem 
Javascript :: how to get 3rd level form data by $refs in vue 
Javascript :: get item position in canvas 
Javascript :: automatic jquery interceptor with token 
Javascript :: adding growl delete notifications in vanilla js 
Javascript :: controller in angularjs projects 
Javascript :: JS glob to regex 
Javascript :: jquery copier dans le presse papier 
Javascript :: what is amqp10 policy nodejs 
Javascript :: node js reuire json shows onject 
Javascript :: jhow to make a fish in javascript 
Javascript :: -d {followingjson} curl 
Javascript :: validator.js github 
Javascript :: prevent htmp injection in jsp 
Javascript :: devexpress winforms get readonly colour for current themes 
Javascript :: angular url not valid send you to a component 
Javascript :: how many characters can fit in 1 line of div 
Javascript :: write confirm dialog box if yes then run function using php 
Javascript :: Javascript uninstall dependancy 
Javascript :: ismodified function 
Javascript :: mouseover event in angular 11 
Javascript :: array.of 
Javascript :: javascript if null use other value 
Javascript :: fiter on redux state 
Javascript :: Utils is not a constructor MuiPickersUtilsProvider 
Javascript :: javascript accessing this in callback 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =