| POST | /payfast/webhook/{PublicAccessGuid} |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
import com.google.gson.annotations.*;
import com.google.gson.reflect.*;
public class dtos
{
public static class PayFastWebHook
{
@DataMember(Name="m_payment_id")
@SerializedName("m_payment_id")
public String MPaymentId = null;
@DataMember(Name="pf_payment_id")
@SerializedName("pf_payment_id")
public String PfPaymentId = null;
@DataMember(Name="payment_status")
@SerializedName("payment_status")
public String PaymentStatus = null;
@DataMember(Name="item_name")
@SerializedName("item_name")
public String ItemName = null;
@DataMember(Name="item_description")
@SerializedName("item_description")
public String ItemDescription = null;
@DataMember(Name="amount_gross")
@SerializedName("amount_gross")
public Double AmountGross = null;
@DataMember(Name="amount_fee")
@SerializedName("amount_fee")
public Double AmountFee = null;
@DataMember(Name="amount_net")
@SerializedName("amount_net")
public Double AmountNet = null;
@DataMember(Name="custom_str1")
@SerializedName("custom_str1")
public String CustomStr1 = null;
@DataMember(Name="custom_str2")
@SerializedName("custom_str2")
public String CustomStr2 = null;
@DataMember(Name="custom_str3")
@SerializedName("custom_str3")
public String CustomStr3 = null;
@DataMember(Name="custom_str4")
@SerializedName("custom_str4")
public String CustomStr4 = null;
@DataMember(Name="custom_str5")
@SerializedName("custom_str5")
public String CustomStr5 = null;
@DataMember(Name="custom_int1")
@SerializedName("custom_int1")
public Integer CustomInt1 = null;
@DataMember(Name="custom_int2")
@SerializedName("custom_int2")
public Integer CustomInt2 = null;
@DataMember(Name="custom_int3")
@SerializedName("custom_int3")
public Integer CustomInt3 = null;
@DataMember(Name="custom_int4")
@SerializedName("custom_int4")
public Integer CustomInt4 = null;
@DataMember(Name="custom_int5")
@SerializedName("custom_int5")
public Integer CustomInt5 = null;
@DataMember(Name="name_first")
@SerializedName("name_first")
public String NameFirst = null;
@DataMember(Name="name_last")
@SerializedName("name_last")
public String NameLast = null;
@DataMember(Name="email_address")
@SerializedName("email_address")
public String EmailAddress = null;
@DataMember(Name="merchant_id")
@SerializedName("merchant_id")
public String MerchantId = null;
@DataMember(Name="signature")
@SerializedName("signature")
public String Signature = null;
@DataMember(Name="token")
@SerializedName("token")
public String Token = null;
@DataMember(Name="billing_date")
@SerializedName("billing_date")
public Date BillingDate = null;
public UUID PublicAccessGuid = null;
public Boolean Sandbox = null;
public String getMPaymentId() { return MPaymentId; }
public PayFastWebHook setMPaymentId(String value) { this.MPaymentId = value; return this; }
public String getPfPaymentId() { return PfPaymentId; }
public PayFastWebHook setPfPaymentId(String value) { this.PfPaymentId = value; return this; }
public String getPaymentStatus() { return PaymentStatus; }
public PayFastWebHook setPaymentStatus(String value) { this.PaymentStatus = value; return this; }
public String getItemName() { return ItemName; }
public PayFastWebHook setItemName(String value) { this.ItemName = value; return this; }
public String getItemDescription() { return ItemDescription; }
public PayFastWebHook setItemDescription(String value) { this.ItemDescription = value; return this; }
public Double getAmountGross() { return AmountGross; }
public PayFastWebHook setAmountGross(Double value) { this.AmountGross = value; return this; }
public Double getAmountFee() { return AmountFee; }
public PayFastWebHook setAmountFee(Double value) { this.AmountFee = value; return this; }
public Double getAmountNet() { return AmountNet; }
public PayFastWebHook setAmountNet(Double value) { this.AmountNet = value; return this; }
public String getCustomStr1() { return CustomStr1; }
public PayFastWebHook setCustomStr1(String value) { this.CustomStr1 = value; return this; }
public String getCustomStr2() { return CustomStr2; }
public PayFastWebHook setCustomStr2(String value) { this.CustomStr2 = value; return this; }
public String getCustomStr3() { return CustomStr3; }
public PayFastWebHook setCustomStr3(String value) { this.CustomStr3 = value; return this; }
public String getCustomStr4() { return CustomStr4; }
public PayFastWebHook setCustomStr4(String value) { this.CustomStr4 = value; return this; }
public String getCustomStr5() { return CustomStr5; }
public PayFastWebHook setCustomStr5(String value) { this.CustomStr5 = value; return this; }
public Integer getCustomInt1() { return CustomInt1; }
public PayFastWebHook setCustomInt1(Integer value) { this.CustomInt1 = value; return this; }
public Integer getCustomInt2() { return CustomInt2; }
public PayFastWebHook setCustomInt2(Integer value) { this.CustomInt2 = value; return this; }
public Integer getCustomInt3() { return CustomInt3; }
public PayFastWebHook setCustomInt3(Integer value) { this.CustomInt3 = value; return this; }
public Integer getCustomInt4() { return CustomInt4; }
public PayFastWebHook setCustomInt4(Integer value) { this.CustomInt4 = value; return this; }
public Integer getCustomInt5() { return CustomInt5; }
public PayFastWebHook setCustomInt5(Integer value) { this.CustomInt5 = value; return this; }
public String getNameFirst() { return NameFirst; }
public PayFastWebHook setNameFirst(String value) { this.NameFirst = value; return this; }
public String getNameLast() { return NameLast; }
public PayFastWebHook setNameLast(String value) { this.NameLast = value; return this; }
public String getEmailAddress() { return EmailAddress; }
public PayFastWebHook setEmailAddress(String value) { this.EmailAddress = value; return this; }
public String getMerchantId() { return MerchantId; }
public PayFastWebHook setMerchantId(String value) { this.MerchantId = value; return this; }
public String getSignature() { return Signature; }
public PayFastWebHook setSignature(String value) { this.Signature = value; return this; }
public String getToken() { return Token; }
public PayFastWebHook setToken(String value) { this.Token = value; return this; }
public Date getBillingDate() { return BillingDate; }
public PayFastWebHook setBillingDate(Date value) { this.BillingDate = value; return this; }
public UUID getPublicAccessGuid() { return PublicAccessGuid; }
public PayFastWebHook setPublicAccessGuid(UUID value) { this.PublicAccessGuid = value; return this; }
public Boolean isSandbox() { return Sandbox; }
public PayFastWebHook setSandbox(Boolean value) { this.Sandbox = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /payfast/webhook/{PublicAccessGuid} HTTP/1.1
Host: duengageapi.uat.scadsoftware.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<PayFastWebHook xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/digitaluapi.ServiceModel">
<AmountFee>0</AmountFee>
<AmountGross>0</AmountGross>
<AmountNet>0</AmountNet>
<BillingDate>0001-01-01T00:00:00</BillingDate>
<CustomInt1>0</CustomInt1>
<CustomInt2>0</CustomInt2>
<CustomInt3>0</CustomInt3>
<CustomInt4>0</CustomInt4>
<CustomInt5>0</CustomInt5>
<CustomStr1>String</CustomStr1>
<CustomStr2>String</CustomStr2>
<CustomStr3>String</CustomStr3>
<CustomStr4>String</CustomStr4>
<CustomStr5>String</CustomStr5>
<EmailAddress>String</EmailAddress>
<ItemDescription>String</ItemDescription>
<ItemName>String</ItemName>
<MPaymentId>String</MPaymentId>
<MerchantId>String</MerchantId>
<NameFirst>String</NameFirst>
<NameLast>String</NameLast>
<PaymentStatus>String</PaymentStatus>
<PfPaymentId>String</PfPaymentId>
<PublicAccessGuid>00000000-0000-0000-0000-000000000000</PublicAccessGuid>
<Sandbox>false</Sandbox>
<Signature>String</Signature>
<Token>String</Token>
</PayFastWebHook>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <z:anyType xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />