| POST | /payfast/webhook/{PublicAccessGuid} |
|---|
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using digitaluapi.ServiceModel;
namespace digitaluapi.ServiceModel
{
public partial class PayFastWebHook
{
[DataMember(Name="m_payment_id")]
public virtual string MPaymentId { get; set; }
[DataMember(Name="pf_payment_id")]
public virtual string PfPaymentId { get; set; }
[DataMember(Name="payment_status")]
public virtual string PaymentStatus { get; set; }
[DataMember(Name="item_name")]
public virtual string ItemName { get; set; }
[DataMember(Name="item_description")]
public virtual string ItemDescription { get; set; }
[DataMember(Name="amount_gross")]
public virtual double AmountGross { get; set; }
[DataMember(Name="amount_fee")]
public virtual double AmountFee { get; set; }
[DataMember(Name="amount_net")]
public virtual double AmountNet { get; set; }
[DataMember(Name="custom_str1")]
public virtual string CustomStr1 { get; set; }
[DataMember(Name="custom_str2")]
public virtual string CustomStr2 { get; set; }
[DataMember(Name="custom_str3")]
public virtual string CustomStr3 { get; set; }
[DataMember(Name="custom_str4")]
public virtual string CustomStr4 { get; set; }
[DataMember(Name="custom_str5")]
public virtual string CustomStr5 { get; set; }
[DataMember(Name="custom_int1")]
public virtual int CustomInt1 { get; set; }
[DataMember(Name="custom_int2")]
public virtual int CustomInt2 { get; set; }
[DataMember(Name="custom_int3")]
public virtual int CustomInt3 { get; set; }
[DataMember(Name="custom_int4")]
public virtual int CustomInt4 { get; set; }
[DataMember(Name="custom_int5")]
public virtual int CustomInt5 { get; set; }
[DataMember(Name="name_first")]
public virtual string NameFirst { get; set; }
[DataMember(Name="name_last")]
public virtual string NameLast { get; set; }
[DataMember(Name="email_address")]
public virtual string EmailAddress { get; set; }
[DataMember(Name="merchant_id")]
public virtual string MerchantId { get; set; }
[DataMember(Name="signature")]
public virtual string Signature { get; set; }
[DataMember(Name="token")]
public virtual string Token { get; set; }
[DataMember(Name="billing_date")]
public virtual DateTime BillingDate { get; set; }
public virtual Guid PublicAccessGuid { get; set; }
public virtual bool Sandbox { get; set; }
}
}
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/" />